CommunityCoding & Developmentgithub.com

x0c/agent-friendly-cli

Use when designing, refactoring, or reviewing CLI tools and their accompanying Skills, especially those meant to be reliably invoked by AI agents while remaining usable by humans. Covers command surface design, non-interactive mode, JSON output contracts, exit code hierarchy, dry-run, idempotency, authentication security, responsibility layering of CLI/script/Skill/Agent, transactional orchestration, risk authorization, end-state verification, and acceptance methods.

What is agent-friendly-cli?

This skill, named `x0c/agent-friendly-cli`, provides a comprehensive framework and set of principles for designing, building, or reviewing command-line interfaces (CLIs) that are optimized for stability and correctness when invoked by AI agents (such as those used in developer tools like Claude Code, Cursor, or Codex), without sacrificing usability for human operators. It addresses the unique requirements of agent-driven CLI usage, including non-interactive execution, structured JSON output contracts, meaningful exit codes, idempotent operations, and dry-run capabilities. The skill also covers critical aspects like authentication and authorization, clear separation of responsibilities between the CLI, scripts, skills, and the agent itself, safe transactional orchestration with risk authorization, and end-state verification and acceptance testing. By adhering to these guidelines, developers can create CLI tools that AI agents can reliably and safely automate, leading to more robust and trustworthy automation workflows.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/x0c/agent-friendly-cli-skill/tree/main

Installed? Explore more Coding & Development skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does agent-friendly-cli do?

Use when designing, refactoring, or reviewing CLI tools and their accompanying Skills, especially those meant to be reliably invoked by AI agents while remaining usable by humans. Covers command surface design, non-interactive mode, JSON output contracts, exit code hierarchy, dry-run, idempotency, authentication security, responsibility layering of CLI/script/Skill/Agent, transactional orchestration, risk authorization, end-state verification, and acceptance methods.

Related Skills