Vibeleaderboard
← All Intel
Intel / post

Building CLIs for AI Agents

Source
x.com
Author
eric zakariasson
Date

Context

A used by an AI agent should make missing information recoverable without requiring an interactive menu. Eric Zakariasson's design guide recommends accepting inputs as command options or piped data, and returning an actionable error when required information is absent.

That lets the agent correct the command and try again. Retries introduce another requirement: repeating a successful operation should not accidentally create a duplicate. Zakariasson recommends repeat-safe behavior and returning concrete results, such as an and destination URL. Together, these choices make the tool's easier for an automated caller to understand.

Key takeaways · AI-distilled
  • Do not dump the full manual up front. Let the top-level command list subcommands and make the agent drill into the one it picked, so it spends no reading about commands it will never run.
  • Examples do most of the work in a help page. An agent pattern-matches off a full sample invocation faster than it reads a prose description of each flag.
  • Pick one naming pattern — resource then verb — and apply it everywhere. An agent that learns one command can then guess the ones it has never seen instead of hunting through help output.
  • Return usable data on success, like the deploy ID and the URL. Agents chain commands, so the output of one is the input of the next. Emoji and celebration text are noise in that pipeline.
Terms in this piece · Glossary
  • CLI tool — A command-line capability an agent can discover and compose through shell commands.
  • Operation identifier — A unique identifier sent with a request so that a receiving service which honors it can recognize a repeat and answer with the original result instead of acting again.
  • State — Information describing a system at a particular moment, such as its current text, settings or saved records.
  • Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Key quotes

“Most CLIs were built assuming a human is at the keyboard.”

“An agent pattern-matches off mycli deploy --env staging --tag v1.2.3 faster than it reads a description.”

“Most of the work is just making explicit what humans figured out implicitly!”

Recommended reads