The tpm command-line interface for searching, executing, and managing AI tools from your terminal.
Get started with the TPMJS CLI
npm install -g @tpmjs/cliThis installs the tpm command globally. Requires Node.js 18 or later.
Verify your installation:
tpm --versionCommon workflows to get up and running
# Authenticate
tpm auth login
# Search for tools
tpm tool search firecrawl
# Show trending tools
tpm tool trending
# Get tool info
tpm tool info @tpmjs/official-firecrawl scrapeTool
# Execute a tool
tpm tool execute firecrawl-scrape --input '{"url":"https://example.com"}'
# Generate MCP config for your AI client
tpm mcp config ajax/my-collectionLogin and manage your credentials
| Command | Description |
|---|---|
| tpm auth login | Login with API key or browser OAuth |
| tpm auth logout | Log out and clear credentials |
| tpm auth status | Show authentication status |
| tpm auth whoami | Show current user info |
# Interactive browser OAuth
tpm auth login
# Direct API key
tpm auth login --api-key YOUR_API_KEYYou can also set the TPMJS_API_KEY environment variable to authenticate without logging in.
Search, discover, execute, and create tools
| Command | Description |
|---|---|
| tpm tool search [query] | Search for tools in the registry |
| tpm tool trending | Show trending tools |
| tpm tool info <package> <tool> | Get detailed tool information |
# Search by name
tpm tool search firecrawl
# Show more trending results
tpm tool trending --limit 20
# Get detailed info about a specific tool
tpm tool info @tpmjs/official-firecrawl scrapeToolRun tools directly from the registry with JSON input:
| Flag | Description |
|---|---|
| --input, -i | Input parameters as JSON string |
| --input-file, -f | Path to JSON file with input |
| --stream, -s | Stream output |
| --timeout, -t | Timeout in seconds (default: 300) |
# Execute with inline JSON
tpm tool execute firecrawl-scrape --input '{"url":"https://example.com"}'
# Execute with input from file
tpm tool execute my-tool --input-file params.json
# Stream results
tpm tool execute my-tool --stream# Initialize a new tool package (interactive)
tpm tool init
# Initialize with a name and template
tpm tool init my-tool --template rich
# Validate local tpmjs config in package.json
tpm tool validateAvailable categories: research, web, data, documentation, engineering, security, statistics, ops, agent, sandbox, utilities, html, compliance.
Create and interact with AI agents
| Command | Description |
|---|---|
| tpm agent list | List your agents |
| tpm agent create | Create a new agent |
| tpm agent update <id> | Update an agent |
| tpm agent delete <id> | Delete an agent |
| tpm agent chat <id> | Interactive chat with an agent |
# Interactive chat session
tpm agent chat <agent-id>
# Send a single message
tpm agent chat <agent-id> "What tools can help with web scraping?"Organize and share groups of tools
| Command | Description |
|---|---|
| tpm collection list | List your collections |
| tpm collection create | Create a new collection |
| tpm collection info <user/slug> | Show collection details and tools |
| tpm collection update <id> | Update collection metadata |
| tpm collection delete <id> | Delete a collection |
# Add tools by ID
tpm collection add my-collection tool-id-1 tool-id-2
# Add tools from an npm package
tpm collection add my-collection --package @org/my-tools
# Search for tools and add them in one step
tpm collection add my-collection --search "firecrawl"
tpm collection add my-collection --search "web scraper" --category web --limit 3
# Remove a tool
tpm collection remove my-collection tool-id
# Import from file (IDs, one per line or JSON array)
tpm collection import my-collection --file tools.txt
# Update metadata
tpm collection update my-col --name "New Name" --public
tpm collection update my-col --no-public # Make privateExecute tools from collections using the MCP protocol
The tpm run command executes a tool from a collection via the MCP API:
# Basic usage
tpm run -c ajax/unsandbox -t execute --args '{"code":"print(1)","language":"python"}'
# With environment variables
tpm run -c ajax/my-collection -t myTool --env API_KEY=xxx --env DEBUG=true
# Using process environment
OPENAI_API_KEY=xxx tpm run -c ajax/ai-tools -t generate
# JSON output for scripting
tpm run -c ajax/tools -t base64Encode --args '{"data":"hello"}' --json | jq .resultTest collections with AI-powered scenario testing
| Command | Description |
|---|---|
| tpm scenario list [collection] | List scenarios (all public, or for a collection) |
| tpm scenario info <id> | Show scenario details and recent runs |
| tpm scenario generate <collection> | Generate AI-powered test scenarios |
| tpm scenario run <collection> | Run all scenarios for a collection |
| tpm scenario test <id> | Run a single scenario |
# Generate 3 test scenarios for a collection
tpm scenario generate my-collection --count 3
# Run all scenarios and see pass rates
tpm scenario run my-collection
# Test a specific scenario
tpm scenario test clu123abc456 --verboseConnect collections to AI clients via Model Context Protocol
Generate MCP configuration for popular AI clients, or run the CLI as a local MCP server.
# Auto-detect client
tpm mcp config ajax/my-collection
# For specific clients
tpm mcp config ajax/my-col --client claude # Claude Desktop
tpm mcp config ajax/my-col --client cursor # Cursor
tpm mcp config ajax/my-col --client windsurf # Windsurf
# Run as local MCP server
tpm mcp serve # HTTP on port 3333
tpm mcp serve --stdio # stdio modeSee the MCP Collections docs for more on connecting clients.
Check and preview your tools before publishing
# Check if your package has been discovered on tpmjs.com
tpm publish check @myorg/my-tool
tpm publish check # Check current directory's package
# Preview how your tool will appear
tpm publish preview
tpm publish preview --path ./my-toolTools are discovered automatically from npm. Add the tpmjs keyword to your package.json to be indexed. See the Publishing Guide for details.
Diagnostics, playground, and updates
| Command | Description |
|---|---|
| tpm doctor | Run diagnostic checks (Node.js, config, auth, API, disk) |
| tpm playground | Interactive tool testing REPL |
| tpm update | Update CLI to latest version |
# Run diagnostics
tpm doctor --verbose
# Open the interactive playground
tpm playground
tpm playground --web # Open web version
tpm playground --tool firecrawl-scrape # Start with a specific toolAvailable on all commands
| Flag | Description |
|---|---|
| --json | Output in JSON format (for scripting) |
| --verbose, -v | Show detailed/debug output |
| --help | Show command help |
| --version | Show CLI version |
# JSON output for scripting
tpm tool search firecrawl --json | jq '.data[0].name'
# Verbose mode for debugging
tpm doctor --verboseConfig files and environment variables
Configuration is stored in ~/.tpmjs/config.json:
{
"apiUrl": "https://tpmjs.com/api",
"defaultOutput": "human",
"verbose": false,
"analytics": false
}Credentials are stored securely in ~/.tpmjs/credentials.json with restricted file permissions (0600).
| Variable | Description |
|---|---|
| TPMJS_API_KEY | API key for authentication |
| TPMJS_API_URL | Custom API URL (default: https://tpmjs.com/api) |
Use the CLI as a library in Node.js
The CLI also exports a client library for programmatic use:
import { TpmClient } from '@tpmjs/cli';
const client = new TpmClient({ apiKey: 'your-key' });
const tools = await client.searchTools('firecrawl');