{"_id":"@ayasechan/minerucc","_rev":"2-56faa8b18b70e6b0793c19a2c15ac37d","name":"@ayasechan/minerucc","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@ayasechan/minerucc","version":"0.1.0","license":"MIT","_id":"@ayasechan/minerucc@0.1.0","maintainers":[{"name":"ayasechan","email":"namamuk@outlook.com"}],"bin":{"minerucc":"dist/index.mjs"},"dist":{"shasum":"c6142627ef1a5dca25d9c9be700adbd3f98a4508","tarball":"https://registry.npmjs.org/@ayasechan/minerucc/-/minerucc-0.1.0.tgz","fileCount":3,"integrity":"sha512-1HJwYIIQRu1Q7jzAiKs1eKTm0KgQ1aCXGaHr3w8mqReGqlGs0q8KvRdHmkyi1qXM81LbmCsljVaBvwQJFG7xYA==","signatures":[{"sig":"MEYCIQDb3Tv7wPPRlOWgUsGhrpU41Ir2lzzTETSF9pK9LPtMpQIhAMNjrgIJHBtAQ4KTrWL4jK1260PYGDevqGal5Hss8rOI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44942},"type":"module","engines":{"node":">=26"},"gitHead":"6a3e45280b90e0b3ec4389a9e191d14cbd8f6056","scripts":{"dev":"tsdown --watch","test":"vitest run","build":"tsdown","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"ayasechan","email":"namamuk@outlook.com"},"_npmVersion":"11.16.0","description":"MinerU OCR API command-line client: parse local files and URLs into Markdown","directories":{},"_nodeVersion":"26.3.1","dependencies":{"fflate":"^0.8.3","commander":"^15.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.18.1","vitest":"^4.1.10","typescript":"^5.9.3","@types/node":"^26.1.2"},"_npmOperationalInternal":{"tmp":"tmp/minerucc_0.1.0_1785952221995_0.6608691112566314","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ayasechan/minerucc","version":"0.1.1","description":"MinerU OCR API command-line client: parse local files and URLs into Markdown","type":"module","bin":{"minerucc":"dist/index.mjs"},"engines":{"node":">=26"},"scripts":{"build":"tsdown","dev":"tsdown --watch","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm run build"},"dependencies":{"commander":"^15.0.0","fflate":"^0.8.3"},"devDependencies":{"@types/node":"^26.1.2","tsdown":"^0.18.1","typescript":"^5.9.3","vitest":"^4.1.10"},"license":"MIT","gitHead":"b0156777179c70a9cad2fd148cf1281bbdcca852","_id":"@ayasechan/minerucc@0.1.1","_nodeVersion":"26.3.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-yRB9nDScvkZymbhkfo89FwfqODODOmKN6GN0n+umxxeeUUfVGZ9x7eEPycgnxryswLVk3ba8v/ht8dsYTjlkgw==","shasum":"83558fdbe7a5b0b4feec7d864a38488191cc649e","tarball":"https://registry.npmjs.org/@ayasechan/minerucc/-/minerucc-0.1.1.tgz","fileCount":3,"unpackedSize":44953,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCSQjbU/LQuEShUPzUT8JMLlPdRJdNFexXrLmiJJYm6gAIhALyiCCRwovgoFPnUvQY68Rt0AR3V3xlwyqICxWulrQDX"}]},"_npmUser":{"name":"ayasechan","email":"namamuk@outlook.com"},"directories":{},"maintainers":[{"name":"ayasechan","email":"namamuk@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/minerucc_0.1.1_1785953336949_0.24979116570457327"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-05T17:50:21.760Z","modified":"2026-08-05T18:08:57.238Z","0.1.0":"2026-08-05T17:50:22.138Z","0.1.1":"2026-08-05T18:08:57.075Z"},"license":"MIT","description":"MinerU OCR API command-line client: parse local files and URLs into Markdown","maintainers":[{"name":"ayasechan","email":"namamuk@outlook.com"}],"readme":"# minerucc\n\nA CLI client for the [MinerU OCR API v4](https://ocr.eo.mk). It parses local files and public URLs into Markdown: local files are uploaded to OSS, then polled to a terminal state, and the result zip (`full.md` + `images/`) is downloaded and extracted.\n\n## Requirements\n\n- Node.js >= 26\n- A MinerU API key (`MINERUCC_API_KEY`)\n\n## Installation\n\n```sh\nnpm install -g @ayasechan/minerucc\n```\n\nTo build and run from a checkout:\n\n```sh\nnpm run build\nnode dist/index.mjs --help\n```\n\n## Setup\n\nThe API key is required and read from the `MINERUCC_API_KEY` environment variable (or passed with `--api-key`). The service base URL defaults to `https://ocr.eo.mk` and can be overridden with `MINERUCC_BASE_URL` or `--base-url`.\n\n```sh\nexport MINERUCC_API_KEY=your-key\n```\n\n## Commands\n\n### `parse <files...>` — local files, full flow\n\nUpload local files to OSS, submit them, poll to completion, then download and extract each result.\n\n```sh\nminerucc parse report.pdf slides.pptx --output ./results\n```\n\nThe output defaults to `./out/<filename>` (without extension); override with `-o, --output <dir>`. At most 50 files, each up to 200 MB.\n\n### `submit <files...>` — local files, no polling\n\nUpload and submit local files, then print the `batch_id` and `task_ids` without waiting. Use `get` later to fetch the results.\n\n```sh\nminerucc submit report.pdf\n```\n\n### `parse-url <url>` — single public URL\n\nSubmit a public URL and poll until parsed, then download and extract.\n\n```sh\nminerucc parse-url https://example.com/doc.pdf\n```\n\nThe output defaults to `./out/<task_id>`; override with `-o, --output <dir>`.\n\n### `submit-url <url>` — single public URL, no polling\n\nSubmit a public URL and print the `task_id`.\n\n```sh\nminerucc submit-url https://example.com/doc.pdf\n```\n\n### `batch <urls...>` — multiple public URLs\n\nSubmit up to 50 public URLs, poll the batch, and download/extract each result. The output defaults to `./out/<task_id>` per URL; override with `-o, --output <dir>`.\n\n```sh\nminerucc batch https://example.com/a.pdf https://example.com/b.pdf\n```\n\n### `status <task_id>` — query one task once\n\n```sh\nminerucc status 3fa85f64-5717-4562-b3fc-2c963f66afa6\n```\n\n### `batch-status <batch_id>` — query one batch once\n\n```sh\nminerucc batch-status 3fa85f64-5717-4562-b3fc-2c963f66afa6\n```\n\n### `get <task_id>` — poll a submitted task, then download\n\nPoll a previously submitted task to a terminal state, then download and extract its result. The output defaults to `./out/<task_id>`; override with `-o, --output <dir>`.\n\n```sh\nminerucc get 3fa85f64-5717-4562-b3fc-2c963f66afa6\n```\n\n## Global flags\n\nAvailable on every command (before or after the subcommand):\n\n| Flag | Description |\n| --- | --- |\n| `--api-key <key>` | API key (defaults to `MINERUCC_API_KEY`) |\n| `--base-url <url>` | Service base URL (defaults to `MINERUCC_BASE_URL` or `https://ocr.eo.mk`) |\n| `--json` | Print machine-readable JSON output |\n| `--quiet` | Suppress polling progress output |\n| `--verbose` | Print debug information (e.g. HTTP error bodies) |\n\n## Submit-parameter flags\n\nShared by `parse`, `submit`, `parse-url`, `submit-url`, and `batch`:\n\n| Flag | Description |\n| --- | --- |\n| `--ocr` / `--no-ocr` | Enable/disable OCR (on by default) |\n| `--formula` / `--no-formula` | Enable/disable formula recognition (server default applies when unset) |\n| `--table` / `--no-table` | Enable/disable table recognition (server default applies when unset) |\n| `-l, --language <lang>` | Document language (default: `ch`) |\n| `--model-version <ver>` | Model version: `vlm`, `pipeline`, or `MinerU-HTML` |\n| `--pages <ranges>` | Page ranges, e.g. `1-20, 2, 4-6` |\n| `--data-id <id>` | Business ID (defaults to an auto-generated UUID) |\n| `--extra-formats <list>` | Extra export formats, comma-separated: `docx,html,latex` |\n\nHTML inputs (`.html`/`.htm`) automatically select the `MinerU-HTML` model unless `--model-version` is given.\n\n### Callback flags\n\nUsed by `parse` and `submit` for local-file submissions:\n\n| Flag | Description |\n| --- | --- |\n| `--callback <url>` | Callback URL called when parsing completes (requires `--seed`) |\n| `--seed <string>` | Random string used to sign the callback request |\n\n### Polling flags\n\nUsed by `parse`, `parse-url`, `batch`, and `get`:\n\n| Flag | Description |\n| --- | --- |\n| `--interval <ms>` | Polling interval in milliseconds (default: 5000; minimum: 3000) |\n| `--timeout <s>` | Total polling timeout in seconds (default: 600) |\n\n### URL cache flags\n\nUsed by `parse-url`, `submit-url`, and `batch`:\n\n| Flag | Description |\n| --- | --- |\n| `--no-cache` | Force re-fetching the URL, ignoring the server cache |\n| `--cache-tolerance <sec>` | Acceptable cache age in seconds; re-fetch if older |\n\n## Output\n\nEach successful result produces a directory containing `full.md` and the referenced `images/` folder; relative paths are preserved so the Markdown image references work as-is.\n\n- Local files: `./out/<filename>` (e.g. `./out/report/full.md`)\n- URL tasks: `./out/<task_id>`\n\n`--json` prints a single JSON object, e.g.:\n\n```json\n{\"ok\":true,\"kind\":\"parse\",\"batchId\":\"...\",\"results\":[{\"file\":\"report.pdf\",\"taskId\":\"...\",\"outputDir\":\"out/report\",\"markdownPath\":\"/abs/out/report/full.md\",\"imageCount\":3}]}\n```\n\nOn failure, JSON output is `{\"ok\":false,\"error\":{\"exitCode\":1,\"message\":\"...\"}}`.\n\n## Exit codes\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | Generic, upload, or parse failure |\n| 2 | Usage error |\n| 3 | Authentication failure (401/403) |\n| 4 | Rate limited (429) |\n| 5 | Not found (404, or task/batch missing or expired) |\n| 6 | Validation or business error |\n| 7 | Network error |\n| 8 | Timeout |\n\n## Supported file types\n\n`.pdf`, `.png`, `.jpg`, `.jpeg`, `.jp2`, `.webp`, `.gif`, `.bmp`, `.doc`, `.docx`, `.ppt`, `.pptx`, `.xls`, `.xlsx`, `.html`, `.htm`\n\n## Development\n\n```sh\nnpm run build          # bundle with tsdown → dist/index.mjs\nnpm run dev            # tsdown --watch\nnpm run typecheck      # tsc --noEmit\nnpm test               # vitest run\n```\n","readmeFilename":"README.md"}