Skip to main content
The Case.dev CLI (casedev) gives you full access to the Case.dev API from your terminal. Every API operation is exposed 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

Shell
casedev --version

Authentication

The CLI reads your API key from the CASEDEV_API_KEY environment variable. Get your key from the Case.dev dashboard.
Shell
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

Shell
# Chat with an LLM
casedev llm:v1:chat create-completion \
  --model anthropic/claude-sonnet-4.6 \
  --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 already accessible by URL
casedev ocr:v1 process --document-url https://example.com/contract.pdf

# Transcribe audio already accessible by URL
casedev voice:transcription create --audio-url https://example.com/deposition.mp3
OCR and voice transcription accept URLs, not local file paths. To process a local file, upload it to a vault first (see File uploads below), then pass the vault-generated presigned URL — or the --vault-id / --object-id pair, where supported — into the processing command.

Command Structure

Commands follow a resource[:version][:sub] action pattern that mirrors the API. Resource names use colons, not slashes:
Shell
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
List all available resources with casedev --help, and inspect a resource’s subcommands with casedev <resource> --help:
Shell
casedev --help
casedev vault --help
casedev llm:v1:chat create-completion --help

Output Formats

Control how results are displayed with the --format global flag (auto, explore, json, jsonl, pretty, raw, yaml):
Shell
# JSON output (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:
Shell
casedev llm:v1 list-models --format json | jq '.data[].id'
You can also reshape output with the --transform flag, which accepts a GJSON path:
Shell
casedev llm:v1 list-models --transform 'data.#.id'

File uploads

The CLI does not accept local file paths as a --file argument. Uploads happen directly to S3 via a short-lived presigned URL. The flow is always:
  1. Request a presigned upload URL from the vault (casedev vault upload ...).
  2. PUT the file bytes to that URL (e.g. with curl).
  3. Confirm the upload to record the final size and ETag (casedev vault confirm-upload ...).
  4. Trigger ingestion if your vault has indexing enabled (casedev vault ingest ...).
Upload a local PDF to a vault
VAULT_ID=vault_abc123
FILE=./contract.pdf
SIZE=$(wc -c < "$FILE" | tr -d ' ')

# 1. Request a presigned upload URL
UPLOAD=$(casedev vault upload \
  --id "$VAULT_ID" \
  --filename "contract.pdf" \
  --content-type "application/pdf" \
  --size-bytes "$SIZE" \
  --auto-index \
  --format json)

OBJECT_ID=$(echo "$UPLOAD" | jq -r '.objectId')
UPLOAD_URL=$(echo "$UPLOAD" | jq -r '.uploadUrl')

# 2. Upload the bytes directly to S3
curl -X PUT \
  -H "Content-Type: application/pdf" \
  --data-binary "@$FILE" \
  "$UPLOAD_URL"

# 3. Confirm the upload
casedev vault confirm-upload \
  --id "$VAULT_ID" \
  --object-id "$OBJECT_ID" \
  --success \
  --size-bytes "$SIZE"

# 4. Trigger ingestion (skip if --auto-index was not set or the vault is storage-only)
casedev vault ingest --id "$VAULT_ID" --object-id "$OBJECT_ID"
For files larger than 5 GB, use casedev vault:multipart get-part-urls to obtain per-part presigned URLs and upload each part separately. See Vault uploads for the complete reference, including multipart uploads and error handling.

OCR and voice transcription with local files

Neither ocr:v1 process nor voice:transcription create accept local file paths. Two paths work:
  • Already-hosted file: pass --document-url (OCR) or --audio-url (voice) pointing to a publicly reachable HTTPS URL or a presigned S3 URL.
  • Local file: upload it to a vault first (flow above), then either pass the vault’s presigned download URL or — for voice transcription — the --vault-id + --object-id pair directly.
OCR a local PDF via vault
# After the upload flow above:
PRESIGNED=$(casedev vault:objects create-presigned-url \
  --id "$VAULT_ID" \
  --object-id "$OBJECT_ID" \
  --operation GET \
  --expires-in 3600 \
  --transform 'presignedUrl')

casedev ocr:v1 process --document-url "$PRESIGNED"
Transcribe a local audio file via vault
# Voice transcription can read directly from the vault without a presigned URL.
casedev voice:transcription create \
  --vault-id "$VAULT_ID" \
  --object-id "$OBJECT_ID" \
  --speaker-labels \
  --punctuate

Piping and stdin

Most commands accept a JSON (or YAML) body on stdin. Any unset flag is filled from the stdin object, so you can compose commands without building long flag lists:
Shell
# Pipe a full JSON payload
echo '{"model":"anthropic/claude-sonnet-4.6","messages":[{"role":"user","content":"Hello"}]}' \
  | casedev llm:v1:chat create-completion

# Chain commands: summarize vault search results
casedev vault search --id vault_abc123 --query "liability" --format json \
  | jq '{model:"anthropic/claude-sonnet-4.6", messages:[{role:"user", content:(.results[0].content // "no results")}]}' \
  | casedev llm:v1:chat create-completion

Shell completions

Enable tab completions for your shell:
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:
Shell
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

brew upgrade casedev

Repositories

Next Steps

SDKs

Official client libraries for TypeScript, Python, Go, and more

API Reference

Complete API documentation with interactive examples

Getting Started

Integration tutorials with step-by-step examples