The Case.dev CLI gives you full access to the Case.dev API from your terminal. Every API operation is available as a CLI command, making it easy to script workflows, test integrations, and manage resources without writing code.
Installation
brew tap CaseMark/casedev
brew install casedev
Pre-built binaries for macOS, Linux, and Windows are available on GitHub Releases.
Verify installation
Authentication
The CLI reads your API key from the CASEDEV_API_KEY environment variable. Get your key from the Case.dev dashboard.
export CASEDEV_API_KEY=sk_case_YOUR_API_KEY
Add the export to your shell profile (~/.bashrc, ~/.zshrc, etc.) so it persists across sessions.
API keys starting with sk_case_ are production keys. Development keys are available for testing.
Quick Start
# Chat with an LLM
casedev llm:v1:chat create-completion \
--model anthropic/claude-sonnet-4.5 \
--message '{role: user, content: "Summarize this contract..."}'
# Search a vault
casedev vault search \
--id vault_abc123 \
--query "termination clauses"
# List available models
casedev llm:v1 list-models
# Run OCR on a document
casedev ocr:v1 process --file @contract.pdf
# Transcribe audio
casedev voice:transcription create --file @deposition.mp3
Command Structure
Commands follow a resource:version:sub action pattern that mirrors the API:
casedev llm:v1:chat create-completion # LLM chat
casedev vault search # Vault search
casedev ocr:v1 process # OCR processing
casedev voice:transcription create # Voice transcription
casedev legal:v1 find # Legal research
casedev search:v1 answer # Web search AI answer
Run any command with --help to see available flags and usage:
casedev llm:v1:chat create-completion --help
Control how results are displayed with the --format flag:
# JSON output (default, pipe-friendly)
casedev llm:v1 list-models --format json
# YAML output
casedev llm:v1 list-models --format yaml
# Interactive explorer
casedev llm:v1 list-models --format explore
JSON output works well with tools like jq:
casedev llm:v1 list-models --format json | jq '.data[].id'
File Uploads
Upload files using the @ prefix on any argument that accepts a file:
# OCR a local PDF
casedev ocr:v1 process --file @contract.pdf
# Upload to a vault
casedev vault upload --id vault_abc123 --file @evidence.pdf
# Transcribe a local audio file
casedev voice:transcription create --file @recording.mp3
Piping and Stdin
The CLI reads JSON or YAML from stdin, making it composable with other tools:
# Pipe a JSON payload
echo '{"model": "anthropic/claude-sonnet-4.5", "messages": [{"role": "user", "content": "Hello"}]}' \
| casedev llm:v1:chat create-completion
# Chain commands
casedev vault search --id vault_abc123 --query "liability" --format json \
| jq '.results[0].content' \
| casedev llm:v1:chat create-completion --model anthropic/claude-sonnet-4.5 --stdin-field content
Shell Completions
Enable tab completions for your shell:
# Bash
casedev completion bash > /etc/bash_completion.d/casedev
# Zsh
casedev completion zsh > "${fpath[1]}/_casedev"
# Fish
casedev completion fish > ~/.config/fish/completions/casedev.fish
Restart your shell or source the completion file to activate.
Debugging
Use --debug to see full HTTP request and response details:
casedev vault search --id vault_abc123 --query "test" --debug
This prints request headers, body, response status, and timing information to stderr.
Debug output may contain your API key and sensitive request payloads. Redact credentials and confidential data before sharing logs externally.
Upgrading
Repositories
Next Steps