--json output, which makes the CLI a great fit for scripts, CI pipelines, and AI coding agents.
Prerequisites
Installation
You don’t need to install anything globally. Run every command withnpx:
npx humic <command> or add scripts to your package.json.
Step 1: Log in
Authenticate via your browser:~/.config/humic/credentials. All future commands pick them up automatically.
You can also authenticate with a CLI token:
npx @humicdev/cli login --token <your-token>. This is useful for CI environments or shared machines.Step 2: Set up your project
Runinit in the root of your project to connect it to a design system:
humic.config.json in your project and writes the initial token files (CSS custom properties, Tailwind config, and usage context).
You can skip the prompts by passing flags:
Step 3: Pull tokens
After initializing, pull the latest tokens to your project:Commands
Below is the full list of commands. Every command that reads or writes design system data accepts--org <slug> and --ds <slug> to target a specific design system. If you’ve run humic init, these are read from your humic.config.json automatically.
Authentication
| Command | Description |
|---|---|
login | Authenticate via browser or CLI token (--token) |
logout | Log out and revoke your CLI token |
whoami | Show the currently authenticated user and organizations |
Project setup
| Command | Description |
|---|---|
init | Set up Humic in the current project — creates humic.config.json and writes token files |
new | Create a new design system and initialize. Supports --template (blank, tailwind, bootstrap, material) |
pull | Fetch tokens and write to disk |
sync | Sync tokens. --watch for continuous sync, --check to verify drift without writing (exit code 1 if out of sync) |
Design systems
| Command | Description |
|---|---|
ds list | List all design systems across your organizations |
ds rename --name <name> | Rename a design system |
ds setup --org <slug> --file <path> | Create a complete design system from a JSON file (scales, primitives, tokens) |
Tokens
| Command | Description |
|---|---|
tokens list | List tokens. Filter with --type and --status |
tokens upsert --file <path> | Create or update tokens from a JSON file (up to 500 at once) |
tokens delete --names <a,b,c> | Soft-delete tokens by name (comma-separated) |
tokens rename --from <old> --to <new> | Rename a token |
tokens move --from-prefix <old> --to-prefix <new> | Move tokens to a different group |
tokens duplicate --source <name> --target <name> | Duplicate a token |
tokens unused | Find tokens not referenced by any other token |
tokens inconsistent | Find tokens with values outside your scales |
tokens guidelines | Show the design system’s usage guidelines |
Color scales
| Command | Description |
|---|---|
scales list | List all color scales |
scales create --file <path> | Create a scale from JSON ({ name, steps: [{ step, hexLight, hexDark }] }) |
scales update --name <name> --file <path> | Update steps in an existing scale |
scales delete --name <name> | Delete a color scale |
Primitives
| Command | Description |
|---|---|
primitives list | List primitives. Filter with --type |
primitives create --file <path> | Create primitives from a JSON file |
primitives update --file <path> | Update primitives (each entry needs an id) |
primitives delete --ids <a,b,c> | Delete primitives by ID (comma-separated) |
Activity and validation
| Command | Description |
|---|---|
activity | View recent activity. --limit and --offset for pagination |
validate --file <path> | Validate a source file against your design system’s usage rules |
config set <key> <value> | Set a config value (e.g. anthropic-key) |
config get <key> | Get a config value |
JSON output
Every command supports--json for machine-readable output. This is useful for scripts, CI, and AI agents:
Using with AI coding agents
The--json flag makes the CLI work well as a tool for AI coding agents like Claude Code, Cursor, and Codex. Instead of connecting via MCP, agents can call the CLI directly.
For example, in your agent’s configuration or system prompt, you can describe commands like:
Code validation
Thevalidate command checks your code against the design system’s rules — catching hardcoded colors, magic spacing values, and other violations. It returns a score and specific suggestions.
This requires an Anthropic API key (used locally, no data is sent to Humic):
Checking for drift in CI
Usesync --check in your CI pipeline to verify that local token files match the source of truth:
Troubleshooting
'Not authenticated' error
'Not authenticated' error
Run
npx @humicdev/cli login to re-authenticate. If you’re using a CI token, make sure it’s still valid in your Humic dashboard.Command can't find my design system
Command can't find my design system
Make sure you’ve run
npx @humicdev/cli init in your project, or pass --org and --ds explicitly. Run npx @humicdev/cli ds list to see all design systems you have access to.'Could not reach Humic API' error
'Could not reach Humic API' error
Check your internet connection. If you’re behind a proxy or firewall, allow traffic to
humic.dev.validate command not working
validate command not working
This command requires a separate Anthropic API key. Set it with
npx @humicdev/cli config set anthropic-key sk-ant-.... The key is stored locally and only used for local validation.
