Skip to main content

Unified CLI for all pdf-autofillr modules

Project description

pdf-autofillr-cli

Unified command-line interface for all pdf-autofillr modules.

One install. One command. All modules.

pip install "pdf-autofillr-cli[all]"
pdf-autofillr status

What is this?

pdf-autofillr-cli wraps the five pdf-autofillr packages — chatbot, mapper, rag, doc-upload, and plugins — under a single pdf-autofillr terminal command. Instead of learning four separate CLIs, you get one consistent interface.

Without this package With this package
ragpdf predict ... pdf-autofillr rag predict ...
chatbot-cli ... pdf-autofillr chatbot session ...
pdf-mapper-server pdf-autofillr mapper start
No unified status check pdf-autofillr status

Install

# Minimal — CLI only (modules installed separately)
pip install pdf-autofillr-cli

# CLI + all modules
pip install "pdf-autofillr-cli[all]"

# CLI + specific modules
pip install "pdf-autofillr-cli[rag]"
pip install "pdf-autofillr-cli[chatbot]"
pip install "pdf-autofillr-cli[mapper]"
pip install "pdf-autofillr-cli[doc-upload]"

The CLI loads instantly regardless of which modules are installed. If you run a command for a module that isn't installed, you get a friendly hint — not a crash.


Quick start

# 1. First-time setup
pdf-autofillr setup

# 2. Add API keys to .env
cp .env.example .env

# 3. Check everything is configured
pdf-autofillr status

→ See quickstart.md for a 3-step walkthrough.


Commands

pdf-autofillr status

Shows which modules are installed, config files present, env vars, and inter-module connections.

pdf-autofillr status
pdf-autofillr status --path /path/to/project

pdf-autofillr setup

First-time setup — creates .env, configs/, and data/ skeleton.

pdf-autofillr setup                    # all installed modules
pdf-autofillr setup --module rag       # rag only
pdf-autofillr setup --force            # overwrite existing files

pdf-autofillr rag

RAG field prediction commands. Requires pip install "pdf-autofillr-cli[rag]".

# Generate vector embeddings (run once after setup)
pdf-autofillr rag init-vectors
pdf-autofillr rag init-vectors --backend openai --force

# Predict field mappings
pdf-autofillr rag predict \
  --user u1 --session s1 --pdf p1 \
  --fields fields.json \
  --hash abc123 \
  --category pdf_category.json

# Submit corrections (triggers re-learning)
pdf-autofillr rag feedback \
  --user u1 --session s1 --pdf p1 \
  --errors errors.json

# Accuracy and coverage metrics
pdf-autofillr rag metrics --type global
pdf-autofillr rag metrics --type pdf --user u1 --session s1 --pdf p1
pdf-autofillr rag metrics --type category --category "Private Markets"

# Vector DB overview
pdf-autofillr rag system-info

# Error analytics with date filters
pdf-autofillr rag error-analytics --from 2026-01-01T00:00:00Z

pdf-autofillr chatbot

Conversational form-filling commands. Requires pip install "pdf-autofillr-cli[chatbot]".

# Start the REST API server (default port 8001)
pdf-autofillr chatbot start
pdf-autofillr chatbot start --port 9000 --reload

# Run an interactive session in the terminal
pdf-autofillr chatbot session \
  --pdf data/input/blank_form.pdf \
  --user user_001

# Resume an existing session
pdf-autofillr chatbot session \
  --pdf data/input/blank_form.pdf \
  --user user_001 \
  --session existing-session-id

# List all active sessions
pdf-autofillr chatbot sessions

pdf-autofillr mapper

PDF template embedding and filling. Requires pip install "pdf-autofillr-cli[mapper]".

Two-step workflow: embed once per blank form template, then fill many times.

# Step 1 — embed the blank template (run once per form)
pdf-autofillr mapper embed \
  --pdf data/input/blank_form.pdf \
  --user user_001 \
  --id lp_sub_v1

# Step 2 — fill with user data (JSON file)
pdf-autofillr mapper fill \
  --pdf data/input/blank_form.pdf \
  --user user_001 \
  --id lp_sub_v1 \
  --data user_data.json

# Step 2 — fill with inline JSON (Linux/Mac)
pdf-autofillr mapper fill \
  --pdf data/input/blank_form.pdf \
  --user user_001 \
  --id lp_sub_v1 \
  --data '{"investor_name": "Jane Smith", "commitment_amount": "500000"}'

# Start the mapper API server (default port 8002)
pdf-autofillr mapper start
pdf-autofillr mapper start --port 8002 --reload

pdf-autofillr doc-upload

Extract data from uploaded documents (PDF, DOCX, XLSX, CSV, JSON, TXT, MD) and fill a PDF form. Requires pip install "pdf-autofillr-cli[doc-upload]".

# Extract from document and fill PDF in one step
pdf-autofillr doc-upload process \
  --doc investor_data.pdf \
  --pdf data/input/blank_form.pdf \
  --schema configs/form_keys.json \
  --user user_001 \
  --id lp_sub_v1

# Supported source formats: PDF, DOCX, XLSX, CSV, JSON, TXT, MD
pdf-autofillr doc-upload process --doc investor.xlsx ...
pdf-autofillr doc-upload process --doc investor.csv  ...

