CLI Commands Reference

Complete reference for all Doclayer CLI commands and their options.

Commands Reference

Complete reference for all Doclayer CLI commands, organized by category.

doclayer auth

Authentication and API key management (recommended: use dashboard.doclayer.ai)

export DOCLAYER_API_KEY=dly_...

Set your API key from the dashboard (recommended)

doclayer auth status

Check current authentication status

doclayer auth login

Interactive login (alternative to API key)

doclayer auth register

Create a new account (alternative to dashboard signup)

doclayer auth logout

Log out and clear stored credentials

doclayer auth api-key list

List all your API keys

doclayer auth api-key create --name "CI/CD"

Create a new API key

doclayer auth api-key revoke <key_id>

Revoke an existing API key

doclayer agent

Agent template management and execution

doclayer agent list

List all available agent templates

doclayer agent list --category contracts

Filter agents by category

doclayer agent get contracts.nda-summary

Get details of a specific agent

doclayer agent describe <agent_id> --verbose

Detailed agent description

doclayer agent init

Interactive wizard to create a custom agent

doclayer agent validate ./manifest.yml

Validate an agent manifest file

doclayer agent test <agent_id> --document sample.pdf

Test an agent with a document

doclayer agent test <agent_id> --document sample.pdf -o results.xlsx

Test and export results to Excel

doclayer agent run <agent_id> --document doc.pdf --wait

Run an agent on a document

doclayer ingest

Document ingestion and batch processing

doclayer ingest file doc.pdf --project proj_123

Upload and process a single file

doclayer ingest file doc.pdf --project proj_123 --wait

Upload and wait for completion

doclayer ingest file doc.pdf --metadata '{"tag":"invoice"}'

Upload with metadata

doclayer ingest batch ./docs --project proj_123

Batch upload a directory

doclayer ingest batch ./docs --workers 4 --recursive

Parallel batch upload

doclayer ingest manifest batch.yaml --resume

Upload via manifest with resume support

doclayer status

Job monitoring and verification

doclayer status list --project proj_123

List ingestion jobs

doclayer status list --status processing --limit 20

Filter jobs by status

doclayer status inspect <job_id>

Get detailed job information

doclayer status inspect <job_id> --vectors

Include vector counts

doclayer status watch --project proj_123

Real-time job monitoring

doclayer status grounding --tenant <tenant_id>

Check LangExtract grounding coverage

doclayer status verify-pgvector <doc_id> <doc_id2>

Verify pgvector entries

doclayer document

Document operations and retrieval

doclayer document list

List all documents

doclayer document list --limit 10 --output json

List with custom format

doclayer document get <doc_id>

Get document details

doclayer document download <doc_id> -o results.json

Download results as JSON

doclayer document download <doc_id> -o results.csv

Download results as CSV

doclayer document download <doc_id> -o results.xlsx

Download results as Excel

doclayer document download <doc_id> -o output.txt --format csv

Explicit format override

doclayer document chunks <doc_id> --limit 5

View document chunks

doclayer document extractions <doc_id>

View document extractions

doclayer document annotations <doc_id>

List document annotations

doclayer document cleanup <doc_id> --mode soft

Soft-delete a document

doclayer document cleanup <doc_id> --mode gdpr --force

GDPR compliant deletion

doclayer workflow

Temporal workflow management

doclayer workflow list

List all workflows

doclayer workflow list --status running

Filter by status

doclayer workflow status <job_id>

Check workflow status

doclayer workflow logs <job_id>

View workflow logs

doclayer workflow logs <job_id> --follow

Stream logs in real-time

doclayer workflow cancel <job_id>

Cancel a running workflow

doclayer workflow retry <job_id>

Retry a failed workflow

doclayer billing

Usage tracking (payments and subscriptions are managed via dashboard.doclayer.ai)

doclayer billing status

Current billing status

doclayer billing usage

Usage breakdown for current month

doclayer billing usage --period 2025-01

Usage for specific month

doclayer billing tier

Current tier and limits

doclayer billing breakdown

Detailed cost breakdown by model

doclayer billing estimate --agent finance.invoice --count 100

