Skip to content

CLI Commands

All commands support --json for machine-readable output and --help for usage details.

Core Commands

Search for docs and skills in the registry using BM25 ranking.

sh
chub search <query> [--limit <n>] [--source <name>] [--json]
FlagDescriptionDefault
<query>Search query (supports multi-word)
--limit <n>Maximum number of results10
--source <name>Search within a specific sourceall sources
--jsonOutput results as JSONoff

Examples:

sh
chub search "stripe payments"
chub search "react hooks" --limit 5
chub search "auth" --source official --json

chub get

Fetch a specific doc or skill by ID.

sh
chub get <id> [--lang <language>] [--version <ver>] [--source <name>] [--pinned] [--json]
FlagDescription
<id>Doc ID (e.g., openai/chat)
--lang <language>Language variant (e.g., python, javascript)
--version <ver>Specific version (e.g., 4.0)
--source <name>From a specific source
--pinnedFetch all pinned docs at once
--jsonJSON output

Examples:

sh
chub get openai/chat --lang python
chub get stripe/api --lang javascript --version 2024
chub get --pinned                        # fetch all pinned docs
chub get project/architecture            # fetch a project context doc

chub list

List all available docs in the registry.

sh
chub list [--source <name>] [--project] [--json]
FlagDescription
--source <name>Filter by source
--projectList project context docs only
--jsonJSON output

chub update

Refresh the cached registry and search index.

sh
chub update

chub cache

Manage the local cache.

sh
chub cache status    # show cache state and size
chub cache clear     # clear all cached data

Team Commands

chub init

Initialize a .chub/ project directory for team sharing.

sh
chub init [--from-deps] [--monorepo]
FlagDescription
--from-depsScan dependency files and auto-pin matching docs
--monorepoCreate config with auto-profile rules for monorepo

chub pin / unpin / pins

Manage pinned doc versions.

sh
chub pin <id> [--lang <lang>] [--version <ver>] [--reason <text>]
chub unpin <id>
chub pins
FlagDescription
--lang <lang>Pin to a specific language
--version <ver>Pin to a specific version
--reason <text>Human-readable reason (shown to agents)

Examples:

sh
chub pin openai/chat --lang python --version 4.0 --reason "Use v4 streaming API"
chub pin stripe/api --lang javascript
chub unpin openai/chat
chub pins                                # list all active pins

chub profile

Manage context profiles for role-scoped context.

sh
chub profile use <name>    # activate a profile ("none" to clear)
chub profile list          # list available profiles

chub annotate

Add annotations to docs. Team annotations are git-tracked; personal ones are local.

sh
chub annotate <id> <note> [--team] [--personal] [--author <name>]
FlagDescription
--teamSave to .chub/annotations/ (git-tracked, shared)
--personalSave to ~/.chub/annotations/ (local only)
--author <name>Author name (defaults to $USER)

chub feedback

Submit feedback about a doc.

sh
chub feedback <id> <message>

chub detect

Scan dependency files and find matching docs.

sh
chub detect [--pin]
FlagDescription
--pinAuto-pin all detected matches

Supported: package.json, Cargo.toml, requirements.txt, pyproject.toml, Pipfile, go.mod, Gemfile, pom.xml, build.gradle(.kts).

chub agent-config

Generate and sync agent configuration files from .chub/config.yaml.

sh
chub agent-config generate   # generate all target files
chub agent-config sync       # update only if source changed
chub agent-config diff       # show what would change

Targets: CLAUDE.md, .cursorrules, .windsurfrules, AGENTS.md, .github/copilot-instructions.md.

chub snapshot

Manage point-in-time pin snapshots.

sh
chub snapshot create <name>          # save current pins
chub snapshot list                   # list all snapshots
chub snapshot restore <name>         # restore pin state
chub snapshot diff <name-a> <name-b> # compare two snapshots

chub check

Check pinned doc versions against installed library versions.

sh
chub check [--fix]
FlagDescription
--fixAuto-update outdated pins to match installed versions

chub stats

Show local usage analytics (opt-in).

sh
chub stats [--json]

Server Commands

chub mcp

Start the MCP (Model Context Protocol) stdio server.

sh
chub mcp [--profile <name>]
FlagDescription
--profile <name>Load a specific context profile

chub serve

Serve a built content directory as an HTTP registry.

sh
chub serve <content-dir> [--port <n>]
FlagDescriptionDefault
--port <n>HTTP port4242

Build Commands

chub build

Build a content directory into registry.json and search-index.json.

sh
chub build <content-dir> [-o <output>] [--base-url <url>] [--validate-only]
FlagDescriptionDefault
-o, --output <dir>Output directorydist/
--base-url <url>CDN base URL for doc pathsnone
--validate-onlyValidate content without buildingoff

Examples:

sh
chub build ./content -o ./dist
chub build ./content --validate-only
chub build ./content --base-url https://cdn.example.com/v1

Global Flags

FlagDescription
--helpShow help for any command
--versionShow version
--jsonJSON output (most commands)