Chat CLI Usage

February 23, 2026 ยท View on GitHub

Probe Chat provides an interactive terminal interface for AI-powered code exploration.


TL;DR

# Start interactive chat
npx -y @probelabs/probe-chat@latest ./my-project

# With specific provider
probe-chat --force-provider anthropic ./src

# Single message (non-interactive)
probe-chat --message "Find authentication code" ./src

Installation

# Via npx (no install required)
npx -y @probelabs/probe-chat@latest

# Global install
npm install -g @probelabs/probe-chat

# Then use directly
probe-chat ./my-project

Basic Usage

Interactive Mode

# Start chat with current directory
probe-chat

# Chat with specific path
probe-chat /path/to/project

# With debug output
probe-chat --debug ./src

Non-Interactive Mode

# Single message
probe-chat --message "How does authentication work?" ./src

# JSON output
probe-chat --message "List all API endpoints" --json ./src

# With images
probe-chat --message "Analyze this diagram" --images "./diagram.png" ./src

# Piped input
echo "Find error handling code" | probe-chat ./src

Command Options

Provider & Model

FlagDescription
-f, --force-provider <provider>Force provider: anthropic, openai, google
-m, --model-name <model>Specify model name
probe-chat --force-provider anthropic --model-name claude-sonnet-4-6 ./src

Interface Mode

FlagDescription
-w, --webRun web interface
-p, --port <port>Web server port (default: 8080)
probe-chat --web --port 3000 ./src

Session Management

FlagDescription
-s, --session-id <id>Specify session ID for continuity
probe-chat --session-id my-session ./src

Custom Prompts

FlagDescription
--prompt <value>Custom prompt or preset

Presets: architect, code-review, code-review-template, support, engineer

# Use preset
probe-chat --prompt architect ./src

# Use custom file
probe-chat --prompt ./my-prompt.txt ./src

Code Editing

FlagDescription
--allow-editEnable code editing
--implement-tool-backend <backend>Backend: aider, claude-code
--implement-tool-timeout <ms>Timeout in milliseconds
probe-chat --allow-edit --implement-tool-backend claude-code ./src

Bash Execution

FlagDescription
--enable-bashEnable bash commands
--bash-allow <patterns>Allow patterns (override default deny)
--bash-deny <patterns>Deny patterns (always win, highest priority)
--no-default-bash-allowDisable built-in allow list
--no-default-bash-denyDisable built-in deny list (not recommended)
--bash-timeout <ms>Command timeout

Patterns use colon-separated syntax: git:push, npm:install, git:push:--force.

Priority: Custom deny > Custom allow > Default deny > Allow list. Use --bash-allow to selectively override default deny patterns without weakening other protections.

# Allow git push but block force push
probe-chat --enable-bash \
  --bash-allow "git:push" \
  --bash-deny "git:push:--force" \
  ./src

See the Security Guide for detailed priority rules and examples.

Tool Iterations

FlagDescription
--max-iterations <n>Max tool iterations (default: 30)
probe-chat --max-iterations 50 ./src

Telemetry

FlagDescription
--trace-file [path]Trace to file
--trace-remote [endpoint]Trace to remote endpoint
--trace-consoleTrace to console
probe-chat --trace-file ./traces.jsonl ./src

Interactive Commands

During a chat session:

CommandDescription
exit or quitEnd session
usageShow token usage
clearClear history, start new session

Environment Variables

API Keys

export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...
export GOOGLE_API_KEY=...

Configuration

# Force provider
export FORCE_PROVIDER=anthropic

# Model
export MODEL_NAME=claude-sonnet-4-6

# Paths
export ALLOWED_FOLDERS=/path/to/project

# Debug
export DEBUG=true

Examples

Code Exploration

probe-chat ./my-project
You: How is authentication implemented?
Assistant: I'll search for authentication-related code...
[Uses search tool]
The authentication system uses JWT tokens...

You: Show me the login function
Assistant: [Uses extract tool]
Here's the login function from src/auth/login.ts...

Searching Dependencies

Probe can search inside your project's dependencies. Ask the agent to look inside npm packages, Go modules, or Rust crates:

You: How does createAnthropic work in the @ai-sdk/anthropic package?
Assistant: I'll search inside the @ai-sdk/anthropic dependency...
[Uses search with path: js:@ai-sdk/anthropic]
The createAnthropic function initializes the Anthropic client...

You: Look at how gin handles middleware
Assistant: [Uses search with path: go:github.com/gin-gonic/gin]
Here's how the gin library implements middleware...

You: Find the Serialize trait in serde
Assistant: [Uses search with path: rust:serde]
The Serialize trait is defined in...

Supported dependency prefixes:

  • js:package-name - npm packages (e.g., js:express, js:@ai-sdk/anthropic)
  • go:module/path - Go modules (e.g., go:github.com/gin-gonic/gin)
  • rust:crate-name - Rust crates (e.g., rust:serde)

Code Review

probe-chat --prompt code-review ./src
You: Review the user service
Assistant: I'll analyze the user service code...
[Reviews code]

Code Review Findings:

Critical:
- SQL injection vulnerability in line 45

Important:
- Missing input validation
- No rate limiting

Suggestions:
- Consider adding caching

Debugging

probe-chat --debug --enable-bash ./src
You: Find and fix the failing test
Assistant: [Searches for test files]
[Runs tests]
[Identifies issue]
[Suggests fix]

Non-Interactive Pipeline

# Generate documentation
probe-chat --message "Generate API documentation" --json ./src > api-docs.json

# Security scan
probe-chat --prompt code-review --message "Find security issues" ./src

# Batch analysis
for dir in src/*/; do
  probe-chat --message "Summarize this module" "$dir"
done

Token Usage

Monitor token consumption:

You: usage

Token Usage:
  Context Window: 150,000
  Current Request:
    Input: 1,234
    Output: 567
    Total: 1,801
  Session Total:
    Input: 5,234
    Output: 2,567
    Total: 7,801
  Cache:
    Read: 500
    Write: 200

Troubleshooting

No API Key

Error: No API key found

Solution:
export ANTHROPIC_API_KEY=sk-ant-...

Provider Not Available

# List available providers
probe-chat --debug

# Force specific provider
probe-chat --force-provider openai

Timeout Issues

# Increase timeout
probe-chat --max-iterations 100 ./large-project