Command-line interface for PaperHero -- the document management system for letters, invoices, and contracts.
Designed for both human operators and AI agents. Fully non-interactive: all input is provided via flags or environment variables, making it ideal for automation, scripting, and integration with AI workflows.
Connect your OpenClaw, NemoClaw, Claude Code, Cline, or OpenCode to PaperHero in minutes.
curl -fsSL https://raw.githubusercontent.com/blaumedia/paperhero-cli/master/install.sh | shInstall a specific version:
curl -fsSL https://raw.githubusercontent.com/blaumedia/paperhero-cli/master/install.sh | sh -s -- --version v1.0.0Install to a custom directory:
curl -fsSL https://raw.githubusercontent.com/blaumedia/paperhero-cli/master/install.sh | sh -s -- --dir ~/.local/bin# Download latest release
$arch = if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "amd64" }
$release = Invoke-RestMethod "https://api.github.com/repos/blaumedia/paperhero-cli/releases/latest"
$asset = $release.assets | Where-Object { $_.name -eq "paperhero_windows_${arch}.zip" }
Invoke-WebRequest $asset.browser_download_url -OutFile paperhero.zip
Expand-Archive paperhero.zip -DestinationPath "$env:LOCALAPPDATA\paperhero" -Force
Remove-Item paperhero.zip
# Add to PATH (current session)
$env:PATH += ";$env:LOCALAPPDATA\paperhero"
# Add to PATH (permanent, user-level)
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$env:LOCALAPPDATA\paperhero", "User")Download the binary for your platform from the Releases page.
| Platform | Architecture | Download |
|---|---|---|
| Linux | x86_64 | paperhero_linux_amd64.tar.gz |
| Linux | ARM64 | paperhero_linux_arm64.tar.gz |
| macOS | Intel | paperhero_darwin_amd64.tar.gz |
| macOS | Apple Silicon | paperhero_darwin_arm64.tar.gz |
| Windows | x86_64 | paperhero_windows_amd64.zip |
| Windows | ARM64 | paperhero_windows_arm64.zip |
Linux / macOS:
tar -xzf paperhero_*.tar.gz
sudo mv paperhero /usr/local/bin/Windows (PowerShell):
Expand-Archive paperhero_windows_amd64.zip -DestinationPath .
Move-Item paperhero.exe C:\Windows\System32\
# Or add the directory to your PATH insteadThe CLI is also available as a Docker image, suitable as a base for automation pipelines.
# Run directly
docker run --rm ghcr.io/blaumedia/paperhero-cli version
# Use in automation
docker run --rm \
-e PAPERHERO_CUSTOMER_ID=mycompany \
-e [email protected] \
-e PAPERHERO_PASSWORD=secret \
ghcr.io/blaumedia/paperhero-cli login
# With E2E encryption (mount the key file into the container)
docker run --rm \
-e PAPERHERO_CUSTOMER_ID=mycompany \
-e [email protected] \
-e PAPERHERO_PASSWORD=secret \
-e PAPERHERO_KEY_FILE=/keys/e2e-key.json \
-e PAPERHERO_KEY_PASSWORD=e2e-secret \
-v /path/to/paperhero-e2e-key.json:/keys/e2e-key.json:ro \
ghcr.io/blaumedia/paperhero-cli \
document download <id> /output/doc.pdf
# As a base image for custom automation
FROM ghcr.io/blaumedia/paperhero-cli:latest
COPY my-automation.sh /usr/local/bin/
ENTRYPOINT ["my-automation.sh"]The image is based on Alpine Linux and includes jq, curl, and bash for scripting. Available for linux/amd64 and linux/arm64.
paperhero --helppaperhero login --customer-id mycompany --email [email protected] --password 'yourpassword'The session is stored in ~/.config/paperhero/session.json with 0600 permissions.
paperhero inbox listpaperhero inbox upload invoice.pdf# Use AI-generated recommendations for name, folder, tags
paperhero inbox import <inbox-item-id> --use-ai-defaults --password 'yourpassword'paperhero document download <document-id> ./output.pdf --password 'yourpassword'All credentials are provided via flags or environment variables. The CLI never prompts for input.
| Variable | Description |
|---|---|
PAPERHERO_CUSTOMER_ID |
Customer/tenant identifier |
PAPERHERO_EMAIL |
User email address |
PAPERHERO_PASSWORD |
User password (login and decryption) |
PAPERHERO_TOTP_CODE |
Two-factor authentication code |
PAPERHERO_TOKEN |
JWT token (bypasses login) |
PAPERHERO_SESSION_FILE |
Custom session file path |
PAPERHERO_KEY_FILE |
Path to E2E encryption key file |
PAPERHERO_KEY_PASSWORD |
Password for E2E key file |
export PAPERHERO_CUSTOMER_ID=mycompany
export [email protected]
export PAPERHERO_PASSWORD=secret
paperhero loginIf 2FA is enabled on the account, provide the TOTP code during login:
paperhero login --customer-id mycompany --email [email protected] \
--password 'secret' --totp-code 123456If you omit --totp-code, the CLI returns a temporary token and instructions to complete the 2FA step:
# Step 1: Initiate login (returns twofactor token)
paperhero login --customer-id myco --email [email protected] --password secret
# Step 2: Complete with TOTP code
paperhero login --customer-id myco \
--twofactor-token <token-from-step-1> --totp-code 123456For accounts with end-to-end encryption enabled, commands that require decryption (document download, inbox import) need the E2E key file:
paperhero document download <id> ./output.pdf \
--key-file ~/paperhero-keys.json \
--key-password 'e2e-password'| Flag | Short | Description |
|---|---|---|
--json |
-j |
Output as JSON (machine-readable) |
--quiet |
-q |
Suppress non-essential output |
--session-file |
Custom session file path |
Authenticate and store the session.
paperhero login --customer-id <id> --email <email> --password <pass>Remove the stored session.
paperhero logoutShow the current session information.
paperhero whoami
paperhero whoami --jsonManage inbox items (uploaded documents awaiting import).
# List all inbox items with AI recommendations
paperhero inbox list
paperhero inbox list --ready-only --json
# Show details of an inbox item
paperhero inbox show <id>
# Upload files to inbox
paperhero inbox upload invoice.pdf
paperhero inbox upload page1.jpg page2.jpg page3.jpg --source-tool Scanner
# Import an inbox item as a document
paperhero inbox import <id> --use-ai-defaults --password <pass>
paperhero inbox import <id> --name "Invoice" --folder-id <fid> --tags "invoice,2024" --password <pass>
# Create a new folder during import
paperhero inbox import <id> --use-ai-defaults --create-folder "Invoices/2024" --password <pass>
# Delete an inbox item
paperhero inbox delete <id>
# Re-trigger AI processing
paperhero inbox reprocess <id>Manage documents.
# List documents in a folder
paperhero document list
paperhero document list --folder-id <id>
# Show document metadata and revisions
paperhero document show <id>
# Download and decrypt a document
paperhero document download <id> ./output.pdf --password <pass>
paperhero document download <id> ./output.pdf --revision 1 --password <pass>
# Search documents
paperhero document search "invoice december"
paperhero document search "contract" --fulltext
# Delete a document
paperhero document delete <id>Manage the folder structure.
# List all folders
paperhero folder list
# Show folder tree
paperhero folder tree
# Show folder details and contents
paperhero folder show <id>
# Create a folder
paperhero folder create "Invoices"
paperhero folder create "Invoices" --parent-id <id>
paperhero folder create "Invoices/2024/December" --parent-id <id>
# Delete a folder
paperhero folder delete <id>
paperhero folder delete <id> --recursiveManage email ingress (receive documents via email).
# Show email ingress status
paperhero email-ingress status
# Enable/disable email ingress
paperhero email-ingress enable
paperhero email-ingress disable
# Get the ingress email address (bare output, for scripting)
paperhero email-ingress address
# Manage sender whitelist
paperhero email-ingress whitelist list
paperhero email-ingress whitelist add [email protected]
paperhero email-ingress whitelist remove [email protected]
paperhero email-ingress whitelist enable
paperhero email-ingress whitelist disableMonitor background jobs.
# List recent jobs
paperhero job list
paperhero job list --page 2
# Show job details and logs
paperhero job show <id>Print the current CLI version, OS, and architecture.
paperhero version
paperhero version --jsonUpdate the CLI to the latest version. Downloads the correct binary for your platform, verifies the checksum, and replaces itself in-place.
# Check for updates without installing
paperhero update --check
# Update to the latest version
paperhero updateThe CLI is designed from the ground up for use by AI agents and automation systems. Key design principles:
- Fully non-interactive -- no prompts, no stdin reads, no confirmations
- JSON output -- use
--jsonflag for structured, parseable output - Environment variables -- all secrets via env vars (no command-line history exposure)
- Deterministic exit codes --
0for success,1for errors - Descriptive errors -- error messages include the fix (e.g. "provide --password or set PAPERHERO_PASSWORD")
Running OpenClaw, NemoClaw, Claude Code, Cline, or OpenCode? paperhero is the missing link between your AI agent and your document archive. Any agent that can run a shell command gets full access to your inbox, documents, and folders -- without writing a single line of integration code.
export PAPERHERO_PASSWORD=secret
paperhero login --customer-id myco --email [email protected] --password "$PAPERHERO_PASSWORD"
# List ready inbox items
items=$(paperhero inbox list --ready-only --json)
# Process each item using AI recommendations
echo "$items" | jq -r '.[] | select(.ready==true) | .id' | while read id; do
paperhero inbox import "$id" --use-ai-defaults --password "$PAPERHERO_PASSWORD"
done# Search for documents
results=$(paperhero document search "invoice december" --json)
# Download the first result
doc_id=$(echo "$results" | jq -r '.[0].id')
paperhero document download "$doc_id" ./invoice.pdf --password "$PAPERHERO_PASSWORD"# Enable email ingress and get the address
paperhero email-ingress enable
address=$(paperhero email-ingress address)
echo "Send documents to: $address"
# Set up sender whitelist
paperhero email-ingress whitelist enable
paperhero email-ingress whitelist add [email protected]
paperhero email-ingress whitelist add [email protected]All documents stored in PaperHero are encrypted. When downloading documents via the CLI, decryption happens locally on your machine:
- Login caches the user's encrypted private key and embeddings password in the session file
- Download/Import commands decrypt the private key using your password, then use it to decrypt document files locally
- The password is never stored -- it must be provided via
--passwordorPAPERHERO_PASSWORDeach time
For E2E encrypted accounts, the private key is not stored on the server. You must provide the key file exported during E2E setup via --key-file and --key-password.
The --api-url flag and PAPERHERO_API_URL environment variable can override the API endpoint if needed.