Every CLI should include agent skills
Key takeaway: If you build a CLI, expose structured output, state inspection, and error context so an AI layer can reason about it.
Command-line tools still hand you an error code and leave the diagnosis to you. Every CLI should give agents enough structure to help: what failed, the state the tool saw, and the next command to run.
Imagine a git that explains a messy merge and offers resolution strategies based on what’s actually in the conflicts. A kubectl that tells you why your pod keeps crashing by tying together the logs, the resource limits, and the recent config changes. I built a small version of this with git ai-commit, which reads the staged diff and writes the commit message.
You don’t need to embed a language model in every CLI. You need to expose the hooks an AI layer can reason about. Here’s one failure in a made-up deploy tool, shipit. By default it prints a line for a person:
$ shipit deploy api
Error: deploy blocked: 2 migrations have not run
An agent has to parse that English and guess which migrations. With --json, the same failure is data:
{
"ok": false,
"error": {
"code": "MIGRATION_PENDING",
"message": "deploy blocked: 2 migrations have not run",
"context": {
"service": "api",
"pending": [
"20260210_add_orders_index",
"20260214_backfill_totals"
]
},
"next": "shipit migrate api"
}
}
The agent can branch on code. context shows what the tool saw, and next is the command that unblocks it. All it takes is routing every failure through one function with a typed shape, so the list of errors an agent might see lives in one file.
I’d expect the tools that do this first to have a real advantage, because developers will pick CLIs that help them think, not just execute.