Agent-Native CLIs

An agent-native CLI is a service interface designed for machine operators: compact output, predictable flags, typed errors, local search, compound commands, and non-interactive safety.

For shell agents, a good CLI is often the highest-bandwidth interface. The model already understands commands, pipes, exit codes, files, and JSON. A compact command can beat a generic MCP wrapper when the task repeats thousands of times.

The Thesis

MCP wins discovery. CLIs win repeated shell execution. The right answer is not a holy war, thank god, we have enough of those in JavaScript package managers. The right answer is route by harness and task:

  • IDE/desktop agent: MCP is natural.
  • Shell coding agent: CLI is natural.
  • Repeated service workflow: print or adopt a CLI.
  • Ad-hoc unknown integration: use the official SDK/API, then codify if it recurs.

What Makes a CLI Agent-Native

Feature Why it matters
Auto-JSON when piped Humans get tables; agents get structured data.
--compact output Saves tokens by returning high-gravity fields only.
Typed exit codes Agent can self-correct without prose parsing.
Actionable errors Bad flag -> correct usage, not a paragraph.
--dry-run, --yes, --no-input Safe exploration and unattended execution.
Local SQLite mirror Turns remote pagination into local search/SQL.
Compound commands Encodes domain workflows, not just API endpoints.
Stable IDs and slugs Lets agents refer to objects without opaque UI state.

Creativity Ladder

Most CLIs wrap endpoints. Agent-native CLIs climb:

  1. Endpoint wrapper.
  2. Structured output.
  3. Local persistence and search.
  4. Domain analytics.
  5. Behavioral insight and repair commands.

The higher rungs are why PrintingPress-style CLIs matter: a domain command like stale, health, reconcile, or bottleneck gives the agent a judgment primitive, not just transport.

Relationship to MCP

Generate both interfaces from one spec where possible:

The CLI and MCP server should share auth, schema, clients, and local cache. Duplicating behavior across two hand-built adapters is how systems develop forked reality, which sounds cool until it is your PagerDuty alert.

cli-to-server is the narrow HTTP-adapter variant: it is useful when a trusted local CLI already owns behavior but the caller expects HTTP endpoints. It does not replace the agent-native CLI route; it wraps it, so the same allowlist, working-directory, timeout, environment, and trust-boundary rules still apply.

Routing Rule

When an agent needs a service Kevin uses repeatedly, prefer:

  1. Existing agent-native or first-party CLI.
  2. Printed CLI from a reusable spec.
  3. MCP server for MCP-first harnesses or discovery.
  4. Official SDK/API.
  5. Raw HTTP only for last-resort one-offs.

If the same raw HTTP workflow appears twice, codify it.


Timeline