CLI Documentation
The Doclayer CLI provides a comprehensive command-line interface for developers to interact with the platform.
Doclayer CLI
Command-line interface for document intelligence
The Doclayer CLI provides a developer-first experience for document processing, agent management, and workflow orchestration. Built with Python and Typer, it offers beautiful terminal output and comprehensive batch workflows.
Quick Start
# 1. Sign up at https://dashboard.doclayer.ai
# 2. Get your API key from Settings > API Keys
# 3. Set your API key
export DOCLAYER_API_KEY=dly_your_key_here
# Install via pip
pip install doclayer-cli
# Analyze any document with auto-classification (NEW!)
doclayer files analyze contract.pdf --project proj_123
# Or specify an agent explicitly
doclayer ingest file invoice.pdf --project proj_123 --agent finance.invoice-summary --wait
# Batch process a folder
doclayer files ingest ./documents --project proj_123 --auto-classifyDocumentation
Command Groups
authAuth status (use dashboard)
agentAgent templates & execution
documentDocument operations
ingestFile & batch ingestion
filesLocal file integration
corpusCross-document queries
entitiesEntity resolution (Phase 4)
workflowTemporal workflows
searchVector & graph search
billingUsage tracking
configCLI configuration
Key Features
Complete Command Set
All Doclayer operations via CLI: authentication, agent management, document processing, search, billing, and workflow orchestration.
Batch Ingestion
Process multiple documents with parallel workers, progress tracking, state files, and resume capability for interrupted uploads.
Rich Terminal Output
Beautiful formatting with Rich library: colored output, progress bars, tables, and spinners for better developer experience.
Profile Management
Multiple environment profiles for seamless switching between local, development, staging, and production environments.
Example Workflows
Process a Contract with NDA Analysis
# Process with specific agent
doclayer ingest file contract.pdf \
--project proj_legal \
--agent contracts.nda-summary \
--wait
# Download extraction results
doclayer document download doc_abc123 --output results.jsonBatch Process Invoice Directory
# Process all PDFs in directory with 4 workers
doclayer ingest batch ./invoices \
--project proj_finance \
--pattern "*.pdf" \
--workers 4 \
--state-file upload-state.json
# Resume if interrupted
doclayer ingest batch ./invoices \
--project proj_finance \
--state-file upload-state.json \
--resumeLocal File Integration with Auto-Classification (NEW)
# Analyze any document - auto-classifies and picks the right template
doclayer files analyze contract.pdf --project proj_123
# Creates: contract_Analysis.json (sidecar file)
# Batch process a folder
doclayer files ingest ./contracts --project proj_123 --auto-classify
# Search within local documents
doclayer files search ./documents "payment terms"
# Generate Excel report
doclayer files report ./processed --format xlsxSearch Documents with Vector Similarity
# Semantic search
doclayer search vector "payment terms and conditions" --limit 10
# Hybrid search (vector + keyword)
doclayer search hybrid "termination clause" --project proj_legal
# Knowledge graph search
doclayer search graph --entity "Acme Corp" --relationship "contract_with"Requirements
- Python 3.11 or higher
- pip or pipx package manager
- macOS, Linux, or Windows (WSL recommended)