A simple command-line tool that lets you chat with a PDF using Claude.
PDFChat CLI allows you to:
- Load a PDF from a file path
- Ask questions about its content
- Get AI-generated answers grounded in the document
This is a lightweight implementation focused on simplicity and speed, using Claude’s context window instead of a full RAG pipeline.
- Chat with any PDF via terminal
- Minimal setup and fast execution
- Uses
.envfor secure API key management - Clean, typed Python codebase (mypy-compatible)
- Extracts text from the PDF
- Sends the content to Claude
- Maintains a conversation loop for Q&A
Note: For large PDFs, responses may degrade due to context limits.
Create a .env file in the project root:
ANTHROPIC_API_KEY=your_api_key_here- clone project
cd pdf_chat_clipip install poetrypoetry install
poetry run python -m src.mainThen start asking questions in the terminal.
> What is the main topic of this document?
> Summarize chapter 2
> Who are the key authors mentioned?- No true retrieval (RAG) — entire document is sent to the model
- Large PDFs may exceed context limits
- No citations or source tracking
- Add chunking + retrieval (RAG)
- Support multiple PDFs
- Add citations from source text
- Optional web or UI interface
- Python 3.11+
- Claude (Anthropic API)
- PyMuPDF (PDF parsing)
- python-dotenv (env management)
- mypy (type checking)