Skip to main content
npx @chat-js/cli@latest add [tools...] [options]

Arguments

ArgumentDescription
tools…One or more tool names to install.

Options

FlagDefaultDescription
-y, --yesfalseSkip confirmation prompt.
-o, --overwritefalseOverwrite existing installed files without prompting.
-c, --cwd <cwd>cwdWorking directory (where chat.config.ts lives).
-r, --registry <url>Registry URL or local path template. Overrides CHATJS_REGISTRY_URL.

Examples

# Install a single tool
npx @chat-js/cli@latest add word-count

# Install multiple tools, skip confirmation
npx @chat-js/cli@latest add word-count pdf-summary --yes

# Use a local registry (monorepo development)
npx @chat-js/cli@latest add word-count \
  --registry ./packages/registry/items/{name}.json \
  --cwd apps/chat

What it does

For each tool name, the command:
  1. Fetches {name}.json from the registry
  2. Recursively resolves any registryDependencies
  3. Writes the tool’s files into your project (under the path configured in chat.config.ts)
  4. Installs any npm dependencies the resolved items declare
  5. Warns if the installed items declare missing environment variables
  6. Injects imports and registrations into the CLI-managed registry files at tools/chatjs/tools.ts and tools/chatjs/ui.ts by default

Environment variables

VariableDescription
CHATJS_REGISTRY_URLDefault registry URL template. The {name} placeholder is replaced with the tool name. Useful for pointing to a local registry without passing --registry every time.
  • Adding Tools — step-by-step walkthrough
  • Tools — how to build and publish a tool