All docs
CLI · Overview

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

CommandPurpose
caret init [name]Scaffold a new CLI project with Caret preinstalled
caret add <component>Copy a registered component into the current project
caret listPrint every component the bundled registry exposes
caret helpShow the splash + usage
caret --versionPrint 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.

sh
caret init my-cli

If 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>/.

sh
caret add prompt
caret add spinner --dir src/ui
FlagDefaultDescription
--dir <path>caretTarget 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.

sh
caret list

Exit codes

CodeMeaning
0Success
1Generic failure (unknown command, missing component, IO error)

Environment

VariableEffect
NO_COLORStrips all color from CLI output (and from components Caret renders)
CIAdopted by Caret components for non-interactive fallbacks