Building CLIs for AI Agents Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation of each tool and framework before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
A single-page index of quick back-links to every page in this sub-section, grouped the same way as the sub-section itself — handy for jumping straight to the topic you need instead of paging through the full navigation.
The downloadable PDF is a separate, single A4 page meant for printing. It states the version baseline this sub-section targets — Python 3.12 with Typer 0.27.2, Java 21 with picocli 4.7.7, Node.js 24 with commander 15.0.0, Cobra v1.10.2, clap 4.6.7, swift-argument-parser 1.8.2, System.CommandLine 2.0.12, FastMCP 4.0.10, Spring AI 2.0.1 and the MCP specification revision 2026-07-28, all checked on 2026-09-30 — and covers:
-
the design rules;
-
the exit-code table of the
docsctlrunning example; -
the streams rule (data on stdout, messages on stderr);
-
the TTY and colour rules;
-
the configuration precedence;
-
the JSON output contract;
-
the agent-ergonomics rules;
-
the safety pattern (dry-run, confirmation, idempotency);
-
CLI versus MCP;
-
the wrapping snippets (Python, TypeScript and Spring AI);
-
the injection-defence rules;
-
the frameworks-per-language table;
-
the packaging table;
-
the testing checklist.
Start here — Building CLIs for AI Agents and Agent-Readiness Checklist.
Fundamentals — CLI Design Fundamentals, Streams & Exit Codes, TTY, Colour & Interactivity and Configuration & Auth.
Designing for agents — Machine-Readable Output, Agent Ergonomics, Safety & Idempotency, Self-Describing Help and CLI vs. MCP.
Frameworks by language — Python CLI Frameworks, Java CLI Frameworks, Node.js CLI Frameworks, Go & Rust CLI Frameworks, Swift & .NET CLI Frameworks and TUIs vs. CLIs.
Integration — Wrapping a CLI as an MCP Server, Wrapping a CLI as an Agent Tool and Security.
Shipping — Packaging & Distribution, Testing CLIs and Documenting CLIs.
References
The PDF summarizes these official pages; each is cited in full on the page listed above that covers it, and in Building CLIs for AI Agents' bibliography.
Guidelines and standards
Agents and MCP
Security
Frameworks, packaging and testing