add-cli-command

add-cli-command is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 95 tokens per session (1,304 once invoked), scanned A, original, Apache-2.0.

A guide for adding or changing commands in a command-line tool, which is a program people run from a terminal or from scripts. It covers arguments, flags, exit codes, machine-readable output, help text, and tests.

In plain words
What is it for?
Use it when adding a subcommand, option such as --json, output format, validation, help text, or related tests.
Why use it?
It prevents a new command from behaving differently from the rest of the tool or breaking scripts that depend on its output and exit codes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding a subcommand, option such as --json, output format, validation, help text, or related tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/add-cli-command
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill add-cli-command
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for add-cli-command

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/add-cli-command/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/add-cli-command)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-cli-command"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-cli-command/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for add-cli-command

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/add-cli-command"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/add-cli-command.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,304 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.01304
Opus 5.5 $0.00038 $0.00522
Sonnet 5.5 $0.00019 $0.00261
Haiku 4.5 $0.00010 $0.00130

Measured 16d ago against content hash e90f9cbfc8fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-cli-command scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/add-cli-command/SKILL.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Add a CLI command

A CLI is an API whose consumers are humans at a terminal and scripts in a pipeline. Scripts depend on the exit code, the stdout format and the flag names; humans depend on the help text and error messages. Follow the tool's existing conventions first and the Command Line Interface Guidelines (clig.dev) where the tool is silent.

Steps

  1. Read a sibling command. Find the entry point and command registry (Commander, yargs, Click, Typer, Cobra, clap, picocli, System.CommandLine) and copy an existing command's parsing, validation, output and exit handling. Call search_lore for the CLI's JSON envelope, error format and exit-code table.
  2. Design the surface and write --help first. Match the tool's naming (ticket create, not createTicket). Positional arguments only for the one thing the command acts on; everything else is a long flag, with a short alias only where siblings use one. Reuse standard names: -h/--help, --version, --json, -q/--quiet, -f/--force, -n/--dry-run, --no-input, --no-color. Help leads with a usage line and one or two examples. If the help is hard to write, the surface is wrong.
  3. Validate before doing any work. Parse and validate every argument, reject unknown flags, and fail with a one-line message naming the bad input and the fix. Exit codes: 0 success, non-zero on any failure, and the tool's usage-error code (commonly 2) for bad arguments. Never exit 0 after printing an error.
  4. Separate output streams. stdout carries the result only; errors, warnings, progress and logs go to stderr. --json prints exactly one JSON document (or the tool's documented NDJSON) on stdout and nothing else, including on failure if the envelope defines an error shape. Disable colour and spinners when stdout is not a TTY, when NO_COLOR is set, or with --no-color.
  5. Be safe to script. Prompt only when stdin is a TTY and --no-input is absent; otherwise fail with the flag that supplies the answer. Destructive or remote-changing actions confirm interactively or require --force; offer --dry-run when siblings do. Make re-runs safe (idempotent where possible) and give network calls a timeout. On Ctrl-C, stop promptly and exit non-zero (130 by convention).
  6. Keep the command thin. Parse, call the same service or core the API uses, render. Business logic in the handler cannot be reused or unit-tested without a process. If the command writes shared files or state that another invocation, the server or a worker may write concurrently, follow the concurrency-and-async skill (atomic temp-and-rename, a real lock).
  7. Handle configuration and secrets. Read config through the repo's config spine (the add-config-option skill), never raw env reads, and honour the siblings' --config/--db overrides. Never accept a secret as a flag value (it lands in shell history and ps); read it from a file, stdin or the configured secret source. Never print secrets.
  8. Test at both levels. Unit-test the core logic. Spawn the real binary for the contract, one test per AC that exercises the AC's own behaviour, and assert:
    • exit code for success, a usage error and an operational failure;
    • --json stdout parses as JSON with the documented shape, and stderr carries diagnostics without polluting stdout;
    • the error message for bad input; --help lists the new command or flag;
    • non-TTY behaviour: no prompt, no colour; a missing answer fails with a message naming the flag that supplies it.

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed · +22 lines e90f9cbfc8fb
  2. 19d ago First seen · 61 lines · 95 tokens per session scan A d5c749d21c8f

Subscribe to this mod's changes

add-cli-command is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 95 tokens to every session and 1,304 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens