Skip to content

CLI Tool

The TruthVouch CLI provides command-line access to verification APIs, MCP server configuration, and governance workflows. Perfect for developers, security teams, and DevOps engineers.

Installation

npm

Terminal window
npm install -g @truthvouch/cli

Homebrew (macOS/Linux)

Terminal window
brew install truthvouch/tap/truthvouch

Chocolatey (Windows)

Terminal window
choco install truthvouch

Standalone Binary

Download prebuilt binaries for your platform from GitHub Releases:

  • Linux: x64, arm64
  • macOS: x64, arm64
  • Windows: x64

Extract to your PATH and run truthvouch --version to verify.


Authentication

Interactive Login

Terminal window
truthvouch login

Follow the prompts to enter your API key. Credentials are stored securely in ~/.truthvouch/config.json.

Environment Variable

Set your API key via environment variable (takes precedence):

Terminal window
export TRUTHVOUCH_API_KEY=vt_live_...
truthvouch verify-claim "Paris is the capital of France"

Key Commands

Login

Terminal window
truthvouch login

Authenticate with your TruthVouch API key. Stores credentials for subsequent commands.

MCP Setup

Terminal window
truthvouch mcp setup \
--api-key vt_live_... \
--client claude-code

Configure MCP server for AI clients. Supported clients:

  • claude-code (Claude Code)
  • claude-desktop (Claude Desktop)
  • cursor (Cursor IDE)
  • generic (Other MCP-compatible clients)

Examples:

Terminal window
# Claude Code with custom API key
truthvouch mcp setup --api-key vt_live_abc123 --client claude-code
# Cursor IDE (uses TRUTHVOUCH_API_KEY env var)
truthvouch mcp setup --client cursor
# Generic MCP client
truthvouch mcp setup --client generic

MCP Remove

Terminal window
truthvouch mcp remove --client claude-code

Remove MCP configuration for one or all clients.

Examples:

Terminal window
# Remove Claude Code config
truthvouch mcp remove --client claude-code
# Remove all MCP configurations
truthvouch mcp remove

Verify Data Grounding

Terminal window
truthvouch verify-data \
--query "What country had the highest uplift?" \
--response "Germany had the highest uplift at 23%." \
--sql "SELECT country, uplift FROM sales ORDER BY uplift DESC" \
--raw-results '[{"country": "France", "uplift": 0.181}]'

Verify an LLM response against raw query data. Returns per-claim verdicts with evidence.

Output:

{
"overallScore": 0.15,
"verdict": "contradicted",
"claims": [
{
"text": "Germany had the highest uplift",
"verdict": "contradicted",
"score": 0.15,
"evidence": "Data shows France had the highest uplift at 0.181"
}
]
}

Self-Update

Terminal window
truthvouch update

Check npm registry and update to latest version if available. Cached for 24 hours.

Disable auto-update checks with:

Terminal window
export TRUTHVOUCH_NO_UPDATE_CHECK=1

Shell Completions

Terminal window
# Bash
eval "$(truthvouch completions bash)"
# Add to ~/.bashrc for persistent completions:
echo 'eval "$(truthvouch completions bash)"' >> ~/.bashrc
# Zsh
eval "$(truthvouch completions zsh)"
# Add to ~/.zshrc for persistent completions:
echo 'eval "$(truthvouch completions zsh)"' >> ~/.zshrc
# Fish
truthvouch completions fish | source
# Add to ~/.config/fish/config.fish for persistent completions:
truthvouch completions fish >> ~/.config/fish/config.fish

Global Flags

--verbose, -v Show detailed output
--quiet, -q Suppress output (except errors)
--json Output as JSON (where applicable)
--api-key <key> Override TRUTHVOUCH_API_KEY env var
--help, -h Show command help
--version, -V Show CLI version

Examples

Verify a Claim from the Terminal

Terminal window
truthvouch verify-claim \
"Paris is the capital of France" \
--mode thorough

Set Up MCP for Claude Code

Terminal window
# Step 1: Authenticate
truthvouch login
# Step 2: Configure MCP
truthvouch mcp setup --client claude-code
# Step 3: Restart Claude Code
# Restart Claude to load the new MCP configuration

Batch Verify Data from a File

Terminal window
# Create a JSON file with queries, responses, and data
cat > verify.json << 'EOF'
{
"verifications": [
{
"query": "What was Q3 revenue?",
"response": "Q3 revenue was $50M.",
"sql": "SELECT quarter, revenue FROM financials WHERE year = 2025",
"rawResults": "[{\"quarter\": \"Q3\", \"revenue\": 45000000}]"
}
]
}
EOF
# Process with jq and CLI
cat verify.json | jq -r '.verifications[] |
"truthvouch verify-data --query \(.query | @json) --response \(.response | @json)"' | bash

Troubleshooting

Command Not Found

Ensure the installation directory is in your PATH:

Terminal window
# npm
npm config get prefix # Verify npm global prefix
which truthvouch # Should return path like /usr/local/bin/truthvouch
# Homebrew
brew list truthvouch # List files installed
# Add to PATH manually
export PATH="/usr/local/bin:$PATH"

Authentication Errors

Terminal window
# Clear stored credentials
rm ~/.truthvouch/config.json
# Log in again
truthvouch login
# Or use environment variable
export TRUTHVOUCH_API_KEY=vt_live_...

MCP Setup Issues

Terminal window
# Verify MCP configuration
cat ~/.truthvouch/mcp-config.json
# Enable verbose logging
truthvouch mcp setup --client claude-code --verbose
# Reset all MCP configs
rm ~/.truthvouch/mcp-config.json

Next Steps