cac
Skill by cacjs
Guides an AI assistant through building and maintaining command-line interfaces with the CAC package. Aimed at developers who author or review CLI apps.
Install cac
Built from the published package, never by AI.
git clone --depth 1 https://github.com/cacjs/cac /tmp/cac && mkdir -p ~/.claude/skills && cp -r /tmp/cac/skills/cac ~/.claude/skills/cacRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/cacjs/cac /tmp/cac && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/cac/skills/cac ~/.gemini/antigravity-cli/skills/cacAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill helps an AI assistant build and maintain command-line interfaces with the CAC package. It covers defining commands, options and arguments, generating help and version output, and handling parse errors. It also explains CAC-specific behavior such as default commands, boolean negation, variadic arguments, dot-nested options and -- passthrough.
The skill sets out a step-by-step approach: choose the command shape first, model positional arguments before options, and attach options at the narrowest useful scope. It lists CAC syntax forms and their results, shows centralized error handling with runMatchedCommand, and points to reference files for specific scenarios. It is aimed at developers who write or review CLI apps that use CAC.
Written from the project's SKILL.md and checked against it.
What it can do
- Command designChooses between global parsing, verb-based commands and a default command.
- Positional argumentsModels required, optional and variadic arguments in the right order.
- OptionsPlaces flags at global or command scope and handles required and optional values.
- Boolean negationExplains that bare booleans accept --no-form automatically and when to declare a negated option.
- Nested and array optionsExplains dot-nested option keys and repeated flags that become arrays.
- Help and versionAdds help and version output for user-facing tools.
- Error handlingShows centralized parse and command error handling with runMatchedCommand.
- Scenario referencesPoints to reference files for specific CAC scenarios such as sub-commands and help.
What you need
- pnpm, to install the cac package
Try asking
- Add a build command with a required entry argument to my CLI using CAC
- Explain how boolean negation works in CAC and when to declare --no-option
- Set up centralized error handling for my CAC app with runMatchedCommand
Good to know
- Use allowUnknownOptions() only when forwarding another tool's flags.
- A variadic argument may only appear on the final positional argument.
- Declare an explicit negated option only in specific cases stated in the skill.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/cac/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
README.md1 KB -
SKILL.md6 KB -
references/basic-usage.md417 B -
references/browser.md429 B -
references/command-examples.md529 B
Show all 14 files
-
references/command-options.md503 B -
references/default-command-inverted.md449 B -
references/default-command.md421 B -
references/dot-nested-options.md557 B -
references/help.md717 B -
references/ignore-default-value.md514 B -
references/negated-option.md561 B -
references/sub-command.md1013 B -
references/variadic-arguments.md534 B
Alternatives to cac
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
cac: common questions
How does CAC handle boolean flags?
A bare boolean such as --open accepts both --open and --no-open automatically. An explicit negated option is only needed for help display, a default of true, or pairing with a required-value option.
How do I pass multiple values to one option with CAC?
Repeat the flag, for example --include a --include b, and CAC parses it as an array. Comma-separated input is only recommended if the CLI documents that syntax.
Where do arguments after -- go in CAC?
Everything after a double dash is stored in options['--']. The skill describes this as passthrough for commands such as pnpm test.
How do I install cac?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is cac free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is cac safe to use?
It scores 85 of 100. Grades: maintenance A, licence F, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to cac?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
