You need to rewrite your CLI for AI agents

justin.poehnelt.com
March 4, 2026
9 min read
🔥🔥🔥🔥🔥
55/100
Summary
Human DX focuses on discoverability and forgiveness, while Agent DX prioritizes predictability and defense-in-depth. Retrofitting a human-first CLI for AI agents is ineffective, necessitating a design specifically tailored for AI agents from the outset.
Key Takeaways
- Human Developer Experience (DX) focuses on discoverability and forgiveness, while Agent DX prioritizes predictability and defense-in-depth.
- A CLI designed for AI agents should utilize raw JSON payloads instead of bespoke flags to avoid translation loss and improve efficiency.
- Schema introspection within the CLI can replace static documentation, allowing agents to query the current API structure at runtime.
- Implementing field masks and NDJSON pagination helps manage API response sizes, optimizing the context window for AI agents.
Coverage & discussions
Hacker News · justin.poehnelt.com
Community discussions
Community Sentiment
Positives
- The notion that LLM assistants could drive a shift towards making all app features accessible via textual interfaces highlights the potential for improved user interaction with AI.
- Adapting GUIs to be wrappers around command line interfaces could streamline AI interactions, making it easier for AI agents to leverage existing tools.
Concerns
- The speculative nature of the proposed CLI design raises concerns about its actual effectiveness and practicality in real-world applications.
- Relying on JSON schemas for AI agents may lead to inefficiencies, as it could consume excessive tokens in context, limiting the model's performance.
- The assumption that agents work better with JSON over documented flags lacks validation, creating skepticism about its reliability.