# Start the doc-upload API server (default port 8003)
pdf-autofillr doc-upload start

pdf-autofillr plugins

Inspect installed plugins. Requires pip install pdf-autofillr-plugins.

# List all discovered plugins
pdf-autofillr plugins list

# Filter by category
pdf-autofillr plugins list --category validator
pdf-autofillr plugins list --category extractor

# Scan a specific directory
pdf-autofillr plugins list --path ./my_plugins/

# Output as JSON (useful for scripting)
pdf-autofillr plugins list --json

# Show detailed info for one plugin
pdf-autofillr plugins info email-validator
pdf-autofillr plugins info invoice-extractor --category extractor

Configuration

Copy .env.example to .env and fill in the values for your setup:

cp .env.example .env

Key variables:

Variable Default Description
OPENAI_API_KEY OpenAI API key (chatbot, mapper, rag corrector)
ANTHROPIC_API_KEY Anthropic API key (alternative LLM)
RAGPDF_STORAGE local RAG storage: local, s3, azure, gcs
RAGPDF_EMBEDDING_BACKEND sentence_transformer sentence_transformer, openai, litellm
RAGPDF_VECTOR_STORE local local, pinecone, chroma, weaviate
RAGPDF_CORRECTOR_BACKEND noop noop, openai, anthropic
RAGPDF_API_KEY dev-key Auth key for the RAG server

Full reference in .env.example.


For developers

Run from source

git clone https://github.com/Engineersmind/pdf-autofillr.git
cd pdf-autofillr/packages/cli

python -m venv .venv
source .venv/bin/activate       # Windows: .venv\Scripts\activate

pip install -e ".[dev]"

# Verify the entry point works
pdf-autofillr --version
pdf-autofillr --help

Project layout

packages/cli/
├── src/
│   └── pdf_autofillr_cli/
│       ├── __init__.py          # version
│       ├── main.py              # entry point — builds parser, dispatches
│       ├── utils.py             # module availability checks
│       ├── cmd_status.py        # pdf-autofillr status
│       ├── cmd_setup.py         # pdf-autofillr setup
│       ├── cmd_rag.py           # pdf-autofillr rag *
│       ├── cmd_chatbot.py       # pdf-autofillr chatbot *
│       ├── cmd_mapper.py        # pdf-autofillr mapper *
│       ├── cmd_doc_upload.py    # pdf-autofillr doc-upload *
│       └── cmd_plugins.py       # pdf-autofillr plugins *
├── tests/
│   ├── conftest.py
│   ├── unit/                    # mocked, no modules needed
│   └── integration/             # full parser wiring tests
├── requirements/
│   ├── base.txt
│   ├── dev.txt
│   └── all.txt
├── .env.example
├── CHANGELOG.md
├── LICENSE
├── MANIFEST.in
├── README.md
├── USAGE.md
├── quickstart.md
└── pyproject.toml

Adding a new subcommand

  1. Create src/pdf_autofillr_cli/cmd_mymodule.py with add_parser(subparsers) and run(args) -> int
  2. Import and register it in main.py alongside the existing commands
  3. Add tests under tests/unit/ and tests/integration/

Run tests

pip install -e ".[dev]"

# All tests
pytest tests/ -v

# Unit only (no modules needed — everything mocked)
pytest tests/unit/ -v

# Integration only (parser wiring)
pytest tests/integration/ -v

# With coverage
pytest tests/ --cov=src/pdf_autofillr_cli --cov-report=term-missing

Publish a new version

# 1. Bump version in pyproject.toml and src/pdf_autofillr_cli/__init__.py
# 2. Add entry to CHANGELOG.md
# 3. Build
pip install build
python -m build
# 4. Upload
pip install twine
twine upload dist/*

Related packages

Package PyPI Description
pdf-autofillr PyPI Umbrella package
pdf-autofillr-rag PyPI RAG prediction engine
pdf-autofillr-chatbot PyPI Conversational onboarding
pdf-autofillr-mapper PyPI Semantic PDF field mapper
pdf-autofillr-doc-upload PyPI Document extraction
pdf-autofillr-plugins PyPI Plugin framework

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdf_autofillr_cli-0.1.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdf_autofillr_cli-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file pdf_autofillr_cli-0.1.0.tar.gz.

File metadata

  • Download URL: pdf_autofillr_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pdf_autofillr_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9dcb1810ca52ab04774016d7133cf0df4cea4d528b57eb81cb21fa74ac171294
MD5 2caaccfe57bf05b254a836e8ac01f3ad
BLAKE2b-256 390aa1c9cbc3ab7e925182195d7464cb260eb20bdcd6741317476afc9f75545f

See more details on using hashes here.

File details

Details for the file pdf_autofillr_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pdf_autofillr_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c389bca57cf824ce0223af8a55c15eb0df7b877db9a97dc48d3936c7a968d5e
MD5 e94b173152f1a5b4ba4efdc5aca9669c
BLAKE2b-256 7a6154870798801086ff76291ed59ed1b6e84ed5964a576a5bf9a054cb5bfec6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page