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
- Create
src/pdf_autofillr_cli/cmd_mymodule.pywithadd_parser(subparsers)andrun(args) -> int - Import and register it in
main.pyalongside the existing commands - Add tests under
tests/unit/andtests/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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_autofillr_cli-0.1.1.tar.gz.
File metadata
- Download URL: pdf_autofillr_cli-0.1.1.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc1c977de2687d17f3ce08184868771730e6eeabc01aee9e596ca6067de0b164
|
|
| MD5 |
a3cd74939b87db196bb8b16cb66e251c
|
|
| BLAKE2b-256 |
e9d747db71f3a31505f0e7df1d4498b01551053944c0c3857a3cc7c5872f6080
|
File details
Details for the file pdf_autofillr_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pdf_autofillr_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
106295e6a6ee14de334cc0e1885612d768db1189950f3a40c9bc354d9e9666fd
|
|
| MD5 |
6189a687d0e0c01d4816580b73528cb2
|
|
| BLAKE2b-256 |
ea272e7df7225c1d27cb94b6e94d022950026161defe0eb38af601d46cd2bb19
|