Create cli
⚙️ There are many like them, but these dotfiles are mine. A stow-managed macOS setup: Zsh, Neovim, tmux, Ghostty, and a pile of Claude Code tooling.
npx -y skills add magnusrodseth/dotfiles --skill create-cliAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Design and build command-line tools, both the interface spec (args, flags, subcommands, help, output modes, errors, exit codes, config) per clig.dev and the implementation using Magnus's agent-ready Rust house style (clap derive, global --json, keychain/op/file secret backends, in-repo agent skills, AGENTS.md) modeled on sparebank1-cli and skatteetaten-cli. Use when the user wants to create a new CLI, design a CLI interface, scaffold a command-line tool, or make an existing CLI agent-friendly.
SKILL.md
3.4 KB, as published. Nobody here has run it
Create CLI
Two modes. Pick from what the user asked for:
- Design: produce an interface spec the user (or a later session) can implement. Language-agnostic.
- Build: scaffold and implement, defaulting to the house style (Rust + clap) unless the user names another stack.
Do This First
- Read
references/cli-guidelines.md(condensed clig.dev; the baseline rubric for any CLI). - Read
references/house-style.md(Magnus's agent-ready skeleton, with~/dev/personal/sparebank1-cliand~/dev/personal/skatteetaten-clias living exemplars to copy from).
Clarify (fast, then proceed with defaults)
- Name + one-sentence purpose. Short 2-3 char binary name?
- Primary consumers: humans, scripts, AI agents, or all three. (Default here: agents are first-class consumers.)
- Read-only or mutating? Mutating means confirm-prompts,
-y, and scope restrictions from day one. Read-only as a design invariant is worth stating explicitly. - Auth/secrets involved? Which backend story (keychain/op/file)?
- Distribution: personal (
install.sh+ cargo) or public (crates.io, release matrix)?
Design mode: deliverables
Produce a compact spec:
- Command tree + USAGE synopsis (noun-verb grouping; the
--helptree is how agents discover capabilities, so make it a deterministic search tree). - Args/flags table: types, defaults, required/optional, examples.
- Output contract: stdout vs stderr,
--json(table stakes for agents), TTY detection,--quiet/--verbose, color rules (NO_COLOR). - Error + exit-code map for the top failure modes, with messages that state the fix.
- Safety rules: confirmations,
-y/--force,--no-input, dry-run story. - Config/env precedence: flags > env > project config > user config.
- 5-10 example invocations, including piped/stdin and agent (
--json) use.
Build mode: house style
Follow references/house-style.md. The short version: clap derive with
global --json and --mask, stdout-is-data discipline, three-backend
secret store defaulting to keychain, thiserror + anyhow two-layer errors,
confirm-before-mutation, polite API etiquette (honest User-Agent, no retry
loops), co-located tests for pure logic, fmt/clippy/test CI, and the
install.sh + tag-driven release pipeline. Copy secrets.rs, install.sh,
error.rs, and the workflows from an exemplar repo and rename.
Every CLI ships its agent surface in the same repo:
AGENTS.mdat root with explicit operating rules for agents.skills/<tool>-shared/SKILL.mdas the runtime contract (command map, storage table, output contract, etiquette), plus per-area skills when the command surface grows.
Notes
- Full upstream guidelines: https://clig.dev/
- Check current library docs (clap etc.) via find-docs/ctx7 before coding; do not trust memorized API details.
- If the request is design-only, do not drift into implementation.