What is a CLI?
A command-line interface is a text-based way to invoke programs with explicit commands, arguments, standard input, standard output, exit codes, files, and environment variables.
Why is this important?
CLIs are ergonomic for agents because their contracts are compact, composable, scriptable, inspectable, and already cover most developer and infrastructure systems. Agents can discover help, chain commands, capture output, and verify exit status without navigating a visual interface.
How it works
An agent selects an executable, constructs arguments, runs it in a controlled shell, reads stdout and stderr, checks the exit code, and composes the result with files, pipes, scripts, version control, tests, and other commands.
Technical example
A coding agent uses git to inspect a diff, a package CLI to run tests, jq to transform JSON, and a deployment CLI to preview a release. Each tool remains useful independently and composes through shell primitives.
Implementation notes
A CLI exposes broad host capabilities and benefits from mature local tooling, but its text contracts may be less structured and permissions can be coarse. An MCP server exposes discoverable typed tools and resources over a protocol. Agents often use both: CLI for local composability and MCP for governed remote capabilities.


