Installation

Install the ClaudeHub CLI globally using your preferred package manager. Node.js 18 or higher is required.

npm
$npm install -g @claudehubcc/cli

After installation, verify by running ch --version.

Quick Start

Get up and running in under a minute. The CLI uses a git-inspired sync model: initialize your project once, then pull and push skills, workflows, and sub-agents as you work.

1

Install the CLI

Install globally with npm, yarn, or pnpm (see above).

npm install -g @claudehubcc/cli
2

Log in with your API key

Generate an API key from your ClaudeHub dashboard under Settings → API Keys, then run:

ch login
? Enter your API key: ********************** ✓ Logged in as you@company.com
3

Initialize your project

Run this once in your project root. It guides you through selecting a workspace, categories to sync, and optional ignore patterns.

ch init
? Select workspace: my-workspace ? Select categories: (use space to toggle) > [x] code-tools [ ] docs ? Ignore patterns (e.g. draft-*): draft-* ✓ Created .claudehub/config.json
4

Pull all skills, workflows, and sub-agents

Download everything from the workspace. Skills and workflows land in .claude/skills/, sub-agents in .claude/agents/.

ch pull
+ [skill] code-review (new) + [skill] summarize (new) + [workflow] customer-onboard (new) + [agent] triage-bot (new) Summary: 4 new, 0 updated, 0 unchanged, 0 conflicts
5

Edit locally, then push

Make changes to any skill, workflow, or sub-agent file, then push your changes back.

ch push
* [skill] code-review (v1 -> v2) Summary: 0 new, 1 updated, 0 unchanged, 0 conflicts

Authentication

The CLI uses API keys to authenticate with ClaudeHub. Keys are stored globally in ~/.claudehub/config.json and sent as a Bearer token on every request.

ch login

Authenticate with an API key. Prompts interactively. On first run shows the welcome onboarding.

Example

ch login

Output

Welcome to ClaudeHub CLI! ? Enter your API key: ******************** ✓ Logged in as you@company.com Run 'ch init' to initialize a project. Run 'ch --help' to see all available commands.
ch logout [-y]

Clear stored credentials from the global config file.

Options

FlagDescription
-y, --yesSkip the confirmation prompt

Example

ch logout
ch logout -y
ch whoami

Display the currently authenticated user.

Example

ch whoami

Output

Logged in as you@company.com (Your Name)

Init

Initialize a ClaudeHub project in the current directory. Run this once per repository. It creates a .claudehub/config.json file that tracks which workspace and categories to sync.

ch init [--force]

Interactively select a workspace, pick categories to scope what gets synced, and optionally specify ignore glob patterns (e.g. draft-*). Creates .claudehub/config.json in the current directory.

Options

FlagDescription
--forceOverwrite an existing .claudehub/config.json without prompting

Example

ch init
ch init --force

Output

? Select workspace: my-workspace ? Select categories: (use space to toggle) > [x] code-tools [x] docs [ ] experiments ? Ignore patterns (comma-separated, e.g. draft-*): draft-* ✓ Created .claudehub/config.json

Commit .claudehub/ to git

Commit both .claudehub/config.json and .claudehub/lock.json to your repository. The lockfile tracks synced state (like package-lock.json) and enables conflict detection for your team.

Workspaces

Workspaces group your skills and workflows. The workspace selection is project-scoped and stored in .claudehub/config.json. Use the alias ws for brevity.

ch workspace <subcommand>
ch ws <subcommand>          # alias
ch workspace list

List all workspaces you have access to. The project-active workspace is marked with an asterisk (*).

Example

ch workspace list
ch ws list

Output

NAME DESCRIPTION ID UPDATED ---------------------------------------------------------- * my-workspace Main workspace 6839a1f2c4e8b... Jan 5, 2025 side-project Experiments 6839a1f2c4e8c... Dec 12, 2024
ch workspace use [name-or-id]

Set the workspace for this project. Writes to .claudehub/config.json. If no argument is given, shows an interactive selection list.

Example

ch workspace use my-workspace
ch ws use 6839a1f2c4e8b3d2a1f0e9c8

Output

Switched to workspace: my-workspace
ch workspace current

Show which workspace is currently active for this project.

Example

ch workspace current

Output

Current workspace: my-workspace (6839a1f2c4e8b3d2a1f0e9c8)

Pull & Push

Skills and workflows live in .claude/skills/ in your project, while sub-agents are single .md files under .claude/agents/. A skill is a folder containing SKILL.md. A workflow is detected by the presence of a workflow-graph.yaml file alongside SKILL.md. Pull and push operate on all three types together.

Conflict detection

Version-based conflict detection: if the remote version is newer than what is recorded in .claudehub/lock.json AND local files have been modified, the CLI warns you. Use -f to force overwrite.

ch pull [name] [-f]

