Add CLI Command

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

jcaiagent7143-ui Updated

File contents

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.

jcaiagent7143-ui/harnessforge/tree/main/src/harness/blueprints/python-cli-app/skills/add-cli-command commit ccc260046a

Frequently asked questions

npx skillmds@latest add jcaiagent7143-ui/add-cli-command