/@noedgeai/doc2x-cli-skills:doc2x-clifrom @noedgeai/doc2x-cli-skills
Installs and operates doc2x-cli for parsing PDFs/images to Markdown, LaTeX, Word, HTML, or PDF, with translation to 11 languages and bilingual output. Supports batch processing and result reuse to avoid repeated parsing.
Ships in @noedgeai/doc2x-cli-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
CLI tool for parsing PDFs/images to Markdown, LaTeX, Word, HTML, or PDF — and translating documents to 11 languages with bilingual output.
Includes CLI 0.3.0 reuse commands. Check doc2x export --help and doc2x parse --help before using them; the npm stable release may lag this repository. CLI 0.2.0 has receipts but no export/reuse command. If the latest stable lacks these commands, preserve the receipt and explain that the feature requires a newer CLI build; never emulate reuse by repeating parse/translate. Website features are not automatically CLI features; see translation and export modes.
Avoid repeated processing: For multiple formats of one document, process it once with --to none --receipt, then use export --receipt --to md,docx,html. For an existing receipt or a failed download, read result reuse first. --reuse verifies the same uploaded bytes; ordinary parse/translate commands are not an automatic content cache. Expiry, unavailable results and mismatched files must never trigger an automatic new task.
IMPORTANT — Serial execution only: Doc2X enforces a server-side concurrent task limit. You MUST run all doc2x commands sequentially — never launch multiple doc2x processes in parallel (no concurrent Agent tool calls, no background tasks, no &). Batch commands always run sequentially (concurrency is hardcoded to 1). Violating this causes "task limit exceeded" errors.
IMPORTANT — Stable versions only: NEVER install or use beta, alpha, rc, or any pre-release versions of @noedgeai-org/doc2x-cli. Always use the @latest tag explicitly when installing or updating. If npm outdated or npm view shows a pre-release version (e.g., 1.2.0-beta.1), ignore it and stick with the latest stable release.
$ARGUMENTS
| Task | Command |
|---|---|
| Parse PDF → Markdown | doc2x parse ./paper.pdf |
| Parse PDF → Word | doc2x parse ./paper.pdf --to docx --docx-template academic |
| Parse image → Markdown | doc2x parse ./scan.png --to md |
| Translate → Chinese | doc2x translate ./paper.pdf |
| Translate → English HTML | doc2x translate ./paper.pdf --target-language en --to html |
| Export a retained task in multiple formats | doc2x export --receipt ./run.json --to md,docx,html --out ./exports |
| Verify the same file and reuse parsing | doc2x parse ./paper.pdf --reuse ./run.json --to docx |
| Preserved-layout bilingual PDF | doc2x translate ./paper.pdf --translate-type pdf --target-language en --pdf-font-strategy page-optimal |
| Batch parse | doc2x batch parse ./docs |
| Batch translate | doc2x batch translate ./docs --glob "**/*.pdf" --target-language en |
| List models | doc2x models list |
| Manage glossary | doc2x term list |
| Login (OAuth) | doc2x login |
| Logout | doc2x logout |
| Account/quota/subscription | doc2x account status --json |
| Task result history | doc2x records list --kind translate --limit 20 --json |
| One task's reported usage | doc2x usage show --translate-id ot_example --json |
| Model details/guidance | doc2x models show 10001 --json / doc2x models guide |
You MUST perform these checks at the start of every conversation before running any doc2x command. Do not skip this even if the user appears to have doc2x installed.
node --version
Node.js must be >= 22. Tell the user to upgrade first if it is lower.
doc2x --version
npm i -g @noedgeai-org/doc2x-cli@latest
doc2x --help
If command not found after install: run npm config get prefix and tell the user to add <prefix>/bin to their PATH.
After successful install, proceed to the user's request — skip step 4.
npm view @noedgeai-org/doc2x-cli dist-tags.latest
Compare the output with the currently installed version. If a newer stable version is available, update:
npm i -g @noedgeai-org/doc2x-cli@latest
CRITICAL: Always use dist-tags.latest to find the stable version. NEVER use npm outdated (it may resolve to beta/pre-release versions). NEVER install a version containing -beta, -alpha, -rc, or any pre-release suffix.
Inform the user of the version change before proceeding.
# Auto mode — saved CLI OAuth login if present, otherwise desktop session
doc2x parse ./file.pdf
# OAuth mode — no desktop app needed; browser must reach this machine's callback
doc2x login # Opens browser for OAuth login (PKCE)
doc2x models list --auth-mode oauth # Verify the new login
doc2x parse ./file.pdf --auth-mode oauth # Uses stored OAuth credentials
# Print login URL instead of opening browser
doc2x login --no-browser
# Clear stored OAuth credentials
doc2x logout
Since 0.1.11, ordinary commands automatically use the saved CLI login. Explicit --auth-mode client/oauth or authMode in --config overrides auto selection; OAuth refresh failure never falls back to another desktop account. On 0.1.9, pass --auth-mode oauth after login. --no-browser only prints a URL: it still needs a callback to a random local port within 120 seconds, not a device-code flow. For remote machines, read config and authentication.
Client mode connects to the desktop client at 127.0.0.1:34123. Falls back to encrypted storage at:
~/Library/Application Support/doc2x/doc2x-store-data.json%APPDATA%/doc2x/doc2x-store-data.json~/.config/doc2x/doc2x-store-data.jsonOAuth mode stores credentials at:
~/Library/Application Support/doc2x/cli-oauth-tokens.json%APPDATA%/doc2x/cli-oauth-tokens.json~/.config/doc2x/cli-oauth-tokens.jsonFor account, points, retained history or failure recovery, read account and receipts. Every parse/translate attempt now creates an atomic receipt, including when later export/download fails. Preserve its task IDs; --to none is successful processing without export. Receipt files contain local paths; review before sharing.
For same-file reuse, multiple output formats, 30-day expiry or retrying export without new processing, read result reuse. Fixed-layout translation remains PDF-only. Use the installed command's help as the capability gate.
For Zotero input/output, read Zotero workflow. doc2x zotero manifest prepares metadata and verifies local artifacts; actual attachment/note writes require a capable external Zotero tool. Never report the manifest as an import.
Account consumption history remains restricted. Do not invent usage list, bypass OAuth restrictions, or change accounts to obtain restricted history. usage show only uses existing per-task detail data; missing/zero defaults are not confirmed zero charges or refunds.
doc2x parse <input> [options]
Converts PDF or image to another format. Supported inputs: PDF (≤300 MB), PNG/JPG/JPEG/GIF/BMP (≤3 MB). Not supported: WebP, TIFF.
doc2x parse ./paper.pdf # → Markdown (default)
doc2x parse ./paper.pdf --to docx --docx-template academic # → Word
doc2x parse ./paper.pdf --to tex # → LaTeX
doc2x parse ./paper.pdf --to html # → HTML (client-rendered with MathJax)
doc2x parse ./paper.pdf --to pdf # → Re-typeset PDF
doc2x parse ./paper.pdf --to none --json # Parse only, no export
doc2x parse ./scan.png --to md # Image OCR
doc2x parse ./paper.pdf --image-models doc2x mathpix # With Mathpix (subscription)
doc2x parse ./paper.pdf --name "{basename}-{date}" # Custom filename
IMPORTANT: --formula-mode dollar only works with --to md. --image-hosting online stores images for only 30 days. doc2x in --image-models is mandatory and cannot be removed. --docx-template applies to V3 Word exports (--to docx) only. Values: default, general, academic, business, elegant, minimal, technical.
Load references/command-reference.md for the full option table.
doc2x translate <input> [options]
Inherits all parse options. Choose reflowed bilingual content (md) or preserved-layout PDF (pdf). The default translation model is Free (10001); use models list for current model availability.
doc2x translate ./paper.pdf # → Chinese (default)
doc2x translate ./paper.pdf --target-language en --to html # → English HTML
doc2x translate ./paper.pdf --translate-type pdf --target-language en --pdf-font-strategy page-optimal # → Bilingual PDF
doc2x translate ./paper.pdf --target-language en --to docx --docx-template technical # → Translated Word
doc2x translate ./paper.pdf --target-language en --term-id glossary1 # With glossary
doc2x translate ./paper.pdf --target-language ja --convert-trans translate # Translation only
doc2x translate ./paper.pdf --ignore-translate-types table code # Skip tables/code
doc2x translate ./paper.pdf --contextual-translation # Enhanced context
Languages: zh en ja fr ru pt pt-BR es de ko ar.
Fixed-layout PDF (--translate-type pdf) preserves page layout and exports a side-by-side bilingual PDF (original left, translation right). In 0.1.11 it defaults to --to pdf and rejects incompatible formats or --convert-trans origin/translate before upload; --to none skips export. Version 0.1.9 silently ignored those incompatible options. --pdf-font-strategy: global-consistent (default) or page-optimal. Use --translate-type md --convert-trans translate --to docx for a reflowed translation-only Word document.
Do not suggest combinedTranslate or combined-output CLI flags; the current stable CLI does not expose them.
doc2x batch <parse|translate> [inputs...] [options]
doc2x batch parse ./docs # Sequential parse
doc2x batch translate ./papers --glob "**/*.pdf" --target-language en # Batch translate
doc2x batch parse ./docs --dry-run # Preview matches
doc2x batch parse ./docs --continue-on-error --report ./report.json # Fault-tolerant
CRITICAL: Batch always runs sequentially (concurrency hardcoded to 1). Running multiple doc2x commands in parallel will trigger "task limit exceeded" errors. Always process one doc2x command at a time.
Defaults: --glob "**/*.{pdf,png,jpg,jpeg}", --skip-existing true, --report ./doc2x-report.json. Exit code 6 when some files fail with --continue-on-error.
doc2x login # Opens browser for OAuth login
doc2x login --no-browser # Print login URL instead
doc2x logout # Clear stored OAuth credentials
doc2x models list # Table: Model ID, Name, Subscription, Flags
doc2x models list --json # JSON array
doc2x term list # List glossaries
doc2x term create --name "Medical Terms" # Create → returns ID
doc2x term items --term-id <id> # View entries
doc2x term import --term-id <id> --file ./terms.csv # Import CSV
CSV format (RFC 4180): origin,translate,originLang,translateLang. Header auto-detected. Default: en→zh.
| Option | Default | Description |
|---|---|---|
--config <path> | — | Config file (YAML/JSON) |
--auth-mode | auto selection | auto, client, or oauth |
--timeout <ms> | 60000 | API timeout |
--retry <n> | 2 | Download retry count |
--json | false | JSON output |
--quiet | false | Errors only |
--verbose | false | Debug output |
--no-color | false | Disable colors (also NO_COLOR env) |
doc2x parse ./file.pdf --config ./doc2x.config.yaml
Priority: CLI flags > config > built-in defaults. Load references/config-and-auth.md for full schema.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Invalid arguments |
| 2 | Auth/quota/subscription failure |
| 3 | Input file error (missing, too large, unsupported) |
| 4 | Server task failed |
| 5 | Export/download failed |
| 6 | Batch partial failure |
Load references/troubleshooting.md for the full list (21 error scenarios with exact messages).
Common issues:
command not found → npm config get prefix, add <prefix>/bin to PATHnpm i -g @noedgeai-org/doc2x-cli@latest --registry=https://registry.npmjs.orgdoc2x login to re-authenticate via browserUnsupported image format → convert WebP/TIFF to PNG firstModel requires subscription → upgrade at https://doc2x.noedgeai.com/Insufficient quota → free + subscription pages exhaustedreferences/command-reference.md: Complete option tables for all commands, supported formats, processing pipelinesreferences/config-and-auth.md: Authentication details, full config schema, batch behavior, exit codesreferences/troubleshooting.md: All error messages with exit codes, validation rules, debugging tipsreferences/result-reuse.md: Process once, export multiple formats, verify file identity, expiry and retry boundariesagents/agent.yaml (opens in a new tab)references/account-and-receipts.md (opens in a new tab)references/command-reference.md (opens in a new tab)references/config-and-auth.md (opens in a new tab)references/result-reuse.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/zotero-workflow.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
Generated from the plugin's indexed repository (noedgeai/doc2x-cli-skills) — no native marketplace selected
npx claudepluginhub p/noedgeai-noedgeai-doc2x-cli-skills