-
Notifications
You must be signed in to change notification settings - Fork 846
Open
Description
https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/
TLDR in the blog post:
Add --output json — machine-readable output is table stakes.
Validate all inputs — reject control characters, path traversals, and embedded query params. Assume adversarial input.
Add a schema or --describe command — let agents introspect what your CLI accepts at runtime.
Support field masks or --fields — let agents limit response size to protect their context window.
Add --dry-run — let agents validate before mutating.
Ship a CONTEXT.md or skill files — encode the invariants agents can’t intuit from --help.
Expose an MCP surface — if your CLI wraps an API, expose it as typed JSON-RPC tools over stdio.
Reactions are currently unavailable