Download skills, workflows, and sub-agents from the active workspace into .claude/skills/ and .claude/agents/. Without a name, pulls all extensions matching the categories and ignore patterns in .claudehub/config.json. Updates .claudehub/lock.json after syncing.

Options

FlagDescription
nameName of a single extension to pull (optional). Matches across skill, workflow, and sub-agent.
-f, --forceOverwrite local changes without conflict warning

Example

ch pull
ch pull code-review
ch pull triage-bot -f

Output

+ [skill] code-review (new) * [skill] summarize (v2 -> v3) = [workflow] customer-onboard (unchanged) + [agent] triage-bot (new) Summary: 2 new, 1 updated, 1 unchanged, 0 conflicts
ch push [name] [-f]

Upload local skills, workflows, and sub-agents to the active workspace. Without a name, pushes all extensions that have local changes relative to .claudehub/lock.json. Updates the lockfile after a successful push.

Options

FlagDescription
nameName of a single extension to push (optional). Matches across skill, workflow, and sub-agent.
-f, --forcePush even if a remote conflict is detected

Example

ch push
ch push code-review
ch push triage-bot -f

Output

* [skill] code-review (v3 -> v4) + [agent] triage-bot (v1) Summary: 1 new, 1 updated, 0 unchanged, 0 conflicts

Working tree layout

Skills: .claude/skills/<name>/SKILL.md
Workflows: .claude/skills/<name>/SKILL.md + .claude/skills/<name>/workflow-graph.yaml
Sub agents: .claude/agents/<name>.md (single file with YAML frontmatter)

Status & Diff

Inspect the sync state of your local workspace before committing a pull or push.

ch status

Show local vs remote sync state for all tracked extensions. Similar to git status -- displays which extensions are ahead, behind, in conflict, or up to date. Each row shows the extension type in brackets.

Example

ch status

Output

Workspace: my-workspace (6839a1f2c4e8b...) Modified locally (run "ch push"): * [skill] code-review (v3) Remote ahead (run "ch pull"): v [workflow] customer-onboard (lock v2 -> remote v4) New locally (run "ch push"): + [agent] triage-bot
ch diff <name>

Show a line-level diff of local file contents vs the remote version for one extension. When a skill or workflow and a sub-agent share the same name, the skill/workflow folder under .claude/skills/ resolves first.

Example

ch diff code-review
ch diff triage-bot

Output

Diff: [skill] code-review (remote -> local; + added locally, - removed locally) ~ SKILL.md (modified) - Review the code for correctness only. + Review the code for correctness and style.

Configuration

The CLI uses two config files: a global file for credentials and a project-scoped file for workspace and sync settings.

Global config

Located at ~/.claudehub/config.json on all platforms. Stores credentials only.

json
{
  "apiKey": "sk-ch-...",
  "user": {
    "id": "...",
    "email": "you@company.com",
    "name": "Your Name"
  }
}

Project config

Located at .claudehub/config.json in your project root. Created by ch init. Commit this file to git.

json
{
  "workspace": {
    "id": "6839a1f2c4e8b3d2a1f0e9c8",
    "name": "my-workspace"
  },
  "categories": ["code-tools", "docs"],
  "ignore": ["draft-*"]
}

Lockfile

Located at .claudehub/lock.json in your project root. Tracks the last synced state of each extension. Commit this file to git (like package-lock.json). Keys are namespaced by type (skill:, workflow:, agent:) so the same name can be used across types without collision.

json
{
  "skill:code-review": {
    "id": "abc123",
    "version": 3,
    "type": "skill",
    "hash": "sha256-..."
  },
  "workflow:customer-onboard": {
    "id": "def456",
    "version": 5,
    "type": "workflow",
    "hash": "sha256-..."
  },
  "agent:triage-bot": {
    "id": "ghi789",
    "version": 1,
    "type": "agent",
    "hash": "sha256-..."
  }
}

Migrating from a pre-agent lockfile

Older lockfiles used plain names (no type prefix) as keys. Those entries are ignored on read with a one-time warning. Run ch pull -f or ch push -f once to rebuild the lockfile in the new format.

Global flags

Available on every command.

FlagDescription
-v, --versionPrint the installed CLI version
-h, --helpShow help for a command or subcommand
ch --version
ch --help
ch pull --help
ch push --help

Full command reference

All available commands at a glance.

ch loginAuthenticate with an API key
ch logout [-y]Clear stored credentials
ch whoamiShow current authenticated user
ch init [--force]Initialize project: select workspace, categories, ignore patterns
ch workspace listList all workspaces (alias: ws list)
ch workspace use [name]Set the active workspace for this project
ch workspace currentShow the active workspace
ch pull [name] [-f]Download all (or one) skills, workflows, and sub-agents from workspace
ch push [name] [-f]Upload all (or one) skills, workflows, and sub-agents to workspace
ch statusShow local vs remote sync state
ch diff <name>Show line-level diff for one extension vs remote