Live data from Hacker News

You need to rewrite your CLI for AI agents

justin.poehnelt.com

71–74 of 74 posts

Re: You need to rewrite your CLI for AI agents

#71
I have to add my two cents.

1. Deterministic & Non-Blocking Execution(--yes)

2. Not just Structured Outputs but strictly validated Inputs also("count should be a valid integer")

3. Actionable Structured Errors("")

4. Semantic Exit Codes(0 - ok, 1 - input error, 2 - critical)

5. Granular Verbosity Control(-v, -vv, -vvv)

6. Composable Structured Pipes

Re: You need to rewrite your CLI for AI agents

#73
post #27

Earlier quoted context omitted.

Sure, but the post itself brags, > gws ships 100+ SKILL.md files Which must altogether be hundreds of lines of YAML frontmatter polluting your context.

Claude Code, at least, will only load a SKILL.md file into context when it’s invoked by the user or LLM itself, i.e. in demand.

You could be thinking of the Claude tool search tool [0][1], which lets it do that on-demand loading. Skills (like another comment mentioned) have a progressive disclosure mechanism built-in. Agent Skills [2] appear to be the common format across most of the tools, but I have no idea if this actually has tool provider buy-in.

[0]: https://platform.claude.com/docs/en/agents-and-tools/tool-us...

[1]: https://www.anthropic.com/engineering/advanced-tool-use

[2]: : https://agentskills.io/home

Re: You need to rewrite your CLI for AI agents

#74
Honestly? Don't think you don't need to rewrite your CLI.

The whole "raw JSON > flags" argument sounds clean in a blog but falls apart in practice. Agents are actually good at parsing messy human output. stderr, exit codes, even tables.

I run AI agents against CLIs every day. The failures are almost never, "the outpt wasn't structured enough." They're context window overflows, permission issues, and the agent confidently running the wrong command over and o ver.

The real insight here shouldn't be "rewrite for agents" — it's "make your CLI not actively hostile." --output json and non-zero exit codes on failure. That's should be it.

Maybe we are optimising the wrong layer..

Post reply on HN