| name | setup |
| description | Use when you need to initialize the document-to-markdown environment for the first time |
Setup
Initialize the plugin environment. Creates the data directory, sets up the Python virtual environment, installs extraction libraries, verifies system dependencies, and configures the default extractor.
When to use
- First time before any document extraction
- After a fresh Claude Code installation
- When resetting the plugin environment
Inputs to gather
- None (idempotent operation)
Procedure
- Create the data directory at
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/document-to-markdown/ if it does not exist, including subdirectories: venv/, cache/, state/.
- Check system dependencies with
pdftotext --version, ocrmypdf --version, tesseract --version. If any are missing, print the installation command (sudo apt install poppler-utils ocrmypdf tesseract-ocr) but do not run sudo automatically.
- Initialize a uv-managed Python virtual environment at
$CLAUDE_USER_DATA/document-to-markdown/venv/ using uv venv.
- Activate the venv and install extraction libraries:
marker-pdf pymupdf4llm camelot-py[cv] tabula-py pandas using uv pip install.
- (Optional) If the user explicitly requests it, also install
docling (noted as heavy/slower).
- Write
config.json to $CLAUDE_USER_DATA/document-to-markdown/ with contents: {"default_extractor": "marker"}.
- Verify installation by attempting a simple import test in the venv (e.g.,
python -c "import marker_pdf; print('OK')").
Output / side effects
- Data directory fully initialized and populated
- Python venv ready to use
- System tools verified (or missing tools clearly reported)
config.json written with default extractor set to marker
- User sees success confirmation or actionable error messages for missing system tools
Safety / constraints
- Do not attempt to run
sudo apt install automatically; always show the command and ask the user to run it if tools are missing
- Setup is idempotent; running it multiple times should not cause errors or overwrite configs