Private PDF operations for agents, scripts, and offline pipelines.
ihatepdf.cv CLI brings the website's no-upload promise to the terminal. Merge, inspect, fingerprint, encrypt, search, and catalog local documents with JSON output.
Learn more at ihatepdf.cv.
Created by @SomSamantray (Som Samantray).
Quick Start
# Confirm the local-only runtime without touching a file.
ihatepdf-cv-pp-cli doctor --dry-run
# Inspect page count, metadata, and integrity before processing.
ihatepdf-cv-pp-cli inspect report.pdf --json
# Check for sensitive content and metadata risks.
ihatepdf-cv-pp-cli privacy-scan report.pdf --agent
# Record stable hashes for downstream verification.
ihatepdf-cv-pp-cli fingerprint report.pdf --json
Privacy and capability boundaries
Browser-only ihatepdf.cv features such as redaction UI, workflow presets, OCR model downloads, interactive signatures, camera capture, P2P sharing, and whiteboard collaboration are intentionally not emulated by this CLI.
Unique Features
These capabilities aren't available in any other tool for this API.
Private local document pipelines
-
privacy-scan — Find content and metadata risks before a PDF leaves your machine.
Choose this when an agent must check a document for accidental sensitive content before delivery.
ihatepdf-cv-pp-cli privacy-scan report.pdf --agent
-
catalog index — Index PDF paths, hashes, page counts, and extracted text in a local SQLite catalog.
Choose this when an agent needs a searchable, repeatable inventory of local PDFs.
ihatepdf-cv-pp-cli catalog index ./reports --recursive --agent
Trust and audit
-
fingerprint — Record SHA-256, SHA-1, and MD5 hashes for inputs and outputs.
Choose this when downstream systems need to verify that a PDF was not changed.
ihatepdf-cv-pp-cli fingerprint report.pdf --json
Agent-native plumbing
-
inspect — Expose PDF structure, metadata, and hashes as compact JSON.
Choose this before any transformation when an agent needs to understand the artifact.
ihatepdf-cv-pp-cli inspect report.pdf --json
-
search — Search extracted text across local PDFs and return matching snippets.
Choose this when an agent needs to locate a phrase across a local document set.
ihatepdf-cv-pp-cli search invoice reports/*.pdf --agent
Recipes
Audit a PDF before sharing
ihatepdf-cv-pp-cli privacy-scan report.pdf --agent --select risks,metadata
Return only the risk and metadata fields an agent needs.
Create an integrity record
ihatepdf-cv-pp-cli fingerprint report.pdf --json
Capture hashes for a reproducible handoff.
Merge a packet
ihatepdf-cv-pp-cli merge cover.pdf appendix.pdf --output packet.pdf --json
Combine files in explicit order without uploading them.
Usage
Run ihatepdf-cv-pp-cli --help for the full command reference and flag list.
Paths & environment variables
This CLI separates local files into four path kinds:
| Kind | Contents |
|---|
config | User-editable settings such as config.toml and saved profiles |
data | Durable local data such as data.db |
state | Runtime state such as persisted queries, jobs, and teach.log |
cache | Regenerable HTTP/cache files |
Each kind resolves independently. The ladder is:
- Per-kind env var:
IHATEPDF_CV_CONFIG_DIR, IHATEPDF_CV_DATA_DIR, IHATEPDF_CV_STATE_DIR, or IHATEPDF_CV_CACHE_DIR
--home <dir> for this invocation
IHATEPDF_CV_HOME for a flat relocated root
- XDG env vars:
XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_STATE_HOME, XDG_CACHE_HOME
- Platform defaults matching existing installs
For containers and agent sandboxes, prefer a single relocated root:
export IHATEPDF_CV_HOME=/srv/ihatepdf-cv
ihatepdf-cv-pp-cli doctor
Under IHATEPDF_CV_HOME=/srv/ihatepdf-cv, the four dirs resolve to /srv/ihatepdf-cv/config, /srv/ihatepdf-cv/data, /srv/ihatepdf-cv/state, and /srv/ihatepdf-cv/cache.
MCP servers do not receive CLI flags from the host. Put relocation in the host env block:
{
"mcpServers": {
"ihatepdf-cv": {
"command": "ihatepdf-cv-pp-mcp",
"env": {
"IHATEPDF_CV_HOME": "/srv/ihatepdf-cv"
}
}
}
}
Precedence matters in fleets: an ambient per-kind variable such as IHATEPDF_CV_DATA_DIR overrides an explicit --home for that kind. Use IHATEPDF_CV_HOME or the per-kind variables for durable fleet relocation; treat --home as the weaker per-invocation lever.
Relocation is one-way. Unsetting IHATEPDF_CV_HOME does not move files back to platform defaults, and doctor cannot find files left under a former root. Move the files manually before unsetting relocation variables.
Existing installs keep working because the platform-default rung matches the legacy layout. Run ihatepdf-cv-pp-cli doctor --fail-on warn to check path warnings in automation.
Commands
merge-pdf
Manage merge pdf
ihatepdf-cv-pp-cli merge-pdf - Check the ihatepdf.cv website
Self-learning loop
This CLI caches per-question discovery so repeat queries skip the walk and structurally similar queries get answered via entity substitution. The loop also self-captures: every invocation is journaled locally, and failed-flag corrections plus fresh teaches surface as candidates on the next recall for confirm/reject judgment. Agents call recall before discovery and fire teach & after answering. See the ## Automatic learning section in SKILL.md for the full protocol.
ihatepdf-cv-pp-cli recall <query> - Look up cached resources for a query before running discovery
ihatepdf-cv-pp-cli teach - Record a query -> resource mapping (silent on success, safe to background with &)
ihatepdf-cv-pp-cli learnings list - Inspect taught rows
ihatepdf-cv-pp-cli learnings forget <query> - Undo a teach
ihatepdf-cv-pp-cli learnings candidates - List auto-captured candidates awaiting confirm/reject
ihatepdf-cv-pp-cli learnings stats - Local loop metrics: recall hit rate, teach-to-reuse, playbook resolution, candidate counts
ihatepdf-cv-pp-cli teach-pattern - Install a query/resource template up front
ihatepdf-cv-pp-cli teach-lookup - Add an entity mapping (e.g. country code, team alias) for pattern substitution
Pass --no-learn or set IHATEPDF_CV_NO_LEARN=true to disable the loop for deterministic flows.
The local store's schema version stamp is one-way: once this version of ihatepdf-cv-pp-cli opens the database, older binaries refuse it with a version error — upgrade the binary rather than downgrading.
Output Formats
# Human-readable table (default in terminal, JSON when piped)
ihatepdf-cv-pp-cli merge-pdf
# JSON for scripting and agents
ihatepdf-cv-pp-cli merge-pdf --json
# Filter to specific fields by name
ihatepdf-cv-pp-cli merge-pdf --json --select <field>[,<field>...]
# Dry run — show the request without sending
ihatepdf-cv-pp-cli merge-pdf --dry-run
# Agent mode — JSON + compact + no prompts in one flag
ihatepdf-cv-pp-cli merge-pdf --agent
Agent Usage
This CLI is designed for AI agent consumption:
- Non-interactive - never prompts, every input is a flag
- Pipeable -
--json output to stdout, errors to stderr
- Filterable -
--select <field>[,<field>...] returns only fields you need
- Previewable -
--dry-run shows the request without sending
- Read-only by default - this CLI does not create, update, delete, publish, send, or mutate remote resources
- Offline-friendly - catalog/search commands use the local SQLite store when available
- Agent-safe by default - no colors or formatting unless
--human-friendly is set
Exit codes: 0 success, 2 usage error, 3 not found, 5 API error, 7 rate limited, 10 config error.
Health Check
ihatepdf-cv-pp-cli doctor
Verifies configuration and connectivity to the API.
Configuration
Run ihatepdf-cv-pp-cli doctor to see the resolved config, data, state, and cache directories. The platform-default config path is ~/.config/ihatepdf-cv-local-pp-cli/config.toml; --home, IHATEPDF_CV_HOME, and per-kind env vars can relocate it.
Static request headers can be configured under headers; per-command header overrides take precedence.
Troubleshooting
Not found errors (exit code 3)
- Check the resource ID is correct
- Run the
list command to see available items
API-specific
- The input is not a readable PDF — Run
ihatepdf-cv-pp-cli inspect file.pdf --json and verify the path and file type.
- A transformation refuses to overwrite a file — Choose a different
--output path; the CLI never overwrites inputs by default.
HTTP Transport
This CLI uses Chrome-compatible HTTP transport for browser-facing endpoints. It does not require a resident browser process for normal API calls.
TLS certificates are verified by default. For a trusted development or self-signed endpoint only, pass --insecure for one invocation, set IHATEPDF_CV_SKIP_TLS_VERIFY=true for the current environment, or set skip_tls_verify = true in the config file for a persistent override.
Generated by CLI Printing Press