Estimate processing costs

doclayer model

LLM and embedding model configuration

doclayer model list

List available models

doclayer model list --provider mistral

Filter by provider

doclayer model config

View current model configuration

doclayer model set-llm --provider gemini --model gemini-2.0-flash

Set LLM model

doclayer model set-embedding --provider gemini --model text-embed-004

Set embedding model

doclayer model test --text "Hello world"

Test model configuration

doclayer config

CLI configuration management

doclayer config show

Show current configuration

doclayer config profile list

List all profiles

doclayer config profile create production

Create a new profile

doclayer config profile use production

Switch to a profile

doclayer config import-profiles --from-file profiles.yaml

Import profiles from file

doclayer config set default_project proj_123

Set default project

doclayer project

Project and organization management

doclayer project list

List all projects

doclayer project create "My Project" --description "Description"

Create a new project

doclayer project info <project_id>

Show detailed project information

doclayer project use <project_id>

Switch to a project (set as default)

doclayer project set-default <project_id>

Set a project as default

doclayer template

Browse and use agent templates from the gallery

doclayer template list

List available templates from gallery

doclayer template list --category contracts

Filter templates by category

doclayer template info <template_id>

Show detailed template information

doclayer template info <template_id> --manifest

Show template manifest

doclayer template use <template_id> --dir ./my-agent

Create agent from template

doclayer template pull <template_id>

Download template manifest to local directory

doclayer template pull <template_id> --format json

Pull template as JSON

doclayer template push ./manifest.yaml

Upload custom template to your account

doclayer template push ./manifest.yaml --public

Publish template to gallery

doclayer local

Local development environment management

doclayer local status

Show docker-compose service status

doclayer local start

Start local development services

doclayer local stop

Stop local development services

doclayer local logs [service]

Show logs from local services

doclayer local logs [service] --follow

Follow log output

doclayer local reset --force

Reset local environment (remove containers/volumes)

doclayer files

Local file integration with auto-classification (NEW)

doclayer files analyze doc.pdf --project proj_123

Analyze a single document (creates sidecar file)

doclayer files analyze doc.pdf --format xlsx

Output analysis as Excel spreadsheet

doclayer files analyze doc.pdf --format json

Output analysis as JSON (default)

doclayer files ingest ./folder --project proj_123

Batch ingest all documents in a folder

doclayer files ingest ./folder --auto-classify

Auto-classify documents by type (enabled by default)

doclayer files ingest ./folder --no-auto-classify

Disable auto-classification

doclayer files ingest ./folder --recursive

Include subdirectories

doclayer files search ./folder "payment terms"

Semantic search across local documents

doclayer files search ./folder "contract" --limit 10

Search with result limit

doclayer files report ./folder --format xlsx

Generate batch report as Excel

doclayer files report ./folder --format json

Generate batch report as JSON

doclayer corpus

Cross-document corpus queries with AI aggregations (NEW)

doclayer corpus query "payment terms" --project proj_123

Query across all project documents

doclayer corpus query "termination clause" --type list

List matching chunks with citations

doclayer corpus query "GDPR compliance" --type count

Count matching documents

doclayer corpus query "What are the risks?" --type summary

AI-synthesized summary with citations

doclayer corpus query "Extract vendors and amounts" --type table

Structured table extraction

doclayer corpus query "contracts" --type table -o vendors.xlsx

Export table results to Excel

doclayer corpus query "NDAs" --limit 20 --filter '{"document_type":"contract.nda"}'

Query with filters

doclayer export

Project-level data exports in multiple formats (NEW)

doclayer export insights proj_123 -o insights.xlsx

Export all insights to Excel

doclayer export insights proj_123 -o insights.csv

Export insights as CSV

doclayer export insights proj_123 -o insights.json

Export insights as JSON

doclayer export documents proj_123 -o docs.xlsx

Export document metadata

doclayer export flags proj_123 -o flags.xlsx

Export flagged items and alerts

doclayer export checklist proj_123 -o checklist.xlsx

Export checklist results

