---
summary: 'CLI reference: commands, flags, config, lockfile, sync behavior.'
read_when:
- Working on CLI behavior
- Debugging install/update/sync
---
# CLI
CLI package: `packages/clawdhub/` (bin: `clawdhub`).
From this repo you can run it via the wrapper script:
```bash
bun clawdhub --help
```
## Global flags
- `--workdir
`: working directory (default: cwd)
- `--dir `: install dir under workdir (default: `skills`)
- `--site `: base URL for browser login (default: `https://clawdhub.com`)
- `--registry `: API base URL (default: discovered, else `https://clawdhub.com`)
- `--no-input`: disable prompts
Env equivalents:
- `CLAWDHUB_SITE`
- `CLAWDHUB_REGISTRY`
## Config file
Stores your API token + cached registry URL.
- macOS: `~/Library/Application Support/clawdhub/config.json`
- override: `CLAWDHUB_CONFIG_PATH`
## Commands
### `login` / `auth login`
- Default: opens browser to `/cli/auth` and completes via loopback callback.
- Headless: `clawdhub login --token clh_...`
### `whoami`
- Verifies the stored token via `/api/v1/whoami`.
### `search `
- Calls `/api/v1/search?q=...`.
### `install `
- Resolves latest version via `/api/v1/skills/`.
- Downloads zip via `/api/v1/download`.
- Extracts into `//`.
- Writes:
- `/.clawdhub/lock.json`
- `/.clawdhub/origin.json`
### `list`
- Reads `/.clawdhub/lock.json`.
### `update [slug]` / `update --all`
- Computes fingerprint from local files.
- If fingerprint matches a known version: no prompt.
- If fingerprint does not match:
- refuses by default
- overwrites with `--force` (or prompt, if interactive)
### `publish `
- Publishes via `POST /api/v1/skills` (multipart).
- Requires semver: `--version 1.2.3`.
### `sync`
- Scans for local skill folders and publishes new/changed ones.
- Flags:
- `--root ` extra scan roots
- `--all` upload without prompting
- `--dry-run` show plan only
- `--bump patch|minor|major` (default: patch)
- `--changelog ` (non-interactive)
- `--tags a,b,c` (default: latest)
- `--concurrency ` (default: 4)
Telemetry:
- Sent during `sync` when logged in, unless `CLAWDHUB_DISABLE_TELEMETRY=1`.
- Details: `docs/telemetry.md`.