Skip to content
ChatJS
Esc
↑↓navigate↵open⌘Jpreview
On this page

Tools Overview

Install and distribute typed ChatJS tools with shadcn registries

The ChatJS registry distributes editable source code using shadcn. A tool includes server logic, dependencies, and a declarative registration descriptor. Tools can include their own client renderer. Built-in search and code-execution items include renderers for their own output. Installed tools become part of your app’s typed tool system.

npx @chat-js/cli@latest add word-count

shadcn resolves the item and its dependencies, installs packages, and writes the source files. ChatJS then regenerates separate server and client registrations. Existing source follows shadcn’s overwrite prompts. Pass --overwrite to replace it.

Available tools

Tool Purpose Credentials
Word Count Count words, characters, and sentences None
Get Weather Fetch weather for coordinates None
Tavily Search Search with topic, depth, and domain options TAVILY_API_KEY
Firecrawl Search Search with page content extraction FIRECRAWL_API_KEY
Vercel Code Execution Run Python and JavaScript in Vercel Sandbox Vercel OIDC or team/project/token
Generate Video Generate video clips Selected gateway and file storage
Generate Image Generate and edit images Selected gateway and file storage
Retrieve URL Extract a page through Firecrawl FIRECRAWL_API_KEY

Installed files

File Ownership
tools/chatjs/<id>/tool.ts Editable server implementation
tools/chatjs/<id>/renderer.tsx Editable client renderer
tools/chatjs/<id>/chatjs.json Installed registration and environment descriptor
tools/chatjs/tools.ts, ui.ts Generated registrations
tools/chatjs/custom-tools.ts, custom-ui.ts Your custom registrations

Keep manual registrations in the custom modules. Sync rejects duplicate installed descriptor keys and edited generated indexes. Generated indexes detect collisions with custom registrations when loaded. Sync also refuses to remove a previously registered tool just because its descriptor disappeared. Restore the descriptor before syncing. Known legacy built-in indexes migrate automatically. Customized legacy indexes need an explicit move into the custom modules before removing the old indexes.

Registry items specify explicit file targets. This integration uses tools/chatjs. The former paths.tools configuration and marker-based injection are removed. Built-in product tools remain in tools/platform.

External registries

Configure standard namespaces in components.json:

{
  "registries": {
    "@chatjs": "https://unpkg.com/@chat-js/registry@1/dist/r/{name}.json",
    "@acme": "https://example.com/r/{name}.json"
  }
}
npx @chat-js/cli@latest add @acme/my-tool

You can also pass a complete registry item URL or local JSON path. Registry requests require HTTPS, with HTTP allowed for local loopback development. --registry has been replaced by standard namespace configuration.

Direct shadcn installation

npx shadcn@4.21.0 add @chatjs/word-count
npx @chat-js/cli@latest sync

shadcn installs source. sync reads installed descriptors and generates ChatJS registrations without evaluating third-party source. chat-js add performs both steps. If registration fails after installation, fix the reported issue and run sync again. Package installation is not transactional.

Tool environment requirements live in chatjs.json, generated from typed item metadata. check-env reads those descriptors without importing server tools.

Was this page helpful?