Writing agent friendly clis

From edmundmiller/dotfiles · View interactive version

Writing agent friendly clis is an AI agent skill from the GitHub repository edmundmiller/dotfiles. Write, design, or review agent-friendly CLIs and agentic interfaces for humans, scripts, and coding agents, with progressive disclosure, structured output, actionable errors, stdout/stderr separation, and explicit non-interactive modes.

How to use this skill

Skill file

Writing Agent-Friendly CLIs

Use this skill when building, reviewing, or redesigning a CLI or agentic interface meant to serve both humans and coding agents. Do not use it merely to decide whether to prefix an arbitrary command with environment variables.

Design principles

Model the CLI after Notion's ntn: one tool that is pleasant for humans, scriptable for shells, and predictable for agents.

  1. Progressive disclosure — make the common path short, with deeper help/docs/spec output behind flags or subcommands.
  2. Actionable errors — say what failed, why it likely failed, and the exact next command or flag to try.
  3. Separate data from messages — write machine-readable data to stdout; write progress, warnings, prompts, and diagnostics to stderr.
  4. Interactive and non-interactive modes — prompts are fine for humans, but every prompt must have a flag/env/stdin equivalent for agents and CI.

Output contract

Command shape

Input contract

Agent affordances

Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.