doclayer export insights proj_123 -o filtered.xlsx --filter '{"document_type":"contract.msa"}'

Export with filters

doclayer checklist

Checklist management for structured document review (NEW)

doclayer checklist create --project proj_123 --name "Due Diligence"

Create a new checklist

doclayer checklist create --name "M&A Review" --items '[{"question":"Contract value?"}]'

Create checklist with items

doclayer checklist list --project proj_123

List checklists in a project

doclayer checklist get chk_123

Get checklist details with items

doclayer checklist run chk_123

Run auto-answer workflow (queries corpus)

doclayer checklist update-item chk_123 item_456 --answer "USD 500,000"

Update item answer manually

doclayer checklist update-item chk_123 item_456 --status reviewed

Mark item as reviewed

doclayer checklist export chk_123 -o checklist.xlsx

Export checklist to Excel

doclayer checklist export chk_123 -o checklist.json

Export checklist as JSON

doclayer rule

Flagging rules for automated compliance checks (NEW)

doclayer rule create --name "High Value" --severity critical

Create a flagging rule

doclayer rule create --conditions '{"field":"contract_value","operator":"gt","value":100000}'

Create rule with DSL conditions

doclayer rule list

List all flagging rules

doclayer rule list --is-active

List only active rules

doclayer rule get rule_123

Get rule details

doclayer rule enable rule_123

Enable a rule

doclayer rule disable rule_123

Disable a rule

doclayer rule test rule_123 --document doc_456

Test rule against a document

doclayer rule delete rule_123

Delete a flagging rule

doclayer flag

View and manage compliance flags (NEW)

doclayer flag list --project proj_123

List flags in a project

doclayer flag list --severity critical

Filter by severity

doclayer flag list --status open

Filter by status (open, acknowledged, resolved, dismissed)

doclayer flag get flg_123

Get flag details

doclayer flag acknowledge flg_123

Acknowledge a flag (mark as seen)

doclayer flag resolve flg_123 --notes "Approved by legal"

Resolve flag with notes

doclayer flag dismiss flg_123 --reason "False positive"

Dismiss flag as not applicable

doclayer family

Document families and version grouping (NEW)

doclayer family list --project proj_123

List document families in a project

doclayer family detect --project proj_123

Run version detection across project

doclayer family get fam_123

Get family details with all members

doclayer version

Document version detection and comparison (NEW)

doclayer version fingerprint doc_123

Compute MinHash fingerprint for document

doclayer version history doc_123

Get version history for a document

doclayer version diff doc_123 doc_456

Clause-level diff between two documents

doclayer ma

M&A due diligence analysis (NEW)

doclayer ma analyze doc_123 --project proj_123

Run M&A analysis on a document

doclayer ma get doc_123

Get M&A analysis results

doclayer ma summary --project proj_123

Get project-wide M&A summary

doclayer entities

Cross-document entity resolution (Phase 4)

doclayer entities resolve --project proj_123

Trigger entity resolution for project

doclayer entities resolve --project proj_123 --mode lsh

Resolution with LSH blocking (best accuracy)

doclayer entities resolve --project proj_123 --mode database

Resolution via database trigrams (zero CPU)

doclayer entities list --project proj_123

List canonical entities in project

doclayer entities list --project proj_123 --type organization

Filter by entity type

doclayer entities list --project proj_123 --min-documents 5

Filter by minimum document count

doclayer entities search "Acme" --project proj_123

Search entities by name (fuzzy)

doclayer entities get entity_123 --show-documents

Get entity details with document list

doclayer entities merge entity_123 entity_456 --keep entity_123

Merge two entities manually

doclayer entities export --project proj_123 -o entities.json

Export entity graph as JSON

doclayer entities export --project proj_123 -o entities.xlsx

Export entities to Excel

Global Options

These options are available for all commands:

OptionDescription
--config <path>Custom config file path (default: ~/.doclayer/config.json)
--profile, -p <name>Configuration profile to use
--verbose, -vEnable verbose output
--helpShow help for any command

Exit Codes

CodeDescription
0Success
1General error
2Authentication error
3Network error
4Validation error
5Resource not found