# Add CLI Command

> Add a new subcommand or flag to the project's CLI without breaking existing UX.

- Skill: `jcaiagent7143-ui/add-cli-command` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jcaiagent7143-ui/add-cli-command`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jcaiagent7143-ui/add-cli-command/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: jcaiagent7143-ui (https://skillmd.com/u/jcaiagent7143-ui)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/jcaiagent7143-ui/add-cli-command

---


# Add CLI command

## Steps

1. **Find the CLI entry point.** Look for `if __name__ == "__main__":`, or a `main()` function, or a Typer/Click/argparse setup. Don't grep blindly — `[project.scripts]` in `pyproject.toml` names it.
2. **Match the existing CLI library.** If the project uses argparse, stay with argparse — don't introduce Typer mid-project.
3. **Add the command** with a docstring matching surrounding style.
4. **Wire `--help`** — every command needs a one-line help string.
5. **Write a test** in the project's test file. Use the same test framework already in use.
6. **Run tests + lint** before declaring done.

## Failure modes to avoid

- Adding a new CLI library (Typer/Click) when the project already uses argparse.
- Adding a `--verbose` flag when the project already has one called `--log-level`.
- Breaking `--help` for existing commands by changing shared argparse defaults.
- Shipping without a test.

