CLI
caret-cli is a one-shot installer. Each command runs to completion and exits — there is no daemon, no long-running process, no config file to maintain.
Commands
| Command | Purpose |
|---|---|
| caret init [name] | Scaffold a new CLI project with Caret preinstalled |
| caret add <component> | Copy a registered component into the current project |
| caret list | Print every component the bundled registry exposes |
| caret help | Show the splash + usage |
| caret --version | Print the installed version |
caret init
Creates a new directory containing a runnable starter project: a typed entry file, a tsconfig, a caret.md AI-instruction file, and a .gitignore.
caret init my-cliIf the target directory already exists, init aborts with a non-zero exit code. Pick a fresh path or remove the existing directory first.
caret add
Copies the files for a single component (and its peer files, if any) into the current project. Default destination is caret/<component>/.
caret add prompt
caret add spinner --dir src/ui| Flag | Default | Description |
|---|---|---|
| --dir <path> | caret | Target directory (relative to cwd) |
After copying, add prints any runtime dependencies the component declares (typically ink, react, chalk) so you can npm install them.
caret list
Lists every component in the bundled registry, grouped by kind, with a one-line description for each. Useful as a quick reference; the full catalog with live previews is at /components.
caret listExit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Generic failure (unknown command, missing component, IO error) |
Environment
| Variable | Effect |
|---|---|
| NO_COLOR | Strips all color from CLI output (and from components Caret renders) |
| CI | Adopted by Caret components for non-interactive fallbacks |