{"id":"0117f6cb-4d77-49ef-add6-282bbae9e15f","entityType":"agent","slug":"clawhub-laiye-adp-adp-invoice-recognition-and-extract","name":"Global Invoice Recognition and extraction（ADP）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-laiye-adp-adp-invoice-recognition-and-extract","canonicalPath":"/agent/clawhub-laiye-adp-adp-invoice-recognition-and-extract","generatedAt":"2026-10-13T01:47:30.148Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":null},"description":"Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, t...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 955 downloads reported by the source. Last updated 10/12/2026.","installCommand":"clawhub skill install s17cqxy7t90jwwf5x1jhnss4td85c8ch:adp-invoice-recognition-and-extract","sourceUrl":"https://clawhub.ai/laiye-adp/adp-invoice-recognition-and-extract","homepage":"https://clawhub.ai/laiye-adp/skills/adp-invoice-recognition-and-extract","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/laiye-adp/adp-invoice-recognition-and-extract","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/laiye-adp/skills/adp-invoice-recognition-and-extract","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Global Invoice Recognition and extraction（ADP） technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":null},"stars":null,"forks":null,"downloads":955,"likes":null,"task":null,"library":null,"packageName":null,"latestVersion":"1.0.2","tractionLabel":"955 downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:22:55.370Z","emptyReason":null},"lastUpdatedAt":"2026-10-12T02:22:55.384Z","lastCrawledAt":"2026-10-12T02:22:55.370Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-13T02:22:55.370Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.2","createdAt":"2026-05-20T02:59:28.890Z","changelog":"- Added greater emphasis on the global endpoint (adp-global.laiye.com) as default for international users. - Swapped and clarified the order of registration links: \"Global\" now precedes \"China Mainland\" throughout. - Updated example commands to use variable filename extensions for Base64 extraction input, improving flexibility. - Minor language tweaks to streamline terminology and improve clarity for global users. - No functional or code changes; documentation only.","fileCount":6,"zipByteSize":20908},{"version":"1.0.1","createdAt":"2026-05-19T13:31:07.955Z","changelog":"- Documentation updated to clarify concurrency limits for invoice extraction. - Free users are now limited to 2 concurrent documents; paid users can process up to 10 concurrently. - No code changes in this version.","fileCount":5,"zipByteSize":19420},{"version":"1.0.0","createdAt":"2026-05-19T12:31:33.285Z","changelog":"- Initial release of invoice-recognition-and-extract skill. - Provides global, multi-language, multi-currency invoice extraction with zero configuration. - Accurately extracts structured data: invoice number, date, supplier, buyer, currency, tax amount, total, and line items from invoices, receipts, and bills. - Supports all file types (PDFs, scans, photos) and multiple input methods (URL, local file, Base64). - Includes full CLI setup instructions, command mappings, and detailed usage guidance. - Offers 100 free monthly credits; limited-time bonus of 1,000 pages invoice extractions for new users.","fileCount":5,"zipByteSize":19353}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cqxy7t90jwwf5x1jhnss4td85c8ch:adp-invoice-recognition-and-extract","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17cqxy7t90jwwf5x1jhnss4td85c8ch:adp-invoice-recognition-and-extract` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/laiye-adp/adp-invoice-recognition-and-extract before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-13T01:47:30.146Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-laiye-adp-adp-invoice-recognition-and-extract/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":null},"readme":"Skill: Global Invoice Recognition and extraction（ADP）\n\nOwner: laiye-adp\n\nSummary: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, t...\n\nTags: latest:1.0.2\n\nVersion history:\n\nv1.0.2 | 2026-05-20T02:59:28.890Z | user\n\n- Added greater emphasis on the global endpoint (adp-global.laiye.com) as default for international users.\n- Swapped and clarified the order of registration links: \"Global\" now precedes \"China Mainland\" throughout.\n- Updated example commands to use variable filename extensions for Base64 extraction input, improving flexibility.\n- Minor language tweaks to streamline terminology and improve clarity for global users.\n- No functional or code changes; documentation only.\n\nv1.0.1 | 2026-05-19T13:31:07.955Z | user\n\n- Documentation updated to clarify concurrency limits for invoice extraction.\n- Free users are now limited to 2 concurrent documents; paid users can process up to 10 concurrently.\n- No code changes in this version.\n\nv1.0.0 | 2026-05-19T12:31:33.285Z | user\n\n- Initial release of invoice-recognition-and-extract skill.\n- Provides global, multi-language, multi-currency invoice extraction with zero configuration.\n- Accurately extracts structured data: invoice number, date, supplier, buyer, currency, tax amount, total, and line items from invoices, receipts, and bills.\n- Supports all file types (PDFs, scans, photos) and multiple input methods (URL, local file, Base64).\n- Includes full CLI setup instructions, command mappings, and detailed usage guidance.\n- Offers 100 free monthly credits; limited-time bonus of 1,000 pages invoice extractions for new users.\n\nArchive index:\n\nArchive v1.0.2: 6 files, 20908 bytes\n\nFiles: license.md (5156b), README-CN.md (9679b), README.md (10831b), skill-card.md (2928b), SKILL.md (23063b), _meta.json (154b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: invoice-recognition-and-extract\ndescription: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items, outputting structured JSON. Zero-configuration, out-of-the-box, suitable for accounts payable automation, expense reimbursement, and cross-border trade document processing.\n---\n\n# Global Invoice Recognition and Extraction Skill\n\nPowered by [Laiye ADP (Agentic Document Processing)](https://adp-global.laiye.com/?utm_source=clawhub), this skill delivers intelligent, high-precision parsing and information extraction for standard and non-standard invoices, bills, and vouchers from all regions worldwide. It supports all file types including electronic PDFs, scanned documents, and photographs, and outputs standardized structured JSON data for seamless integration with business processes and downstream automation.\n\n> New users receive **100 free credits per month** (refreshed monthly) for invoice extraction and other document processing scenarios. **Limited-Time Offer:** Use the invoice extraction feature for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users only, first come first served! ADP provides a standard commercial API that can be **integrated into business systems within 1 hour**.\n</br> Register now: [Global](https://adp-global.laiye.com/?utm_source=clawhub) | [China Mainland](https://adp.laiye.com/?utm_source=clawhub)\n\nWhy choose us?\n  - Global invoices with zero barriers — multi-language, multi-format precision recognition\n  - 100+ languages fully covered: English, Japanese, Korean, German, French, Thai, and all other major languages — invoices and receipts all supported\n  - Adaptive to all formats: standard VAT invoices, unstructured receipts, mixed-format bills — all recognized\n  - 95%+ accuracy: precise extraction of key fields, dramatically reducing manual verification, translation, and data entry costs\n  - Agentic self-optimization: continuously fine-tuned on your business data — the more you use it, the more accurate and tailored it becomes\n\n---\n\n## Quick Start Guide\n\n### Core Workflow\n\n1. **Install dependencies**: On first run, install the ADP CLI tool.\n2. **Authentication setup**: On first run, execute `adp config get` to check credentials. If not configured, prompt the user to provide an API Key.\n3. **Get app list**: On first run, retrieve the out-of-the-box app list via `adp app-id list --app-type 0`, find the invoice extraction app, and record its `app_id` (prefixed with `ootb_`). For subsequent runs, prefer `adp app-id cache`.\n4. **Execute extraction**: Run `adp extract url <URL> --app-id <invoice-app-id>` or `adp extract local <file-path> --app-id <invoice-app-id>`.\n5. **Process results**: Parse the returned JSON to extract structured fields such as invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items.\n6. **Error handling**: When a command fails, parse the stderr JSON to determine the error type and recovery action.\n\n### Scenario-to-Command Mapping\n\n**Single Invoice Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Recognize an invoice image/PDF (URL) | `adp extract url <URL> --app-id <ID>` |\n| Recognize a local invoice file | `adp extract local <file-path> --app-id <ID>` |\n| Recognize a Base64-encoded invoice | `adp extract base64 <base64> --app-id <ID> --file-name <filename.ext>` |\n\n**Batch Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Batch recognize invoices in a local folder | `adp extract local <folder-path> --app-id <ID>` |\n| Batch recognize multiple URLs | `adp extract url <URL-list-file> --app-id <ID>` |\n\n**Async Processing**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Submit a large file asynchronously | `adp extract url <URL> --app-id <ID> --async` |\n| Async batch processing | `adp extract local <folder-path> --app-id <ID> --async ` |\n| Query async task result | `adp extract query <task_id>` |\n\n> Concurrency Limit: Free users support a maximum of 2 documents for concurrent processing, while paid users support up to 10 documents concurrently.\n\n---\n\n## Step 1: Install ADP CLI\n\n```bash\n# Method 1: npm (recommended, cross-platform)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n```\n\n```bash\n# Method 2: Shell script (Linux / macOS, when npm is unavailable)\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n```\n\n```bash\n# Method 3: PowerShell script (Windows, when npm is unavailable)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download prebuilt binaries from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n\n## Step 2: Get API Key & Configure Authentication\n\nRegister and obtain an API Key (100 free credits per month + limited-time bonus: 1,000 free invoice extraction pages):\n- Global (all other regions): [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n- China Mainland, Hong Kong, Macau, and Taiwan: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n---\n\n## Step 3: Get the Invoice Extraction App ID\n\nADP provides **out-of-the-box** built-in extraction apps for global invoices/receipts, supporting multiple languages and currencies with no additional configuration required.\n\n### App Types\n\nADP apps are divided into two categories, distinguished by the `app_type` field:\n\n| `app_type` | Type | Description |\n| --- | --- | --- |\n| `0` | Out-of-the-box (OOTB) | Platform built-in, `app_id` prefixed with `ootb_`, ready to use without creation |\n| `1` | Custom | User-created extraction apps with user-defined `app_id` |\n\nInvoice recognition is an **out-of-the-box app** and can be queried using `--app-type 0`.\n\n### Query and Filter Invoice Apps\n\n```bash\n# Query OOTB apps only (recommended)\nadp app-id list --app-type 0\n\n# Or query all apps\nadp app-id list\n```\n\nFind the app whose `app_label` contains **\"Invoice\"**, **\"Receipt\"**, or **\"Bill\"** in the returned list, and record its `app_id`:\n\n```json\n[\n  {\n      \"app_id\": \"ootb_*****c8d1\",\n      \"app_label\": [\n        \"Invoice\",\n        \"Receipt\",\n        \"Information Extraction\",\n        \"High accuracy\",\n        \"High-speed extraction\"\n      ],\n      \"app_name\": \"Invoice/Receipt\",\n      \"app_type\": 0\n    }\n]\n```\n\n> In the example above, `\"app_id\": \"ootb_*****c8d1\"` is the global invoice extraction app. `app_type` of `0` indicates an out-of-the-box app; `1` indicates a custom app.\n\n### Cache App ID (Recommended)\n\nAfter the initial query, prefer using cache for subsequent requests to avoid redundant API calls:\n\n```bash\n# Use cache for subsequent calls\nadp app-id cache\n```\n\n**Important**: Each account's `app_id` is unique and fixed — it will not change unless the user explicitly deletes the app. It is recommended that the Agent save the invoice app's `app_id` in context and reuse it directly in subsequent calls.\n\n---\n\n## Step 4: Execute Invoice Extraction\n\n### Single Invoice Extraction (URL)\n\n```bash\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Local File)\n\n```bash\nadp extract local ./invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Base64)\n\n```bash\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name <filename.ext>\n```\n\n### Response Example\n\nADP automatically supports invoice recognition in 100+ languages across all regions globally and automatically detects currencies. Extraction results are returned as unified structured JSON. The response contains two types of fields: **regular fields** and **table fields (line items)**.\n\n> The following example is a simplified format showing only core fields. The full response also includes `field_confidence` (confidence score) and `references` (source location) metadata — see \"Common Field Structure\" below for details.\n\n```json\n[\n  {\n    \"field_key\": \"invoice_number\",\n    \"field_name\": \"Invoice Number\",\n    \"field_values\": [\n      {\n        \"field_value\": \"INV-2026-003721\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"invoice_date\",\n    \"field_name\": \"Invoice Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-03-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"due_date\",\n    \"field_name\": \"Due Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-04-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"currency\",\n    \"field_name\": \"Currency\",\n    \"field_values\": [\n      {\n        \"field_value\": \"USD\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_name\",\n    \"field_name\": \"Supplier Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Acme Global Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_address\",\n    \"field_name\": \"Supplier Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1234 Commerce Blvd, Suite 500, San Francisco, CA 94105, USA\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_name\",\n    \"field_name\": \"Buyer Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Eastern International Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_address\",\n    \"field_name\": \"Buyer Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1000 Lujiazui Ring Road, Pudong New Area, Shanghai\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"subtotal\",\n    \"field_name\": \"Subtotal\",\n    \"field_values\": [\n      {\n        \"field_value\": \"8,500.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"tax_amount\",\n    \"field_name\": \"Tax Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"680.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"total_amount\",\n    \"field_name\": \"Total Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"9,180.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"line_items\",\n    \"field_name\": \"Line Items\",\n    \"field_confidence\": 0.98,\n    \"table_values\": [\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Industrial Sensor Module X200\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"50\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"120.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"6,000.00\"\n            }\n          ]\n        }\n      ],\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Connector Kit CK-50 (Pack of 100)\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"25\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"100.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"2,500.00\"\n            }\n          ]\n        }\n      ]\n    ]\n  }\n]\n```\n\n### Extraction Field Reference\n\n> **Note**: `field_key` and `field_name` are always returned in English. `field_value` is multilingual — its content reflects the language of the source document (e.g., Chinese invoices return Chinese values, Japanese invoices return Japanese values). Different regions/types of invoices may return different field sets — the following lists all known fields.\n\n**Regular Fields:**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `invoice_number` | Invoice Number | Invoice number |\n| `invoice_date` | Invoice Date | Invoice date |\n| `due_date` | Due Date | Payment due date |\n| `currency` | Currency | Currency (e.g., USD, EUR, GBP, JPY, etc.) |\n| `supplier_name` | Supplier Name | Supplier / seller name |\n| `supplier_address` | Supplier Address | Supplier / seller address |\n| `supplier_vat_number` | Supplier VAT Number | Supplier tax ID (e.g., Japan T-prefixed registration number) |\n| `buyer_name` | Buyer Name | Buyer / purchaser name (some invoices use `customer_name`) |\n| `buyer_address` | Buyer Address | Buyer / purchaser address |\n| `customer_name` | Customer Name | Customer / buyer name (alternates with `buyer_name` depending on invoice type) |\n| `customer_vat_number` | Customer VAT Number | Customer tax ID; returns \"No result\" when not recognized |\n| `subtotal` | Subtotal | Subtotal amount (before tax; some invoices use `total_without_tax`) |\n| `total_without_tax` | Total (excl. tax) | Total excluding tax (alternates with `subtotal` depending on invoice type) |\n| `tax_amount` | Tax Amount | Tax amount |\n| `vat_rate` | VAT Rate | VAT rate (e.g., 10%, 13%) |\n| `total_amount` | Total Amount | Total amount (including tax) |\n| `amount_due` | Amount Due | Amount due (may equal `total_amount`) |\n\n**Table Fields (Line Items):**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `line_items` | Line Items | Line items table |\n| `line_items_item_code` | Item Code | Product / item code; returns \"No result\" when not recognized |\n| `line_items_description` | Description | Product / service description |\n| `line_items_quantity` | Quantity | Quantity |\n| `line_items_unit_price` | Unit Price | Unit price |\n| `line_items_amount` | Amount | Line amount (some invoices use `line_items_total_amount`) |\n| `line_items_total_amount` | Total Amount | Line total amount (alternates with `line_items_amount` depending on invoice type) |\n\n### Common Field Structure\n\nEach field object contains the following properties:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `field_key` | string | Field identifier (machine-readable) |\n| `field_name` | string | Field name (human-readable, localized based on document language) |\n| `field_values` | array | Extraction result array (present for regular fields) |\n| `field_values[].field_value` | string | Extracted value; empty string or \"No result\" when not recognized |\n| `field_values[].field_confidence` | number | Confidence score (0.0–1.0); 0.0 indicates not recognized / low confidence |\n| `field_values[].references` | array | Source location references (coordinates or text snippets) |\n| `field_confidence` | number | Overall confidence score (table-level for table fields) |\n| `table_values` | array[array] | Only present for table fields. 2D array: each row is a line item, each cell contains `field_name`, `field_key`, `field_values` |\n\n**How to distinguish field types:** If `table_values` is present → table field, read from `table_values`; otherwise → regular field, read from `field_values`.\n\n---\n\n## Step 5: Batch Processing & Async Mode\n\n### Batch Processing (Local Folder)\n\n```bash\nadp extract local ./invoices/ --app-id <invoice-app-id> --export ./results/ \n```\n\nResponse summary:\n```json\n{\n  \"total\": 10,\n  \"success\": 9,\n  \"failed\": 1,\n  \"output_dir\": \"/absolute/path/to/results\",\n  \"files\": [\n    {\n      \"input\": \"invoice-001.pdf\",\n      \"output\": \"invoice-001.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"invoice-002.pdf\",\n      \"output\": \"invoice-002.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"damaged.pdf\",\n      \"output\": \"damaged.pdf.error.json\",\n      \"status\": \"failed\",\n      \"error\": \"File is corrupted or unreadable\"\n    }\n  ]\n}\n```\n\n**Batch Response Summary Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `total` | number | Total number of files |\n| `success` | number | Number of successfully processed files |\n| `failed` | number | Number of failed files |\n| `output_dir` | string | Absolute path to the output directory |\n| `files` | array | Processing result list for each file |\n| `files[].input` | string | Input filename |\n| `files[].output` | string | Output result filename (`.json` on success, `.error.json` on failure) |\n| `files[].status` | string | Processing status: `\"success\"` or `\"failed\"` |\n| `files[].error` | string | Only present on failure; describes the failure reason |\n\n### Async Processing\n\n```bash\n# Submit async task\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id> --async\n\n# Query task result\nadp extract query <task_id>\n```\n\n---\n\n## Command Quick Reference\n\n```bash\n# Check installation\nadp version\n\n# View configuration\nadp config get\n\n# List all apps\nadp app-id list\n\n# List OOTB apps only (app_type=0)\nadp app-id list --app-type 0\n\n# Use cached apps\nadp app-id cache\n\n# Check credit balance\nadp credit\n\n# Invoice extraction (URL)\nadp extract url <file-URL> --app-id <invoice-app-id>\n\n# Invoice extraction (local file)\nadp extract local <file-path> --app-id <invoice-app-id>\n\n# Invoice extraction (Base64)\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name <filename.ext>\n\n# Batch extraction\nadp extract local <folder-path> --app-id <invoice-app-id> --export <output-path>\n\n# Async extraction\nadp extract url <file-URL> --app-id <invoice-app-id> --async\n\n# Query async result\nadp extract query <task_id>\n```\n\n---\n\n## Error Handling\n\nWhen a command fails, stderr outputs structured JSON:\n\n```json\n{\n  \"type\": \"AUTH_ERROR\",\n  \"message\": \"Authentication error: invalid API key\",\n  \"fix\": \"Check your API key is correct and has not expired.\",\n  \"retryable\": false,\n  \"details\": {\"context\": \"extract\"}\n}\n```\n\n**Error Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `type` | string | Error type identifier (e.g., `AUTH_ERROR`, `PARAM_ERROR`, `NOT_FOUND`, etc.) |\n| `message` | string | Error description |\n| `fix` | string | Suggested fix action |\n| `retryable` | boolean | Whether the operation can be retried (`true` = retryable, `false` = requires manual intervention) |\n| `details` | object | Error context information |\n\n### Exit Codes\n\n| Exit Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | General error |\n| 2 | Parameter error |\n| 3 | Resource not found |\n| 4 | Permission / authentication error |\n| 5 | Conflict |\n| 6 | Partial failure (some succeeded, some failed in batch processing) |\n\n---\n\n## Credits & Billing\n\n| Item | Description |\n| --- | --- |\n| Invoice/receipt extraction cost | **1.5 credits/page** |\n| Monthly free quota | **100 credits per month** (usable for invoice extraction and other document processing), resets at the beginning of each month |\n| Limited-time offer | Use invoice extraction for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users, first come first served |\n| Check balance | `adp credit` |\n| Top up | Log in to the ADP portal: [Global](https://adp-global.laiye.com/?utm_source=clawhub) \\| [China Mainland, HK, Macau, Taiwan](https://adp.laiye.com/?utm_source=clawhub) |\n\n---\n\n## More Laiye ADP Document Processing Capabilities\n\nGlobal invoice recognition is just one of many out-of-the-box capabilities offered by the Laiye ADP platform. Built on large model general understanding capabilities, ADP provides intelligent processing solutions covering all document categories:\n\n| Capability | Description | Typical Scenarios |\n| --- | --- | --- |\n| **Global Invoice/Receipt Extraction** | Automatically recognizes and extracts 10+ key fields including invoice number, date, amount, taxes, and line items; supports multi-language and multi-currency invoice extraction | Cross-border accounts payable automation, expense reimbursement management |\n| **China Domestic Bill Extraction** | Recognizes 30+ common bill types including VAT invoices, taxi receipts, train tickets, flight itineraries, fiscal invoices; supports multi-page/multi-bill recognition and verification | Domestic bill recognition, domestic invoice verification |\n| **Order Extraction** | Supports various purchase order formats; extracts order number, products, quantities, prices, logistics information, etc. | Procurement automation, supply chain integration |\n| **ID & Credential Extraction** | ADP supports 11 common Chinese credentials including ID cards, HK/Macau/Taiwan travel permits, Chinese passports, bank cards, household registers, driver's licenses, vehicle registration certificates, vehicle qualification certificates, account opening permits, and business licenses | Account opening review, compliance checks, batch credential data entry |\n| **Document Parsing** | Converts PDFs, images, and Office documents into structured data while preserving layout and hierarchical relationships | Long document analysis, contract review, knowledge extraction |\n| **Custom Extraction** | Create custom extraction apps with proprietary fields and recognition logic for non-standard documents | Enterprise-specific forms, industry-customized documents |\n\nAll capabilities above can be accessed through the same ADP CLI tool, sharing the ADP API Key and credit system.\n\nFor the full list of capabilities, visit:\n- ADP Global: [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n- ADP China Mainland: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n\n\n---\n\n## Important Notes\n\n1. **Data integrity**: When using ADP output, present the returned data as-is. Do not modify, add, or remove any fields during the extraction process.\n2. **API Key security**: Keep your API Key safe and do not share it with unauthorized third parties.\n3. **File size limit**: Maximum 50MB per file.\n4. **Supported formats**: .jpg, .jpeg, .png, .bmp, .tiff, .tif, .pdf, .doc, .docx, .xls, .xlsx\n5. **App ID reuse**: The invoice app's `app_id` is unique and fixed within an account. It is recommended to save it and reuse directly — no need to query every time.\n\n---\n\n## Support & Contact\n- **CLI User Guide:** [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)\n- **API Documentation:** [Open API User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd)\n- **ADP Product Manual:** [Public Cloud Manual](https://laiye-tech.feishu.cn/wiki/OfexwgVUQiOpEek4kO7c7NEJnAe)\n- **Issue Tracker:** [GitHub Issues](https://github.com/laiye-ai/adp-cli/issues)\n- **Email:** global_product@laiye.com\n- **Website:** [Laiye](https://laiye.com/en/product/adp-platform)\n\nCopyright 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nFile v1.0.2:README.md\n\n## 🚀 About Laiye ADP\n\nADP is Laiye's **intelligent agent document processing product (Agentic Document Processing, referred to as ADP)** , based on the general understanding ability of large models, without relying on rules and annotations, with the general understanding ability of multi-language, MultiModal Machine Learning, and multi-scene; autonomous planning and execution of intelligent agents, able to understand task goals, autonomous planning steps, invoke tools, and complete complex tasks; end-to-end business automation, from document input to business decision-making to human-machine collaboration, forming a complete closed loop.\n\n**agentic-doc-parse-and-extract** is the official open-source CLI tool of ADP, supporting both manual terminal invocation and automatic invocation via AI Skill. With a single command, it can accomplish: structured document parsing + intelligent extraction of key fields, covering all scenarios including invoices, orders, certificates, bills, and general documents, outputting standard JSON, and seamlessly integrating with automation and AI workflows.\n\n---\n\n## 💡 Core Features\n\nagentic-doc-parse-and-extract focuses on intelligent processing of the entire document workflow, taking into account both manual terminal calls and automatic calls by AI Agents. Its core functions cover all scenarios of parsing, extraction, and batch processing, requiring no complex configuration, and operations can be completed with a single command:\n\n| Function Name | Function Description | Optimal Scenario |\n|---------|------------------|----------|\n| **Document Parsing** | Automatically recognize multi-format documents such as PDFs and images, convert messy unstructured content (e.g., scanned documents, handwritten text, complex layout documents) into standardized Structured Data, while preserving the original document hierarchy and key relationships | Convert unstructured documents into Structured Data for LLM reading and subsequent extraction |\n| **Out Of The Box Document Extraction** | Based on the native AI capabilities of the ADP large model, it comes with built-in standardized extraction models for invoices, receipts, orders, commonly used certificates in China, etc. No need to configure rules or manual annotation, one-click extraction of key fields from various types of general documentation, outputting standard JSON | Account Payable automation, expense management, procurement automation, quick entry of card and certificate information into the system |\n| **Custom Document Extraction** | Supports independent creation, editing, and management of personalized extraction applications, allowing configuration of exclusive extraction fields and recognition logic for enterprise-specific documentation and industry-customized forms | Private extraction requirements for enterprise-specific documentation, industry-customized forms, and non-standardized documents |\n| **Task Query** | Supports asynchronous task submission and status query, enabling quick viewing of task execution progress, success/failure status, and final task processing results | Batch task processing, asynchronous document processing, problem troubleshooting, and processing record tracing |\n| **Application Management** | Provides comprehensive application management capabilities, allowing users to view all available extraction applications (system-built + custom), query application details, and manage application tags | Multi-scenario business switching, full lifecycle management of applications, and custom application management |\n\n## Install\n\n```bash\n# npm (recommended)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows (PowerShell)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download a prebuilt binary from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n## Configure\n\nGet an API key at [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=github) (new users get 100 free credits per month).\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp-global.laiye.com\nadp config get\n```\n\n## Quick Examples\n\n```bash\n# List available apps\nadp app-id list\n\n# Parse a local document\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# Extract key fields\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# Parse a directory in async mode\nadp parse local ./documents/ --app-id <app-id> --async\n\n# Process a remote URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# Query an async task\nadp parse query <task-id>\n\n# Two-phase async (submit + query separately, resumable)\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# Auto retry on failure (up to 2 retries)\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# Check remaining credits\nadp credit\n```\n\n## Commands\n\n> AI agents should call `adp schema` for the machine-readable, authoritative command spec. The table below is a human-friendly summary.\n\n| Command | Description |\n|---|---|\n| `adp version` | Print version |\n| `adp config set` | Set API key / base URL |\n| `adp config get` | Show current config |\n| `adp config clear` | Clear config |\n| `adp app-id list` | List available apps |\n| `adp app-id cache` | Read app list from local cache |\n| `adp parse local <path>` | Parse local file/directory |\n| `adp parse url <url>` | Parse remote file (URL list file supported) |\n| `adp parse base64 <data>` | Parse Base64-encoded content |\n| `adp parse query <task-id...>` | Query async parse tasks (supports multiple IDs or `--file`) |\n| `adp extract local <path>` | Extract from local file/directory |\n| `adp extract url <url>` | Extract from remote file |\n| `adp extract base64 <data>` | Extract from Base64-encoded content |\n| `adp extract query <task-id...>` | Query async extract tasks (supports multiple IDs or `--file`) |\n| `adp custom-app create` | Create a custom extraction app |\n| `adp custom-app update` | Update custom app config |\n| `adp custom-app get-config` | Show app config |\n| `adp custom-app delete` | Delete a custom app |\n| `adp custom-app delete-version` | Delete a specific config version |\n| `adp custom-app ai-generate` | AI-recommend extraction fields |\n| `adp credit` | Show remaining credits |\n| `adp schema` | Output command schema (for AI agents) |\n\n## Flags\n\n| Flag | Description |\n|---|---|\n| `--json` | Output JSON |\n| `--quiet` | Quiet mode, output result only |\n| `--lang <en\\|zh>` | Interface language |\n| `--app-id` | App ID (required for parse / extract) |\n| `--async` | Async mode |\n| `--no-wait` | Submit tasks only, do not wait for results (use with `--async`) |\n| `--export <path>` | Export result to file (single file) or directory (batch) |\n| `--timeout <seconds>` | Timeout (default 900s) |\n| `--concurrency <n>` | Concurrent workers (free: max 1, paid: max 2) |\n| `--retry <n>` | Retries for retryable errors (default 0) |\n| `--file <path>` | Read task IDs from JSON file (output of `--no-wait`, query only) |\n\n## Async Workflow\n\nFor large files or batch jobs, submit with `--async` and the CLI returns a `task-id`. Poll for results with `parse query` / `extract query`:\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# returns a task-id\n\nadp parse query <task-id>\n```\n\n### Two-Phase Async (`--no-wait`)\n\nBy default, `--async` submits and polls until completion — ideal for AI agents. For resumable workflows, use two-phase mode:\n\n**Phase 1: Submit tasks**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\nOutput is a JSON array with task IDs:\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**Phase 2: Query results**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\nEven if the CLI crashes mid-way, task IDs in `tasks.json` are preserved — resume anytime with `query --file`.\n\n## Batch Processing\n\nWhen processing multiple files/URLs, the CLI writes each result to a separate file:\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # Summary (total, success, failed, per-file status)\n├── invoice_01.pdf.json        # Successful result\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # Error details\n```\n\n- `--export <dir>` — specify output directory\n- Without `--export` — auto-creates `adp_results_<timestamp>/`\n- Single file — outputs to stdout or the `--export` file path\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | All success |\n| `1` | All failed / system error |\n| `2` | Parameter error |\n| `3` | Resource not found |\n| `4` | Permission denied |\n| `5` | Conflict |\n| `6` | Partial failure (some tasks failed in batch) |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `ADP_API_KEY` | API key (overrides config file) |\n| `ADP_API_BASE_URL` | Service URL |\n| `ADP_LANG` | Interface language (`en` / `zh`) |\n| `ADP_LOG_LEVEL` | Log level (`debug` / `info` / `warn` / `error`) |\n\n## Config Storage\n\n- Config dir: `~/.adp/`\n- Config file: `~/.adp/config.json`\n- Encrypted API key: `~/.adp/key.enc` (AES-256-GCM)\n- App cache: `~/.adp/app_cache.json`\n- Version check cache: `~/.adp/version_check.json` (refreshed every 24h)\n\n## 📜 License\n\nWe adopt a combined model of open-source tools + paid services: the CLI tool is completely free and open-source, making it easy for everyone to quickly integrate; while the core ADP intelligent parsing capability is a Public Cloud commercial service, billed based on actual usage, aiming to provide users with a highly accurate and stable document processing experience.\n\n- **CLI Tool**: Open source under the MIT License, freely available for use, modification, and distribution\n- **ADP Service**: AI document processing service based on Public Cloud, billed by usage, Billing Rules\n\nFree Quota: New users can receive **100 free credits** per month after registration, allowing them to experience full functionality\n\n## 📞 Support and Contact\n- **CLI Documentation**: [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)\n- **API Documentation**: [OpenAPI User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd?from=from_copylink)\n- **User Guide**: [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/OfexwgVUQiOpEek4kO7c7NEJnAe)\n- **Problem Feedback**: [GitHub Issues](https://github.com/laiye-ai/adp-cli/issues) | global_product@laiye.com\n- **Official Website**: [Laiye Technology](https://laiye.com/en/)\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn770b2vgq91s7c13mz7syttqh81xj81\",\n  \"slug\": \"adp-invoice-recognition-and-extract\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1779245968890\n}\n\nFile v1.0.2:license.md\n\nCommercial License Agreement\n\nEffective Date: [March 30, 2026]\nCopyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nThis “Skill” (referring to the entirety including models, software, code, weights, documentation, data, and related derivative works, “the Product”) is developed and wholly owned by Laiye Technology (Beijing) Co., Ltd. (“Licensor”). The mentioned derivative works refer to new works created by modifying, integrating, fine-tuning, or further developing the Product. Subject to your (“Licensee” or “you”) compliance with the terms of this Agreement, the Licensor grants you a worldwide, royalty-free, non-exclusive license.\n\n1. Licensing\n\n1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned \"non-commercial purposes\" include, but are not limited to:\nPersonal learning, research, teaching, and evaluation.\nTechnical exchanges within academic institutions or open-source communities, non-profit projects.\nIntegration or demonstration in non-commercial products or services.\n1.2 Commercial License:\tAny activity intended to directly or indirectly obtain commercial benefits, revenue, or consideration (“Commercial Exploitation”) requires the explicit written authorization (i.e., a \"Commercial License\") from the Licensor. Commercial Exploitation includes, but is not limited to:\nDistributing the Product or derivative works thereof in forms such as sales, resale, licensing fees, subscription fees, or other charges.\nProviding the Product or derivative works thereof as a SaaS (Software as a Service) to third parties.\nIntegrating the Product or derivative works thereof, as a core function, into software, hardware, or services intended for sale or lease.\nAny for-profit activity that utilizes the functionality or content of the Product to provide services to third parties.\n\n2. Reserved Rights and Ownership\n\n2.1\tOwnership, intellectual property rights (including but not limited to copyright, patents, trademarks, trade secrets), and other related rights and interests in the Product (including all copies thereof) belong to the Licensor or its affiliates. This Agreement does not constitute any form of transfer of rights or sale of the Licensor's intellectual property.\n2.2\tThe Licensee may non-commercially distribute unmodified copies of the Product through channels such as open-source platforms, or engage in non-commercial further development, and distribution, provided that this Agreement, the copyright notice, and the original identification are fully retained.\n3. Distribution Conditions\n\nWhen the Licensee distributes or provides the Product, all of the following conditions must be met:\nRetention of Notices:\tProminently retain all copyright notices of the Product, the text of this License Agreement, and the disclaimer on distributed copies.\nNo Misrepresentation:\tShould not imply that the Licensor endorses your distribution version.\n\n4. Disclaimer of Warranties\n\nTHE PRODUCT IS PROVIDED \"AS IS\", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO: THE LICENSOR DOES NOT WARRANT THAT THE PRODUCT IS FREE FROM ERRORS, BUGS, WILL OPERATE PROPERLY, OR IS SUITABLE FOR A PARTICULAR PURPOSE; THE LICENSOR DOES NOT WARRANT THAT USE OF THE PRODUCT WILL NOT INFRINGE UPON THIRD-PARTY RIGHTS; THE LICENSOR SHALL NOT BE LIABLE TO THE LICENSEE OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES ARISING FROM THE USE OF THE PRODUCT.\n\n5. Termination\n\n5.1\tThis Agreement becomes effective from the Licensee's first use of the Product and continues until terminated.\n5.2\tIf the Licensee violates the restrictions in Article 1 \"License Grant\" of this Agreement (e.g., unauthorized Commercial Exploitation), this Agreement will terminate automatically without prior notice.\n5.3\tUpon termination, the Licensee must immediately cease using the Product and destroy all copies of the Product in its possession.\n\n6. Miscellaneous\n\n6.1\tThe formation, execution, interpretation, and dispute resolution of this Agreement shall be governed by the laws of the People's Republic of China.\n6.2\tThe Licensee shall not assign or transfer any of its rights or obligations under this Agreement without the Licensor's prior written consent.\n6.3\tThis Agreement constitutes the entire agreement between the parties concerning this license matter and supersedes any prior oral or written communications and agreements between the parties regarding this matter.\n6.4\tAny dispute related to this Agreement shall be settled through friendly negotiation between the parties. If negotiation fails, either party has the right to submit the dispute to the competent court in the place where the Licensor is registered.\n\nFor obtaining a Commercial License or if you have any questions, please contact:\n[global_product@laiye.com]\n\n\nThe Product is licensed under the Commercial License Agreement.  For commercial use, please contact us to obtain authorization.\n\nFile v1.0.2:README-CN.md\n\n## 🚀 关于来也ADP\n\nADP是来也科技公司**智能体文档处理产品 (Agentic Document Processing，简称 ADP)**， 基于大模型的通用理解能力，不依赖规则与标注，具备对多语言、多模态、多场景的通用理解能力；智能体的自主规划与执行，能够理解任务目标、自主规划步骤、调用工具、完成复杂任务；端到端的业务自动化，从文档输入到业务决策再到人机协同，形成完整闭环。\n\n**agentic-doc-parse-and-extract** 是 ADP 官方开源 CLI 工具，同时支持人工终端调用 + AI Skill 自动调用。一条命令即可完成：文档结构化解析 + 关键字段智能抽取，覆盖发票、订单、证件、票据、通用文档全场景，输出标准 JSON，无缝对接自动化与 AI 流程。\n\n---\n\n## 💡 核心功能\n\nagentic-doc-parse-and-extract 聚焦文档全流程智能处理，兼顾人工终端调用与 AI Agent 自动调用，核心功能覆盖解析、抽取、批量处理全场景，无需复杂配置，一条命令即可完成操作：\n\n| 功能名称 | 功能描述 | 最佳场景 |\n|---------|------------------|----------|\n| **文档解析** | 自动识别 PDF、图片等多格式文档，将杂乱的非结构化内容（如扫描件、手写体、复杂排版文档）转化为标准化结构化数据，保留原始文档层级与关键关联关系 | 将非结构化文档转换为结构化数据，供 LLM 阅读和后续抽取使用 |\n| **开箱即用文档抽取** | 基于 ADP 大模型原生 AI 能力，内置发票、收据、订单、中国地区常用证件等标准化抽取模型，无需配置规则、无需人工标注，一键提取各类通用单据关键字段，输出标准 JSON | 应付账款自动化、费用管理、采购自动化、卡证信息快速录入系统 |\n| **自定义文档抽取** | 支持自主创建、编辑与管理个性化抽取应用，可针对企业专属单据、行业定制表单配置专属抽取字段与识别逻辑 | 企业专属单据、行业定制表单、非标准化文档的私有化抽取需求 |\n| **任务查询** | 支持异步任务提交与状态查询，可快速查看任务执行进度、成功/失败状态，以及任务最终处理结果 | 批量任务处理、异步文档处理、问题排查与处理记录追溯 |\n| **应用管理** | 提供完整的应用管理能力，可查看所有可用的抽取应用（系统内置 + 自定义）、查询应用详情、应用标签 | 多场景业务切换、应用全生命周期管控、自定义应用管理 |\n\n## 安装\n\n```bash\n# npm（推荐）\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows（PowerShell）\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\n或从 [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases) 下载预编译二进制。\n\n## 配置\n\n访问 [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=github) 注册并获取 API Key（新用户每月 100 免费积分）。\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n## 快速示例\n\n```bash\n# 查看可用应用\nadp app-id list\n\n# 解析本地文档\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# 抽取关键字段\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# 异步解析目录\nadp parse local ./documents/ --app-id <app-id> --async\n\n# 处理远程 URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# 查询异步任务\nadp parse query <task-id>\n\n# 两阶段异步（分开提交和查询，支持断点续传）\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# 失败自动重试（最多 2 次）\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# 查看剩余积分\nadp credit\n```\n\n## 命令\n\n> AI Agent 应调用 `adp schema` 获取机器可读的权威命令规格。下表仅供人类速查。\n\n| 命令 | 说明 |\n|---|---|\n| `adp version` | 显示版本号 |\n| `adp config set` | 设置 API Key / 服务地址 |\n| `adp config get` | 查看当前配置 |\n| `adp config clear` | 清除配置 |\n| `adp app-id list` | 列出可用应用 |\n| `adp app-id cache` | 从本地缓存读取应用列表 |\n| `adp parse local <path>` | 解析本地文件/目录 |\n| `adp parse url <url>` | 解析远程文件（支持 URL 列表文件） |\n| `adp parse base64 <data>` | 解析 Base64 编码内容 |\n| `adp parse query <task-id...>` | 查询异步解析任务（支持多个 ID 或 `--file`） |\n| `adp extract local <path>` | 抽取本地文件/目录 |\n| `adp extract url <url>` | 抽取远程文件 |\n| `adp extract base64 <data>` | 抽取 Base64 编码内容 |\n| `adp extract query <task-id...>` | 查询异步抽取任务（支持多个 ID 或 `--file`） |\n| `adp custom-app create` | 创建自定义抽取应用 |\n| `adp custom-app update` | 更新自定义应用配置 |\n| `adp custom-app get-config` | 查看应用配置 |\n| `adp custom-app delete` | 删除自定义应用 |\n| `adp custom-app delete-version` | 删除指定配置版本 |\n| `adp custom-app ai-generate` | AI 推荐抽取字段 |\n| `adp credit` | 查看剩余积分 |\n| `adp schema` | 输出命令 Schema（供 AI Agent 使用） |\n\n## 参数\n\n| 参数 | 说明 |\n|---|---|\n| `--json` | 以 JSON 格式输出 |\n| `--quiet` | 静默模式，仅输出结果 |\n| `--lang <en\\|zh>` | 指定界面语言 |\n| `--app-id` | 应用 ID（parse / extract 必填） |\n| `--async` | 异步模式 |\n| `--no-wait` | 仅提交任务，不等待结果（与 `--async` 配合使用） |\n| `--export <path>` | 导出结果到文件（单文件）或目录（批量） |\n| `--timeout <seconds>` | 超时时间（默认 900 秒） |\n| `--concurrency <n>` | 并发数（免费用户最大 1，付费用户最大 2） |\n| `--retry <n>` | 可重试错误的重试次数（默认 0） |\n| `--file <path>` | 从 JSON 文件读取任务 ID（`--no-wait` 的输出文件，仅 query 可用） |\n\n## 异步工作流\n\n处理大文件或批量任务时，使用 `--async` 提交任务，CLI 返回 `task-id`，再用 `parse query` / `extract query` 轮询结果：\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# 返回一个 task-id\n\nadp parse query <task-id>\n```\n\n### 两阶段异步（`--no-wait`）\n\n默认情况下，`--async` 会提交并轮询直到完成——适合 AI Agent 使用。对于可恢复的工作流，使用两阶段模式：\n\n**第一阶段：提交任务**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\n输出为包含任务 ID 的 JSON 数组：\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**第二阶段：查询结果**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\n即使 CLI 中途崩溃，`tasks.json` 中的任务 ID 也会被保留——随时可用 `query --file` 恢复查询。\n\n## 批量处理\n\n处理多个文件/URL 时，CLI 会将每个结果写入单独的文件：\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # 汇总（总数、成功、失败、每文件状态）\n├── invoice_01.pdf.json        # 成功结果\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # 错误详情\n```\n\n- `--export <dir>` — 指定输出目录\n- 不加 `--export` — 自动创建 `adp_results_<timestamp>/`\n- 单文件 — 输出到 stdout 或 `--export` 指定的文件路径\n\n## 退出码\n\n| 退出码 | 含义 |\n|------|---------|\n| `0` | 全部成功 |\n| `1` | 全部失败 / 系统错误 |\n| `2` | 参数错误 |\n| `3` | 资源未找到 |\n| `4` | 权限不足 |\n| `5` | 冲突 |\n| `6` | 部分失败（批量中部分任务失败） |\n\n## 环境变量\n\n| 变量 | 说明 |\n|---|---|\n| `ADP_API_KEY` | API Key（优先于配置文件） |\n| `ADP_API_BASE_URL` | 服务地址 |\n| `ADP_LANG` | 界面语言（`en` / `zh`） |\n| `ADP_LOG_LEVEL` | 日志级别（`debug` / `info` / `warn` / `error`） |\n\n## 配置存储\n\n- 配置目录：`~/.adp/`\n- 配置文件：`~/.adp/config.json`\n- 加密的 API Key：`~/.adp/key.enc`（AES-256-GCM）\n- 应用缓存：`~/.adp/app_cache.json`\n- 版本检查缓存：`~/.adp/version_check.json`（每 24 小时刷新）\n\n## 📜 授权许可\n\n我们采用 开源工具 + 付费服务 的组合模式：CLI 工具完全免费开源，方便大家快速接入；而核心的 ADP 智能解析能力为公有云商业服务，按实际使用量计费，旨在为用户提供高精准、高稳定的文档处理体验。\n\n- **CLI 工具**：MIT License 开源许可，可自由使用、修改和分发\n- **ADP 服务**：基于公有云的 AI 文档处理服务，按使用量计费，[计费规则](#credit)\n\n免费额度：新用户注册后每月可获得 **100 免费积分**，可体验完整功能\n\n\n## 📞 支持与联系\n- **CLI 使用指南：** [ADP CLI 使用指南](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)\n- **API 接口文档：** [Open API 使用指南](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)\n- **ADP 产品操作手册：** [公有云操作手册](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)\n- **问题反馈：** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)\n- **邮箱：** global_product@laiye.com\n- **官网：** [来也科技](https://laiye.com/product/adp-platform)\n\nFile v1.0.2:skill-card.md\n\n## Description:\n\nMulti-language, multi-currency invoice recognition and extraction that helps agents use Laiye ADP to extract invoice numbers, dates, supplier and buyer details, currency, tax, totals, and line items as structured JSON.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[laiye-adp](https://clawhub.ai/user/laiye-adp)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, finance teams, and developers use this skill to process invoices, receipts, bills, and vouchers through Laiye ADP and return normalized invoice fields for accounts payable automation, expense reimbursement, and cross-border trade workflows.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill recommends shell and PowerShell remote script installers.\n\nMitigation: Prefer npm installation or a pinned release artifact, and verify the package or binary before installation.\n\nRisk: Invoice and document contents are sent to Laiye ADP's cloud service.\n\nMitigation: Use the skill only with approved documents, confirm data handling requirements, and configure a least-privilege API key.\n\nRisk: The artifact describes broader ADP capabilities beyond invoice extraction, including batch processing, URL-list processing, and custom-app management.\n\nMitigation: Keep routine use scoped to invoice extraction and require explicit user approval before batch folders, URL-list processing, or custom-app management commands.\n\nRisk: License evidence is inconsistent between server metadata and artifact/license.md.\n\nMitigation: Confirm the authoritative license or commercial authorization terms before public release or commercial deployment.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/laiye-adp/skills/adp-invoice-recognition-and-extract)\n- [Laiye ADP Global Portal](https://adp-global.laiye.com/?utm_source=clawhub)\n- [Laiye ADP China Mainland Portal](https://adp.laiye.com/?utm_source=clawhub)\n- [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)\n- [OpenAPI User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd)\n- [ADP CLI GitHub Releases](https://github.com/laiye-ai/adp-cli/releases)\n\n## Skill Output:\n\n**Output Type(s):** [Shell commands, Configuration instructions, JSON, Guidance]\n\n**Output Format:** [Markdown guidance with shell commands and structured JSON extraction results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires ADP API credentials and sends invoice or document contents to Laiye ADP's cloud service.]\n\n## Skill Version(s):\n\n1.0.2 (source: server release metadata, created 2026-05-20)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.1: 5 files, 19420 bytes\n\nFiles: license.md (5156b), README-CN.md (9659b), README.md (10831b), SKILL.md (23112b), _meta.json (154b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: invoice-recognition-and-extract\ndescription: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items, outputting structured JSON. Zero-configuration, out-of-the-box, suitable for accounts payable automation, expense reimbursement, and cross-border trade document processing.\n---\n\n# Professional Invoice Recognition & Extraction Skill\n\nPowered by [Laiye ADP (Agentic Document Processing)](https://adp.laiye.com/?utm_source=clawhub), this skill delivers intelligent, high-precision parsing and information extraction for standard and non-standard invoices, bills, and vouchers from all regions worldwide. It supports all file types including electronic PDFs, scanned documents, and photographs, and outputs standardized structured JSON data for seamless integration with business processes and downstream automation.\n\n> New users receive **100 free credits per month** (refreshed monthly) for invoice extraction and other document processing scenarios. **Limited-Time Offer:** Use the invoice extraction feature for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users only, first come first served! ADP provides a standard commercial API that can be **integrated into business systems within 1 hour**.\n</br> Register now: [China Mainland](https://adp.laiye.com/?utm_source=clawhub) | [Global](https://adp-global.laiye.com/?utm_source=clawhub)\n\nWhy choose us?\n  - Global invoices with zero barriers — multi-language, multi-format precision recognition\n  - 100+ languages fully covered: English, Japanese, Korean, German, French, Thai, and all other major languages — invoices and receipts all supported\n  - Adaptive to all formats: standard VAT invoices, unstructured receipts, mixed-format bills — all recognized\n  - 95%+ accuracy: precise extraction of key fields, dramatically reducing manual verification, translation, and data entry costs\n  - Agentic self-optimization: continuously fine-tuned on your business data — the more you use it, the more accurate and tailored it becomes\n\n---\n\n## Quick Start Guide\n\n### Core Workflow\n\n1. **Install dependencies**: On first run, install the ADP CLI tool.\n2. **Authentication setup**: On first run, execute `adp config get` to check credentials. If not configured, prompt the user to provide an API Key.\n3. **Get app list**: On first run, retrieve the out-of-the-box app list via `adp app-id list --app-type 0`, find the invoice extraction app, and record its `app_id` (prefixed with `ootb_`). For subsequent runs, prefer `adp app-id cache`.\n4. **Execute extraction**: Run `adp extract url <URL> --app-id <invoice-app-id>` or `adp extract local <file-path> --app-id <invoice-app-id>`.\n5. **Process results**: Parse the returned JSON to extract structured fields such as invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items.\n6. **Error handling**: When a command fails, parse the stderr JSON to determine the error type and recovery action.\n\n### Scenario-to-Command Mapping\n\n**Single Invoice Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Recognize an invoice image/PDF (URL) | `adp extract url <URL> --app-id <ID>` |\n| Recognize a local invoice file | `adp extract local <file-path> --app-id <ID>` |\n| Recognize a Base64-encoded invoice | `adp extract base64 <base64> --app-id <ID> --file-name invoice.pdf` |\n\n**Batch Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Batch recognize invoices in a local folder | `adp extract local <folder-path> --app-id <ID>` |\n| Batch recognize multiple URLs | `adp extract url <URL-list-file> --app-id <ID>` |\n\n**Async Processing**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Submit a large file asynchronously | `adp extract url <URL> --app-id <ID> --async` |\n| Async batch processing | `adp extract local <folder-path> --app-id <ID> --async ` |\n| Query async task result | `adp extract query <task_id>` |\n\n> Concurrency Limit: Free users support a maximum of 2 documents for concurrent processing, while paid users support up to 10 documents concurrently.\n\n---\n\n## Step 1: Install ADP CLI\n\n```bash\n# Method 1: npm (recommended, cross-platform)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n```\n\n```bash\n# Method 2: Shell script (Linux / macOS, when npm is unavailable)\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n```\n\n```bash\n# Method 3: PowerShell script (Windows, when npm is unavailable)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download prebuilt binaries from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n\n## Step 2: Get API Key & Configure Authentication\n\nRegister and obtain an API Key (100 free credits per month + limited-time bonus: 1,000 free invoice extraction pages):\n- China Mainland, Hong Kong, Macau, and Taiwan: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n- All other regions: [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n---\n\n## Step 3: Get the Invoice Extraction App ID\n\nADP provides **out-of-the-box** built-in extraction apps for global invoices/receipts, supporting multiple languages and currencies with no additional configuration required.\n\n### App Types\n\nADP apps are divided into two categories, distinguished by the `app_type` field:\n\n| `app_type` | Type | Description |\n| --- | --- | --- |\n| `0` | Out-of-the-box (OOTB) | Platform built-in, `app_id` prefixed with `ootb_`, ready to use without creation |\n| `1` | Custom | User-created extraction apps with user-defined `app_id` |\n\nInvoice recognition is an **out-of-the-box app** and can be queried using `--app-type 0`.\n\n### Query and Filter Invoice Apps\n\n```bash\n# Query OOTB apps only (recommended)\nadp app-id list --app-type 0\n\n# Or query all apps\nadp app-id list\n```\n\nFind the app whose `app_label` contains **\"Invoice\"**, **\"Receipt\"**, or **\"Bill\"** in the returned list, and record its `app_id`:\n\n```json\n[\n  {\n      \"app_id\": \"ootb_*****c8d1\",\n      \"app_label\": [\n        \"Invoice\",\n        \"Receipt\",\n        \"Information Extraction\",\n        \"High accuracy\",\n        \"High-speed extraction\"\n      ],\n      \"app_name\": \"Invoice/Receipt\",\n      \"app_type\": 0\n    }\n]\n```\n\n> In the example above, `\"app_id\": \"ootb_*****c8d1\"` is the global invoice extraction app. `app_type` of `0` indicates an out-of-the-box app; `1` indicates a custom app.\n\n### Cache App ID (Recommended)\n\nAfter the initial query, prefer using cache for subsequent requests to avoid redundant API calls:\n\n```bash\n# Use cache for subsequent calls\nadp app-id cache\n```\n\n**Important**: Each account's `app_id` is unique and fixed — it will not change unless the user explicitly deletes the app. It is recommended that the Agent save the invoice app's `app_id` in context and reuse it directly in subsequent calls.\n\n---\n\n## Step 4: Execute Invoice Extraction\n\n### Single Invoice Extraction (URL)\n\n```bash\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Local File)\n\n```bash\nadp extract local ./invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Base64)\n\n```bash\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name invoice.pdf\n```\n\n### Response Example\n\nADP automatically supports invoice recognition in 100+ languages across all regions globally and automatically detects currencies. Extraction results are returned as unified structured JSON. The response contains two types of fields: **regular fields** and **table fields (line items)**.\n\n> The following example is a simplified format showing only core fields. The full response also includes `field_confidence` (confidence score) and `references` (source location) metadata — see \"Common Field Structure\" below for details.\n\n```json\n[\n  {\n    \"field_key\": \"invoice_number\",\n    \"field_name\": \"Invoice Number\",\n    \"field_values\": [\n      {\n        \"field_value\": \"INV-2026-003721\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"invoice_date\",\n    \"field_name\": \"Invoice Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-03-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"due_date\",\n    \"field_name\": \"Due Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-04-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"currency\",\n    \"field_name\": \"Currency\",\n    \"field_values\": [\n      {\n        \"field_value\": \"USD\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_name\",\n    \"field_name\": \"Supplier Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Acme Global Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_address\",\n    \"field_name\": \"Supplier Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1234 Commerce Blvd, Suite 500, San Francisco, CA 94105, USA\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_name\",\n    \"field_name\": \"Buyer Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Eastern International Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_address\",\n    \"field_name\": \"Buyer Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1000 Lujiazui Ring Road, Pudong New Area, Shanghai\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"subtotal\",\n    \"field_name\": \"Subtotal\",\n    \"field_values\": [\n      {\n        \"field_value\": \"8,500.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"tax_amount\",\n    \"field_name\": \"Tax Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"680.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"total_amount\",\n    \"field_name\": \"Total Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"9,180.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"line_items\",\n    \"field_name\": \"Line Items\",\n    \"field_confidence\": 0.98,\n    \"table_values\": [\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Industrial Sensor Module X200\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"50\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"120.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"6,000.00\"\n            }\n          ]\n        }\n      ],\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Connector Kit CK-50 (Pack of 100)\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"25\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"100.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"2,500.00\"\n            }\n          ]\n        }\n      ]\n    ]\n  }\n]\n```\n\n### Extraction Field Reference\n\n> **Note**: `field_name` is automatically localized based on document language (e.g., Chinese invoices return \"发票号码\", Japanese invoices return \"請求書番号\"). `field_key` is a stable machine identifier and should be preferred for programmatic processing. Different regions/types of invoices may return different field sets — the following lists all known fields.\n\n**Regular Fields:**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `invoice_number` | Invoice Number | Invoice number |\n| `invoice_date` | Invoice Date | Invoice date |\n| `due_date` | Due Date | Payment due date |\n| `currency` | Currency | Currency (e.g., USD, EUR, GBP, JPY, etc.) |\n| `supplier_name` | Supplier Name | Supplier / seller name |\n| `supplier_address` | Supplier Address | Supplier / seller address |\n| `supplier_vat_number` | Supplier VAT Number | Supplier tax ID (e.g., Japan T-prefixed registration number) |\n| `buyer_name` | Buyer Name | Buyer / purchaser name (some invoices use `customer_name`) |\n| `buyer_address` | Buyer Address | Buyer / purchaser address |\n| `customer_name` | Customer Name | Customer / buyer name (alternates with `buyer_name` depending on invoice type) |\n| `customer_vat_number` | Customer VAT Number | Customer tax ID; returns \"No result\" when not recognized |\n| `subtotal` | Subtotal | Subtotal amount (before tax; some invoices use `total_without_tax`) |\n| `total_without_tax` | Total (excl. tax) | Total excluding tax (alternates with `subtotal` depending on invoice type) |\n| `tax_amount` | Tax Amount | Tax amount |\n| `vat_rate` | VAT Rate | VAT rate (e.g., 10%, 13%) |\n| `total_amount` | Total Amount | Total amount (including tax) |\n| `amount_due` | Amount Due | Amount due (may equal `total_amount`) |\n\n**Table Fields (Line Items):**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `line_items` | Line Items | Line items table |\n| `line_items_item_code` | Item Code | Product / item code; returns \"No result\" when not recognized |\n| `line_items_description` | Description | Product / service description |\n| `line_items_quantity` | Quantity | Quantity |\n| `line_items_unit_price` | Unit Price | Unit price |\n| `line_items_amount` | Amount | Line amount (some invoices use `line_items_total_amount`) |\n| `line_items_total_amount` | Total Amount | Line total amount (alternates with `line_items_amount` depending on invoice type) |\n\n### Common Field Structure\n\nEach field object contains the following properties:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `field_key` | string | Field identifier (machine-readable) |\n| `field_name` | string | Field name (human-readable, localized based on document language) |\n| `field_values` | array | Extraction result array (present for regular fields) |\n| `field_values[].field_value` | string | Extracted value; empty string or \"No result\" when not recognized |\n| `field_values[].field_confidence` | number | Confidence score (0.0–1.0); 0.0 indicates not recognized / low confidence |\n| `field_values[].references` | array | Source location references (coordinates or text snippets) |\n| `field_confidence` | number | Overall confidence score (table-level for table fields) |\n| `table_values` | array[array] | Only present for table fields. 2D array: each row is a line item, each cell contains `field_name`, `field_key`, `field_values` |\n\n**How to distinguish field types:** If `table_values` is present → table field, read from `table_values`; otherwise → regular field, read from `field_values`.\n\n---\n\n## Step 5: Batch Processing & Async Mode\n\n### Batch Processing (Local Folder)\n\n```bash\nadp extract local ./invoices/ --app-id <invoice-app-id> --export ./results/ \n```\n\nResponse summary:\n```json\n{\n  \"total\": 10,\n  \"success\": 9,\n  \"failed\": 1,\n  \"output_dir\": \"/absolute/path/to/results\",\n  \"files\": [\n    {\n      \"input\": \"invoice-001.pdf\",\n      \"output\": \"invoice-001.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"invoice-002.pdf\",\n      \"output\": \"invoice-002.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"damaged.pdf\",\n      \"output\": \"damaged.pdf.error.json\",\n      \"status\": \"failed\",\n      \"error\": \"File is corrupted or unreadable\"\n    }\n  ]\n}\n```\n\n**Batch Response Summary Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `total` | number | Total number of files |\n| `success` | number | Number of successfully processed files |\n| `failed` | number | Number of failed files |\n| `output_dir` | string | Absolute path to the output directory |\n| `files` | array | Processing result list for each file |\n| `files[].input` | string | Input filename |\n| `files[].output` | string | Output result filename (`.json` on success, `.error.json` on failure) |\n| `files[].status` | string | Processing status: `\"success\"` or `\"failed\"` |\n| `files[].error` | string | Only present on failure; describes the failure reason |\n\n### Async Processing\n\n```bash\n# Submit async task\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id> --async\n\n# Query task result\nadp extract query <task_id>\n```\n\n---\n\n## Command Quick Reference\n\n```bash\n# Check installation\nadp version\n\n# View configuration\nadp config get\n\n# List all apps\nadp app-id list\n\n# List OOTB apps only (app_type=0)\nadp app-id list --app-type 0\n\n# Use cached apps\nadp app-id cache\n\n# Check credit balance\nadp credit\n\n# Invoice extraction (URL)\nadp extract url <file-URL> --app-id <invoice-app-id>\n\n# Invoice extraction (local file)\nadp extract local <file-path> --app-id <invoice-app-id>\n\n# Invoice extraction (Base64)\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name invoice.pdf\n\n# Batch extraction\nadp extract local <folder-path> --app-id <invoice-app-id> --export <output-path>\n\n# Async extraction\nadp extract url <file-URL> --app-id <invoice-app-id> --async\n\n# Query async result\nadp extract query <task_id>\n```\n\n---\n\n## Error Handling\n\nWhen a command fails, stderr outputs structured JSON:\n\n```json\n{\n  \"type\": \"AUTH_ERROR\",\n  \"message\": \"Authentication error: invalid API key\",\n  \"fix\": \"Check your API key is correct and has not expired.\",\n  \"retryable\": false,\n  \"details\": {\"context\": \"extract\"}\n}\n```\n\n**Error Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `type` | string | Error type identifier (e.g., `AUTH_ERROR`, `PARAM_ERROR`, `NOT_FOUND`, etc.) |\n| `message` | string | Error description |\n| `fix` | string | Suggested fix action |\n| `retryable` | boolean | Whether the operation can be retried (`true` = retryable, `false` = requires manual intervention) |\n| `details` | object | Error context information |\n\n### Exit Codes\n\n| Exit Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | General error |\n| 2 | Parameter error |\n| 3 | Resource not found |\n| 4 | Permission / authentication error |\n| 5 | Conflict |\n| 6 | Partial failure (some succeeded, some failed in batch processing) |\n\n---\n\n## Credits & Billing\n\n| Item | Description |\n| --- | --- |\n| Invoice/receipt extraction cost | **1.5 credits/page** |\n| Monthly free quota | **100 credits per month** (usable for invoice extraction and other document processing), resets at the beginning of each month |\n| Limited-time offer | Use invoice extraction for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users, first come first served |\n| Check balance | `adp credit` |\n| Top up | Log in to the ADP portal: [China Mainland, HK, Macau, Taiwan](https://adp.laiye.com/?utm_source=clawhub) \\| [All other regions](https://adp-global.laiye.com/?utm_source=clawhub) |\n\n---\n\n## More Laiye ADP Document Processing Capabilities\n\nGlobal invoice recognition is just one of many out-of-the-box capabilities offered by the Laiye ADP platform. Built on large model general understanding capabilities, ADP provides intelligent processing solutions covering all document categories:\n\n| Capability | Description | Typical Scenarios |\n| --- | --- | --- |\n| **Global Invoice/Receipt Extraction** | Automatically recognizes and extracts 10+ key fields including invoice number, date, amount, taxes, and line items; supports multi-language and multi-currency invoice extraction | Cross-border accounts payable automation, expense reimbursement management |\n| **China Domestic Bill Extraction** | Recognizes 30+ common bill types including VAT invoices, taxi receipts, train tickets, flight itineraries, fiscal invoices; supports multi-page/multi-bill recognition and verification | Domestic bill recognition, domestic invoice verification |\n| **Order Extraction** | Supports various purchase order formats; extracts order number, products, quantities, prices, logistics information, etc. | Procurement automation, supply chain integration |\n| **ID & Credential Extraction** | ADP supports 11 common Chinese credentials including ID cards, HK/Macau/Taiwan travel permits, Chinese passports, bank cards, household registers, driver's licenses, vehicle registration certificates, vehicle qualification certificates, account opening permits, and business licenses | Account opening review, compliance checks, batch credential data entry |\n| **Document Parsing** | Converts PDFs, images, and Office documents into structured data while preserving layout and hierarchical relationships | Long document analysis, contract review, knowledge extraction |\n| **Custom Extraction** | Create custom extraction apps with proprietary fields and recognition logic for non-standard documents | Enterprise-specific forms, industry-customized documents |\n\nAll capabilities above can be accessed through the same ADP CLI tool, sharing the ADP API Key and credit system.\n\nFor the full list of capabilities, visit:\n- ADP China Mainland: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n- ADP Global: [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n\n\n---\n\n## Important Notes\n\n1. **Data integrity**: When using ADP output, present the returned data as-is. Do not modify, add, or remove any fields during the extraction process.\n2. **API Key security**: Keep your API Key safe and do not share it with unauthorized third parties.\n3. **File size limit**: Maximum 50MB per file.\n4. **Supported formats**: .jpg, .jpeg, .png, .bmp, .tiff, .tif, .pdf, .doc, .docx, .xls, .xlsx\n5. **App ID reuse**: The invoice app's `app_id` is unique and fixed within an account. It is recommended to save it and reuse directly — no need to query every time.\n\n---\n\n## Support & Contact\n- **CLI User Guide:** [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)\n- **API Documentation:** [Open API User Guide](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)\n- **ADP Product Manual:** [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)\n- **Issue Reporting:** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)\n- **Email:** global_product@laiye.com\n- **Website:** [Laiye Technology](https://laiye.com/en/product/agentic-document-processing)\n\nCopyright 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nFile v1.0.1:README.md\n\n## 🚀 About Laiye ADP\n\nADP is Laiye's **intelligent agent document processing product (Agentic Document Processing, referred to as ADP)** , based on the general understanding ability of large models, without relying on rules and annotations, with the general understanding ability of multi-language, MultiModal Machine Learning, and multi-scene; autonomous planning and execution of intelligent agents, able to understand task goals, autonomous planning steps, invoke tools, and complete complex tasks; end-to-end business automation, from document input to business decision-making to human-machine collaboration, forming a complete closed loop.\n\n**agentic-doc-parse-and-extract** is the official open-source CLI tool of ADP, supporting both manual terminal invocation and automatic invocation via AI Skill. With a single command, it can accomplish: structured document parsing + intelligent extraction of key fields, covering all scenarios including invoices, orders, certificates, bills, and general documents, outputting standard JSON, and seamlessly integrating with automation and AI workflows.\n\n---\n\n## 💡 Core Features\n\nagentic-doc-parse-and-extract focuses on intelligent processing of the entire document workflow, taking into account both manual terminal calls and automatic calls by AI Agents. Its core functions cover all scenarios of parsing, extraction, and batch processing, requiring no complex configuration, and operations can be completed with a single command:\n\n| Function Name | Function Description | Optimal Scenario |\n|---------|------------------|----------|\n| **Document Parsing** | Automatically recognize multi-format documents such as PDFs and images, convert messy unstructured content (e.g., scanned documents, handwritten text, complex layout documents) into standardized Structured Data, while preserving the original document hierarchy and key relationships | Convert unstructured documents into Structured Data for LLM reading and subsequent extraction |\n| **Out Of The Box Document Extraction** | Based on the native AI capabilities of the ADP large model, it comes with built-in standardized extraction models for invoices, receipts, orders, commonly used certificates in China, etc. No need to configure rules or manual annotation, one-click extraction of key fields from various types of general documentation, outputting standard JSON | Account Payable automation, expense management, procurement automation, quick entry of card and certificate information into the system |\n| **Custom Document Extraction** | Supports independent creation, editing, and management of personalized extraction applications, allowing configuration of exclusive extraction fields and recognition logic for enterprise-specific documentation and industry-customized forms | Private extraction requirements for enterprise-specific documentation, industry-customized forms, and non-standardized documents |\n| **Task Query** | Supports asynchronous task submission and status query, enabling quick viewing of task execution progress, success/failure status, and final task processing results | Batch task processing, asynchronous document processing, problem troubleshooting, and processing record tracing |\n| **Application Management** | Provides comprehensive application management capabilities, allowing users to view all available extraction applications (system-built + custom), query application details, and manage application tags | Multi-scenario business switching, full lifecycle management of applications, and custom application management |\n\n## Install\n\n```bash\n# npm (recommended)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows (PowerShell)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download a prebuilt binary from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n## Configure\n\nGet an API key at [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=github) (new users get 100 free credits per month).\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp-global.laiye.com\nadp config get\n```\n\n## Quick Examples\n\n```bash\n# List available apps\nadp app-id list\n\n# Parse a local document\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# Extract key fields\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# Parse a directory in async mode\nadp parse local ./documents/ --app-id <app-id> --async\n\n# Process a remote URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# Query an async task\nadp parse query <task-id>\n\n# Two-phase async (submit + query separately, resumable)\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# Auto retry on failure (up to 2 retries)\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# Check remaining credits\nadp credit\n```\n\n## Commands\n\n> AI agents should call `adp schema` for the machine-readable, authoritative command spec. The table below is a human-friendly summary.\n\n| Command | Description |\n|---|---|\n| `adp version` | Print version |\n| `adp config set` | Set API key / base URL |\n| `adp config get` | Show current config |\n| `adp config clear` | Clear config |\n| `adp app-id list` | List available apps |\n| `adp app-id cache` | Read app list from local cache |\n| `adp parse local <path>` | Parse local file/directory |\n| `adp parse url <url>` | Parse remote file (URL list file supported) |\n| `adp parse base64 <data>` | Parse Base64-encoded content |\n| `adp parse query <task-id...>` | Query async parse tasks (supports multiple IDs or `--file`) |\n| `adp extract local <path>` | Extract from local file/directory |\n| `adp extract url <url>` | Extract from remote file |\n| `adp extract base64 <data>` | Extract from Base64-encoded content |\n| `adp extract query <task-id...>` | Query async extract tasks (supports multiple IDs or `--file`) |\n| `adp custom-app create` | Create a custom extraction app |\n| `adp custom-app update` | Update custom app config |\n| `adp custom-app get-config` | Show app config |\n| `adp custom-app delete` | Delete a custom app |\n| `adp custom-app delete-version` | Delete a specific config version |\n| `adp custom-app ai-generate` | AI-recommend extraction fields |\n| `adp credit` | Show remaining credits |\n| `adp schema` | Output command schema (for AI agents) |\n\n## Flags\n\n| Flag | Description |\n|---|---|\n| `--json` | Output JSON |\n| `--quiet` | Quiet mode, output result only |\n| `--lang <en\\|zh>` | Interface language |\n| `--app-id` | App ID (required for parse / extract) |\n| `--async` | Async mode |\n| `--no-wait` | Submit tasks only, do not wait for results (use with `--async`) |\n| `--export <path>` | Export result to file (single file) or directory (batch) |\n| `--timeout <seconds>` | Timeout (default 900s) |\n| `--concurrency <n>` | Concurrent workers (free: max 1, paid: max 2) |\n| `--retry <n>` | Retries for retryable errors (default 0) |\n| `--file <path>` | Read task IDs from JSON file (output of `--no-wait`, query only) |\n\n## Async Workflow\n\nFor large files or batch jobs, submit with `--async` and the CLI returns a `task-id`. Poll for results with `parse query` / `extract query`:\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# returns a task-id\n\nadp parse query <task-id>\n```\n\n### Two-Phase Async (`--no-wait`)\n\nBy default, `--async` submits and polls until completion — ideal for AI agents. For resumable workflows, use two-phase mode:\n\n**Phase 1: Submit tasks**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\nOutput is a JSON array with task IDs:\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**Phase 2: Query results**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\nEven if the CLI crashes mid-way, task IDs in `tasks.json` are preserved — resume anytime with `query --file`.\n\n## Batch Processing\n\nWhen processing multiple files/URLs, the CLI writes each result to a separate file:\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # Summary (total, success, failed, per-file status)\n├── invoice_01.pdf.json        # Successful result\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # Error details\n```\n\n- `--export <dir>` — specify output directory\n- Without `--export` — auto-creates `adp_results_<timestamp>/`\n- Single file — outputs to stdout or the `--export` file path\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | All success |\n| `1` | All failed / system error |\n| `2` | Parameter error |\n| `3` | Resource not found |\n| `4` | Permission denied |\n| `5` | Conflict |\n| `6` | Partial failure (some tasks failed in batch) |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `ADP_API_KEY` | API key (overrides config file) |\n| `ADP_API_BASE_URL` | Service URL |\n| `ADP_LANG` | Interface language (`en` / `zh`) |\n| `ADP_LOG_LEVEL` | Log level (`debug` / `info` / `warn` / `error`) |\n\n## Config Storage\n\n- Config dir: `~/.adp/`\n- Config file: `~/.adp/config.json`\n- Encrypted API key: `~/.adp/key.enc` (AES-256-GCM)\n- App cache: `~/.adp/app_cache.json`\n- Version check cache: `~/.adp/version_check.json` (refreshed every 24h)\n\n## 📜 License\n\nWe adopt a combined model of open-source tools + paid services: the CLI tool is completely free and open-source, making it easy for everyone to quickly integrate; while the core ADP intelligent parsing capability is a Public Cloud commercial service, billed based on actual usage, aiming to provide users with a highly accurate and stable document processing experience.\n\n- **CLI Tool**: Open source under the MIT License, freely available for use, modification, and distribution\n- **ADP Service**: AI document processing service based on Public Cloud, billed by usage, Billing Rules\n\nFree Quota: New users can receive **100 free credits** per month after registration, allowing them to experience full functionality\n\n## 📞 Support and Contact\n- **CLI Documentation**: [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)\n- **API Documentation**: [OpenAPI User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd?from=from_copylink)\n- **User Guide**: [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/OfexwgVUQiOpEek4kO7c7NEJnAe)\n- **Problem Feedback**: [GitHub Issues](https://github.com/laiye-ai/adp-cli/issues) | global_product@laiye.com\n- **Official Website**: [Laiye Technology](https://laiye.com/en/)\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn770b2vgq91s7c13mz7syttqh81xj81\",\n  \"slug\": \"adp-invoice-recognition-and-extract\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779197467955\n}\n\nFile v1.0.1:license.md\n\nCommercial License Agreement\n\nEffective Date: [March 30, 2026]\nCopyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nThis “Skill” (referring to the entirety including models, software, code, weights, documentation, data, and related derivative works, “the Product”) is developed and wholly owned by Laiye Technology (Beijing) Co., Ltd. (“Licensor”). The mentioned derivative works refer to new works created by modifying, integrating, fine-tuning, or further developing the Product. Subject to your (“Licensee” or “you”) compliance with the terms of this Agreement, the Licensor grants you a worldwide, royalty-free, non-exclusive license.\n\n1. Licensing\n\n1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned \"non-commercial purposes\" include, but are not limited to:\nPersonal learning, research, teaching, and evaluation.\nTechnical exchanges within academic institutions or open-source communities, non-profit projects.\nIntegration or demonstration in non-commercial products or services.\n1.2 Commercial License:\tAny activity intended to directly or indirectly obtain commercial benefits, revenue, or consideration (“Commercial Exploitation”) requires the explicit written authorization (i.e., a \"Commercial License\") from the Licensor. Commercial Exploitation includes, but is not limited to:\nDistributing the Product or derivative works thereof in forms such as sales, resale, licensing fees, subscription fees, or other charges.\nProviding the Product or derivative works thereof as a SaaS (Software as a Service) to third parties.\nIntegrating the Product or derivative works thereof, as a core function, into software, hardware, or services intended for sale or lease.\nAny for-profit activity that utilizes the functionality or content of the Product to provide services to third parties.\n\n2. Reserved Rights and Ownership\n\n2.1\tOwnership, intellectual property rights (including but not limited to copyright, patents, trademarks, trade secrets), and other related rights and interests in the Product (including all copies thereof) belong to the Licensor or its affiliates. This Agreement does not constitute any form of transfer of rights or sale of the Licensor's intellectual property.\n2.2\tThe Licensee may non-commercially distribute unmodified copies of the Product through channels such as open-source platforms, or engage in non-commercial further development, and distribution, provided that this Agreement, the copyright notice, and the original identification are fully retained.\n3. Distribution Conditions\n\nWhen the Licensee distributes or provides the Product, all of the following conditions must be met:\nRetention of Notices:\tProminently retain all copyright notices of the Product, the text of this License Agreement, and the disclaimer on distributed copies.\nNo Misrepresentation:\tShould not imply that the Licensor endorses your distribution version.\n\n4. Disclaimer of Warranties\n\nTHE PRODUCT IS PROVIDED \"AS IS\", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO: THE LICENSOR DOES NOT WARRANT THAT THE PRODUCT IS FREE FROM ERRORS, BUGS, WILL OPERATE PROPERLY, OR IS SUITABLE FOR A PARTICULAR PURPOSE; THE LICENSOR DOES NOT WARRANT THAT USE OF THE PRODUCT WILL NOT INFRINGE UPON THIRD-PARTY RIGHTS; THE LICENSOR SHALL NOT BE LIABLE TO THE LICENSEE OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES ARISING FROM THE USE OF THE PRODUCT.\n\n5. Termination\n\n5.1\tThis Agreement becomes effective from the Licensee's first use of the Product and continues until terminated.\n5.2\tIf the Licensee violates the restrictions in Article 1 \"License Grant\" of this Agreement (e.g., unauthorized Commercial Exploitation), this Agreement will terminate automatically without prior notice.\n5.3\tUpon termination, the Licensee must immediately cease using the Product and destroy all copies of the Product in its possession.\n\n6. Miscellaneous\n\n6.1\tThe formation, execution, interpretation, and dispute resolution of this Agreement shall be governed by the laws of the People's Republic of China.\n6.2\tThe Licensee shall not assign or transfer any of its rights or obligations under this Agreement without the Licensor's prior written consent.\n6.3\tThis Agreement constitutes the entire agreement between the parties concerning this license matter and supersedes any prior oral or written communications and agreements between the parties regarding this matter.\n6.4\tAny dispute related to this Agreement shall be settled through friendly negotiation between the parties. If negotiation fails, either party has the right to submit the dispute to the competent court in the place where the Licensor is registered.\n\nFor obtaining a Commercial License or if you have any questions, please contact:\n[global_product@laiye.com]\n\n\nThe Product is licensed under the Commercial License Agreement.  For commercial use, please contact us to obtain authorization.\n\nFile v1.0.1:README-CN.md\n\n## 🚀 关于来也ADP\n\nADP是来也科技公司**智能体文档处理产品 (Agentic Document Processing，简称 ADP)**， 基于大模型的通用理解能力，不依赖规则与标注，具备对多语言、多模态、多场景的通用理解能力；智能体的自主规划与执行，能够理解任务目标、自主规划步骤、调用工具、完成复杂任务；端到端的业务自动化，从文档输入到业务决策再到人机协同，形成完整闭环。\n\n**agentic-doc-parse-and-extract** 是 ADP 官方开源 CLI 工具，同时支持人工终端调用 + AI Skill 自动调用。一条命令即可完成：文档结构化解析 + 关键字段智能抽取，覆盖发票、订单、证件、票据、通用文档全场景，输出标准 JSON，无缝对接自动化与 AI 流程。\n\n---\n\n## 💡 核心功能\n\nagentic-doc-parse-and-extract 聚焦文档全流程智能处理，兼顾人工终端调用与 AI Agent 自动调用，核心功能覆盖解析、抽取、批量处理全场景，无需复杂配置，一条命令即可完成操作：\n\n| 功能名称 | 功能描述 | 最佳场景 |\n|---------|------------------|----------|\n| **文档解析** | 自动识别 PDF、图片等多格式文档，将杂乱的非结构化内容（如扫描件、手写体、复杂排版文档）转化为标准化结构化数据，保留原始文档层级与关键关联关系 | 将非结构化文档转换为结构化数据，供 LLM 阅读和后续抽取使用 |\n| **开箱即用文档抽取** | 基于 ADP 大模型原生 AI 能力，内置发票、收据、订单、中国地区常用证件等标准化抽取模型，无需配置规则、无需人工标注，一键提取各类通用单据关键字段，输出标准 JSON | 应付账款自动化、费用管理、采购自动化、卡证信息快速录入系统 |\n| **自定义文档抽取** | 支持自主创建、编辑与管理个性化抽取应用，可针对企业专属单据、行业定制表单配置专属抽取字段与识别逻辑 | 企业专属单据、行业定制表单、非标准化文档的私有化抽取需求 |\n| **任务查询** | 支持异步任务提交与状态查询，可快速查看任务执行进度、成功/失败状态，以及任务最终处理结果 | 批量任务处理、异步文档处理、问题排查与处理记录追溯 |\n| **应用管理** | 提供完整的应用管理能力，可查看所有可用的抽取应用（系统内置 + 自定义）、查询应用详情、应用标签 | 多场景业务切换、应用全生命周期管控、自定义应用管理 |\n\n## 安装\n\n```bash\n# npm（推荐）\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows（PowerShell）\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\n或从 [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases) 下载预编译二进制。\n\n## 配置\n\n访问 [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=github) 注册并获取 API Key（新用户每月 100 免费积分）。\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n## 快速示例\n\n```bash\n# 查看可用应用\nadp app-id list\n\n# 解析本地文档\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# 抽取关键字段\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# 异步解析目录\nadp parse local ./documents/ --app-id <app-id> --async\n\n# 处理远程 URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# 查询异步任务\nadp parse query <task-id>\n\n# 两阶段异步（分开提交和查询，支持断点续传）\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# 失败自动重试（最多 2 次）\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# 查看剩余积分\nadp credit\n```\n\n## 命令\n\n> AI Agent 应调用 `adp schema` 获取机器可读的权威命令规格。下表仅供人类速查。\n\n| 命令 | 说明 |\n|---|---|\n| `adp version` | 显示版本号 |\n| `adp config set` | 设置 API Key / 服务地址 |\n| `adp config get` | 查看当前配置 |\n| `adp config clear` | 清除配置 |\n| `adp app-id list` | 列出可用应用 |\n| `adp app-id cache` | 从本地缓存读取应用列表 |\n| `adp parse local <path>` | 解析本地文件/目录 |\n| `adp parse url <url>` | 解析远程文件（支持 URL 列表文件） |\n| `adp parse base64 <data>` | 解析 Base64 编码内容 |\n| `adp parse query <task-id...>` | 查询异步解析任务（支持多个 ID 或 `--file`） |\n| `adp extract local <path>` | 抽取本地文件/目录 |\n| `adp extract url <url>` | 抽取远程文件 |\n| `adp extract base64 <data>` | 抽取 Base64 编码内容 |\n| `adp extract query <task-id...>` | 查询异步抽取任务（支持多个 ID 或 `--file`） |\n| `adp custom-app create` | 创建自定义抽取应用 |\n| `adp custom-app update` | 更新自定义应用配置 |\n| `adp custom-app get-config` | 查看应用配置 |\n| `adp custom-app delete` | 删除自定义应用 |\n| `adp custom-app delete-version` | 删除指定配置版本 |\n| `adp custom-app ai-generate` | AI 推荐抽取字段 |\n| `adp credit` | 查看剩余积分 |\n| `adp schema` | 输出命令 Schema（供 AI Agent 使用） |\n\n## 参数\n\n| 参数 | 说明 |\n|---|---|\n| `--json` | 以 JSON 格式输出 |\n| `--quiet` | 静默模式，仅输出结果 |\n| `--lang <en\\|zh>` | 指定界面语言 |\n| `--app-id` | 应用 ID（parse / extract 必填） |\n| `--async` | 异步模式 |\n| `--no-wait` | 仅提交任务，不等待结果（与 `--async` 配合使用） |\n| `--export <path>` | 导出结果到文件（单文件）或目录（批量） |\n| `--timeout <seconds>` | 超时时间（默认 900 秒） |\n| `--concurrency <n>` | 并发数（免费用户最大 1，付费用户最大 2） |\n| `--retry <n>` | 可重试错误的重试次数（默认 0） |\n| `--file <path>` | 从 JSON 文件读取任务 ID（`--no-wait` 的输出文件，仅 query 可用） |\n\n## 异步工作流\n\n处理大文件或批量任务时，使用 `--async` 提交任务，CLI 返回 `task-id`，再用 `parse query` / `extract query` 轮询结果：\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# 返回一个 task-id\n\nadp parse query <task-id>\n```\n\n### 两阶段异步（`--no-wait`）\n\n默认情况下，`--async` 会提交并轮询直到完成——适合 AI Agent 使用。对于可恢复的工作流，使用两阶段模式：\n\n**第一阶段：提交任务**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\n输出为包含任务 ID 的 JSON 数组：\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**第二阶段：查询结果**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\n即使 CLI 中途崩溃，`tasks.json` 中的任务 ID 也会被保留——随时可用 `query --file` 恢复查询。\n\n## 批量处理\n\n处理多个文件/URL 时，CLI 会将每个结果写入单独的文件：\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # 汇总（总数、成功、失败、每文件状态）\n├── invoice_01.pdf.json        # 成功结果\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # 错误详情\n```\n\n- `--export <dir>` — 指定输出目录\n- 不加 `--export` — 自动创建 `adp_results_<timestamp>/`\n- 单文件 — 输出到 stdout 或 `--export` 指定的文件路径\n\n## 退出码\n\n| 退出码 | 含义 |\n|------|---------|\n| `0` | 全部成功 |\n| `1` | 全部失败 / 系统错误 |\n| `2` | 参数错误 |\n| `3` | 资源未找到 |\n| `4` | 权限不足 |\n| `5` | 冲突 |\n| `6` | 部分失败（批量中部分任务失败） |\n\n## 环境变量\n\n| 变量 | 说明 |\n|---|---|\n| `ADP_API_KEY` | API Key（优先于配置文件） |\n| `ADP_API_BASE_URL` | 服务地址 |\n| `ADP_LANG` | 界面语言（`en` / `zh`） |\n| `ADP_LOG_LEVEL` | 日志级别（`debug` / `info` / `warn` / `error`） |\n\n## 配置存储\n\n- 配置目录：`~/.adp/`\n- 配置文件：`~/.adp/config.json`\n- 加密的 API Key：`~/.adp/key.enc`（AES-256-GCM）\n- 应用缓存：`~/.adp/app_cache.json`\n- 版本检查缓存：`~/.adp/version_check.json`（每 24 小时刷新）\n\n## 📜 授权许可\n\n我们采用 开源工具 + 付费服务 的组合模式：CLI 工具完全免费开源，方便大家快速接入；而核心的 ADP 智能解析能力为公有云商业服务，按实际使用量计费，旨在为用户提供高精准、高稳定的文档处理体验。\n\n- **CLI 工具**：MIT License 开源许可，可自由使用、修改和分发\n- **ADP 服务**：基于公有云的 AI 文档处理服务，按使用量计费，[计费规则](#credit)\n\n免费额度：新用户注册后每月可获得 **100 免费积分**，可体验完整功能\n\n\n## 📞 支持与联系\n- **CLI 使用指南：** [ADP CLI 使用指南](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)\n- **API 接口文档：** [Open API 使用指南](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)\n- **ADP 产品操作手册：** [公有云操作手册](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)\n\n- **问题反馈：** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)\n- **邮箱：** global_product@laiye.com\n- **官网：** [来也科技](https://laiye.com)\n\nArchive v1.0.0: 5 files, 19353 bytes\n\nFiles: license.md (5156b), README-CN.md (9659b), README.md (10831b), SKILL.md (22943b), _meta.json (154b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: invoice-recognition-and-extract\ndescription: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items, outputting structured JSON. Zero-configuration, out-of-the-box, suitable for accounts payable automation, expense reimbursement, and cross-border trade document processing.\n---\n\n# Professional Invoice Recognition & Extraction Skill\n\nPowered by [Laiye ADP (Agentic Document Processing)](https://adp.laiye.com/?utm_source=clawhub), this skill delivers intelligent, high-precision parsing and information extraction for standard and non-standard invoices, bills, and vouchers from all regions worldwide. It supports all file types including electronic PDFs, scanned documents, and photographs, and outputs standardized structured JSON data for seamless integration with business processes and downstream automation.\n\n> New users receive **100 free credits per month** (refreshed monthly) for invoice extraction and other document processing scenarios. **Limited-Time Offer:** Use the invoice extraction feature for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users only, first come first served! ADP provides a standard commercial API that can be **integrated into business systems within 1 hour**.\n</br> Register now: [China Mainland](https://adp.laiye.com/?utm_source=clawhub) | [Global](https://adp-global.laiye.com/?utm_source=clawhub)\n\nWhy choose us?\n  - Global invoices with zero barriers — multi-language, multi-format precision recognition\n  - 100+ languages fully covered: English, Japanese, Korean, German, French, Thai, and all other major languages — invoices and receipts all supported\n  - Adaptive to all formats: standard VAT invoices, unstructured receipts, mixed-format bills — all recognized\n  - 95%+ accuracy: precise extraction of key fields, dramatically reducing manual verification, translation, and data entry costs\n  - Agentic self-optimization: continuously fine-tuned on your business data — the more you use it, the more accurate and tailored it becomes\n\n---\n\n## Quick Start Guide\n\n### Core Workflow\n\n1. **Install dependencies**: On first run, install the ADP CLI tool.\n2. **Authentication setup**: On first run, execute `adp config get` to check credentials. If not configured, prompt the user to provide an API Key.\n3. **Get app list**: On first run, retrieve the out-of-the-box app list via `adp app-id list --app-type 0`, find the invoice extraction app, and record its `app_id` (prefixed with `ootb_`). For subsequent runs, prefer `adp app-id cache`.\n4. **Execute extraction**: Run `adp extract url <URL> --app-id <invoice-app-id>` or `adp extract local <file-path> --app-id <invoice-app-id>`.\n5. **Process results**: Parse the returned JSON to extract structured fields such as invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items.\n6. **Error handling**: When a command fails, parse the stderr JSON to determine the error type and recovery action.\n\n### Scenario-to-Command Mapping\n\n**Single Invoice Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Recognize an invoice image/PDF (URL) | `adp extract url <URL> --app-id <ID>` |\n| Recognize a local invoice file | `adp extract local <file-path> --app-id <ID>` |\n| Recognize a Base64-encoded invoice | `adp extract base64 <base64> --app-id <ID> --file-name invoice.pdf` |\n\n**Batch Recognition**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Batch recognize invoices in a local folder | `adp extract local <folder-path> --app-id <ID>` |\n| Batch recognize multiple URLs | `adp extract url <URL-list-file> --app-id <ID>` |\n\n**Async Processing**\n\n| User Intent | Recommended Command |\n| :--- | :--- |\n| Submit a large file asynchronously | `adp extract url <URL> --app-id <ID> --async` |\n| Async batch processing | `adp extract local <folder-path> --app-id <ID> --async ` |\n| Query async task result | `adp extract query <task_id>` |\n\n---\n\n## Step 1: Install ADP CLI\n\n```bash\n# Method 1: npm (recommended, cross-platform)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n```\n\n```bash\n# Method 2: Shell script (Linux / macOS, when npm is unavailable)\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n```\n\n```bash\n# Method 3: PowerShell script (Windows, when npm is unavailable)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download prebuilt binaries from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n\n## Step 2: Get API Key & Configure Authentication\n\nRegister and obtain an API Key (100 free credits per month + limited-time bonus: 1,000 free invoice extraction pages):\n- China Mainland, Hong Kong, Macau, and Taiwan: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n- All other regions: [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n---\n\n## Step 3: Get the Invoice Extraction App ID\n\nADP provides **out-of-the-box** built-in extraction apps for global invoices/receipts, supporting multiple languages and currencies with no additional configuration required.\n\n### App Types\n\nADP apps are divided into two categories, distinguished by the `app_type` field:\n\n| `app_type` | Type | Description |\n| --- | --- | --- |\n| `0` | Out-of-the-box (OOTB) | Platform built-in, `app_id` prefixed with `ootb_`, ready to use without creation |\n| `1` | Custom | User-created extraction apps with user-defined `app_id` |\n\nInvoice recognition is an **out-of-the-box app** and can be queried using `--app-type 0`.\n\n### Query and Filter Invoice Apps\n\n```bash\n# Query OOTB apps only (recommended)\nadp app-id list --app-type 0\n\n# Or query all apps\nadp app-id list\n```\n\nFind the app whose `app_label` contains **\"Invoice\"**, **\"Receipt\"**, or **\"Bill\"** in the returned list, and record its `app_id`:\n\n```json\n[\n  {\n      \"app_id\": \"ootb_*****c8d1\",\n      \"app_label\": [\n        \"Invoice\",\n        \"Receipt\",\n        \"Information Extraction\",\n        \"High accuracy\",\n        \"High-speed extraction\"\n      ],\n      \"app_name\": \"Invoice/Receipt\",\n      \"app_type\": 0\n    }\n]\n```\n\n> In the example above, `\"app_id\": \"ootb_*****c8d1\"` is the global invoice extraction app. `app_type` of `0` indicates an out-of-the-box app; `1` indicates a custom app.\n\n### Cache App ID (Recommended)\n\nAfter the initial query, prefer using cache for subsequent requests to avoid redundant API calls:\n\n```bash\n# Use cache for subsequent calls\nadp app-id cache\n```\n\n**Important**: Each account's `app_id` is unique and fixed — it will not change unless the user explicitly deletes the app. It is recommended that the Agent save the invoice app's `app_id` in context and reuse it directly in subsequent calls.\n\n---\n\n## Step 4: Execute Invoice Extraction\n\n### Single Invoice Extraction (URL)\n\n```bash\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Local File)\n\n```bash\nadp extract local ./invoice.pdf --app-id <invoice-app-id>\n```\n\n### Single Invoice Extraction (Base64)\n\n```bash\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name invoice.pdf\n```\n\n### Response Example\n\nADP automatically supports invoice recognition in 100+ languages across all regions globally and automatically detects currencies. Extraction results are returned as unified structured JSON. The response contains two types of fields: **regular fields** and **table fields (line items)**.\n\n> The following example is a simplified format showing only core fields. The full response also includes `field_confidence` (confidence score) and `references` (source location) metadata — see \"Common Field Structure\" below for details.\n\n```json\n[\n  {\n    \"field_key\": \"invoice_number\",\n    \"field_name\": \"Invoice Number\",\n    \"field_values\": [\n      {\n        \"field_value\": \"INV-2026-003721\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"invoice_date\",\n    \"field_name\": \"Invoice Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-03-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"due_date\",\n    \"field_name\": \"Due Date\",\n    \"field_values\": [\n      {\n        \"field_value\": \"2026-04-15\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"currency\",\n    \"field_name\": \"Currency\",\n    \"field_values\": [\n      {\n        \"field_value\": \"USD\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_name\",\n    \"field_name\": \"Supplier Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Acme Global Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"supplier_address\",\n    \"field_name\": \"Supplier Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1234 Commerce Blvd, Suite 500, San Francisco, CA 94105, USA\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_name\",\n    \"field_name\": \"Buyer Name\",\n    \"field_values\": [\n      {\n        \"field_value\": \"Eastern International Trading Co., Ltd.\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"buyer_address\",\n    \"field_name\": \"Buyer Address\",\n    \"field_values\": [\n      {\n        \"field_value\": \"1000 Lujiazui Ring Road, Pudong New Area, Shanghai\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"subtotal\",\n    \"field_name\": \"Subtotal\",\n    \"field_values\": [\n      {\n        \"field_value\": \"8,500.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"tax_amount\",\n    \"field_name\": \"Tax Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"680.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"total_amount\",\n    \"field_name\": \"Total Amount\",\n    \"field_values\": [\n      {\n        \"field_value\": \"9,180.00\"\n      }\n    ]\n  },\n  {\n    \"field_key\": \"line_items\",\n    \"field_name\": \"Line Items\",\n    \"field_confidence\": 0.98,\n    \"table_values\": [\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Industrial Sensor Module X200\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"50\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"120.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"6,000.00\"\n            }\n          ]\n        }\n      ],\n      [\n        {\n          \"field_name\": \"Description\",\n          \"field_key\": \"line_items_description\",\n          \"field_values\": [\n            {\n              \"field_value\": \"Connector Kit CK-50 (Pack of 100)\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Quantity\",\n          \"field_key\": \"line_items_quantity\",\n          \"field_values\": [\n            {\n              \"field_value\": \"25\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Unit Price\",\n          \"field_key\": \"line_items_unit_price\",\n          \"field_values\": [\n            {\n              \"field_value\": \"100.00\"\n            }\n          ]\n        },\n        {\n          \"field_name\": \"Amount\",\n          \"field_key\": \"line_items_amount\",\n          \"field_values\": [\n            {\n              \"field_value\": \"2,500.00\"\n            }\n          ]\n        }\n      ]\n    ]\n  }\n]\n```\n\n### Extraction Field Reference\n\n> **Note**: `field_name` is automatically localized based on document language (e.g., Chinese invoices return \"发票号码\", Japanese invoices return \"請求書番号\"). `field_key` is a stable machine identifier and should be preferred for programmatic processing. Different regions/types of invoices may return different field sets — the following lists all known fields.\n\n**Regular Fields:**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `invoice_number` | Invoice Number | Invoice number |\n| `invoice_date` | Invoice Date | Invoice date |\n| `due_date` | Due Date | Payment due date |\n| `currency` | Currency | Currency (e.g., USD, EUR, GBP, JPY, etc.) |\n| `supplier_name` | Supplier Name | Supplier / seller name |\n| `supplier_address` | Supplier Address | Supplier / seller address |\n| `supplier_vat_number` | Supplier VAT Number | Supplier tax ID (e.g., Japan T-prefixed registration number) |\n| `buyer_name` | Buyer Name | Buyer / purchaser name (some invoices use `customer_name`) |\n| `buyer_address` | Buyer Address | Buyer / purchaser address |\n| `customer_name` | Customer Name | Customer / buyer name (alternates with `buyer_name` depending on invoice type) |\n| `customer_vat_number` | Customer VAT Number | Customer tax ID; returns \"No result\" when not recognized |\n| `subtotal` | Subtotal | Subtotal amount (before tax; some invoices use `total_without_tax`) |\n| `total_without_tax` | Total (excl. tax) | Total excluding tax (alternates with `subtotal` depending on invoice type) |\n| `tax_amount` | Tax Amount | Tax amount |\n| `vat_rate` | VAT Rate | VAT rate (e.g., 10%, 13%) |\n| `total_amount` | Total Amount | Total amount (including tax) |\n| `amount_due` | Amount Due | Amount due (may equal `total_amount`) |\n\n**Table Fields (Line Items):**\n\n| field_key | field_name (example) | Description |\n| --- | --- | --- |\n| `line_items` | Line Items | Line items table |\n| `line_items_item_code` | Item Code | Product / item code; returns \"No result\" when not recognized |\n| `line_items_description` | Description | Product / service description |\n| `line_items_quantity` | Quantity | Quantity |\n| `line_items_unit_price` | Unit Price | Unit price |\n| `line_items_amount` | Amount | Line amount (some invoices use `line_items_total_amount`) |\n| `line_items_total_amount` | Total Amount | Line total amount (alternates with `line_items_amount` depending on invoice type) |\n\n### Common Field Structure\n\nEach field object contains the following properties:\n\n| Property | Type | Description |\n| --- | --- | --- |\n| `field_key` | string | Field identifier (machine-readable) |\n| `field_name` | string | Field name (human-readable, localized based on document language) |\n| `field_values` | array | Extraction result array (present for regular fields) |\n| `field_values[].field_value` | string | Extracted value; empty string or \"No result\" when not recognized |\n| `field_values[].field_confidence` | number | Confidence score (0.0–1.0); 0.0 indicates not recognized / low confidence |\n| `field_values[].references` | array | Source location references (coordinates or text snippets) |\n| `field_confidence` | number | Overall confidence score (table-level for table fields) |\n| `table_values` | array[array] | Only present for table fields. 2D array: each row is a line item, each cell contains `field_name`, `field_key`, `field_values` |\n\n**How to distinguish field types:** If `table_values` is present → table field, read from `table_values`; otherwise → regular field, read from `field_values`.\n\n---\n\n## Step 5: Batch Processing & Async Mode\n\n### Batch Processing (Local Folder)\n\n```bash\nadp extract local ./invoices/ --app-id <invoice-app-id> --export ./results/ \n```\n\nResponse summary:\n```json\n{\n  \"total\": 10,\n  \"success\": 9,\n  \"failed\": 1,\n  \"output_dir\": \"/absolute/path/to/results\",\n  \"files\": [\n    {\n      \"input\": \"invoice-001.pdf\",\n      \"output\": \"invoice-001.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"invoice-002.pdf\",\n      \"output\": \"invoice-002.pdf.json\",\n      \"status\": \"success\"\n    },\n    {\n      \"input\": \"damaged.pdf\",\n      \"output\": \"damaged.pdf.error.json\",\n      \"status\": \"failed\",\n      \"error\": \"File is corrupted or unreadable\"\n    }\n  ]\n}\n```\n\n**Batch Response Summary Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `total` | number | Total number of files |\n| `success` | number | Number of successfully processed files |\n| `failed` | number | Number of failed files |\n| `output_dir` | string | Absolute path to the output directory |\n| `files` | array | Processing result list for each file |\n| `files[].input` | string | Input filename |\n| `files[].output` | string | Output result filename (`.json` on success, `.error.json` on failure) |\n| `files[].status` | string | Processing status: `\"success\"` or `\"failed\"` |\n| `files[].error` | string | Only present on failure; describes the failure reason |\n\n### Async Processing\n\n```bash\n# Submit async task\nadp extract url https://example.com/invoice.pdf --app-id <invoice-app-id> --async\n\n# Query task result\nadp extract query <task_id>\n```\n\n---\n\n## Command Quick Reference\n\n```bash\n# Check installation\nadp version\n\n# View configuration\nadp config get\n\n# List all apps\nadp app-id list\n\n# List OOTB apps only (app_type=0)\nadp app-id list --app-type 0\n\n# Use cached apps\nadp app-id cache\n\n# Check credit balance\nadp credit\n\n# Invoice extraction (URL)\nadp extract url <file-URL> --app-id <invoice-app-id>\n\n# Invoice extraction (local file)\nadp extract local <file-path> --app-id <invoice-app-id>\n\n# Invoice extraction (Base64)\nadp extract base64 <base64-string> --app-id <invoice-app-id> --file-name invoice.pdf\n\n# Batch extraction\nadp extract local <folder-path> --app-id <invoice-app-id> --export <output-path>\n\n# Async extraction\nadp extract url <file-URL> --app-id <invoice-app-id> --async\n\n# Query async result\nadp extract query <task_id>\n```\n\n---\n\n## Error Handling\n\nWhen a command fails, stderr outputs structured JSON:\n\n```json\n{\n  \"type\": \"AUTH_ERROR\",\n  \"message\": \"Authentication error: invalid API key\",\n  \"fix\": \"Check your API key is correct and has not expired.\",\n  \"retryable\": false,\n  \"details\": {\"context\": \"extract\"}\n}\n```\n\n**Error Response Fields:**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `type` | string | Error type identifier (e.g., `AUTH_ERROR`, `PARAM_ERROR`, `NOT_FOUND`, etc.) |\n| `message` | string | Error description |\n| `fix` | string | Suggested fix action |\n| `retryable` | boolean | Whether the operation can be retried (`true` = retryable, `false` = requires manual intervention) |\n| `details` | object | Error context information |\n\n### Exit Codes\n\n| Exit Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | General error |\n| 2 | Parameter error |\n| 3 | Resource not found |\n| 4 | Permission / authentication error |\n| 5 | Conflict |\n| 6 | Partial failure (some succeeded, some failed in batch processing) |\n\n---\n\n## Credits & Billing\n\n| Item | Description |\n| --- | --- |\n| Invoice/receipt extraction cost | **1.5 credits/page** |\n| Monthly free quota | **100 credits per month** (usable for invoice extraction and other document processing), resets at the beginning of each month |\n| Limited-time offer | Use invoice extraction for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users, first come first served |\n| Check balance | `adp credit` |\n| Top up | Log in to the ADP portal: [China Mainland, HK, Macau, Taiwan](https://adp.laiye.com/?utm_source=clawhub) \\| [All other regions](https://adp-global.laiye.com/?utm_source=clawhub) |\n\n---\n\n## More Laiye ADP Document Processing Capabilities\n\nGlobal invoice recognition is just one of many out-of-the-box capabilities offered by the Laiye ADP platform. Built on large model general understanding capabilities, ADP provides intelligent processing solutions covering all document categories:\n\n| Capability | Description | Typical Scenarios |\n| --- | --- | --- |\n| **Global Invoice/Receipt Extraction** | Automatically recognizes and extracts 10+ key fields including invoice number, date, amount, taxes, and line items; supports multi-language and multi-currency invoice extraction | Cross-border accounts payable automation, expense reimbursement management |\n| **China Domestic Bill Extraction** | Recognizes 30+ common bill types including VAT invoices, taxi receipts, train tickets, flight itineraries, fiscal invoices; supports multi-page/multi-bill recognition and verification | Domestic bill recognition, domestic invoice verification |\n| **Order Extraction** | Supports various purchase order formats; extracts order number, products, quantities, prices, logistics information, etc. | Procurement automation, supply chain integration |\n| **ID & Credential Extraction** | ADP supports 11 common Chinese credentials including ID cards, HK/Macau/Taiwan travel permits, Chinese passports, bank cards, household registers, driver's licenses, vehicle registration certificates, vehicle qualification certificates, account opening permits, and business licenses | Account opening review, compliance checks, batch credential data entry |\n| **Document Parsing** | Converts PDFs, images, and Office documents into structured data while preserving layout and hierarchical relationships | Long document analysis, contract review, knowledge extraction |\n| **Custom Extraction** | Create custom extraction apps with proprietary fields and recognition logic for non-standard documents | Enterprise-specific forms, industry-customized documents |\n\nAll capabilities above can be accessed through the same ADP CLI tool, sharing the ADP API Key and credit system.\n\nFor the full list of capabilities, visit:\n- ADP China Mainland: [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=clawhub)\n- ADP Global: [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=clawhub)\n\n\n---\n\n## Important Notes\n\n1. **Data integrity**: When using ADP output, present the returned data as-is. Do not modify, add, or remove any fields during the extraction process.\n2. **API Key security**: Keep your API Key safe and do not share it with unauthorized third parties.\n3. **File size limit**: Maximum 50MB per file.\n4. **Supported formats**: .jpg, .jpeg, .png, .bmp, .tiff, .tif, .pdf, .doc, .docx, .xls, .xlsx\n5. **App ID reuse**: The invoice app's `app_id` is unique and fixed within an account. It is recommended to save it and reuse directly — no need to query every time.\n\n---\n\n## Support & Contact\n- **CLI User Guide:** [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)\n- **API Documentation:** [Open API User Guide](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)\n- **ADP Product Manual:** [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)\n- **Issue Reporting:** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)\n- **Email:** global_product@laiye.com\n- **Website:** [Laiye Technology](https://laiye.com/product/adp-platform)\n\nCopyright 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nFile v1.0.0:README.md\n\n## 🚀 About Laiye ADP\n\nADP is Laiye's **intelligent agent document processing product (Agentic Document Processing, referred to as ADP)** , based on the general understanding ability of large models, without relying on rules and annotations, with the general understanding ability of multi-language, MultiModal Machine Learning, and multi-scene; autonomous planning and execution of intelligent agents, able to understand task goals, autonomous planning steps, invoke tools, and complete complex tasks; end-to-end business automation, from document input to business decision-making to human-machine collaboration, forming a complete closed loop.\n\n**agentic-doc-parse-and-extract** is the official open-source CLI tool of ADP, supporting both manual terminal invocation and automatic invocation via AI Skill. With a single command, it can accomplish: structured document parsing + intelligent extraction of key fields, covering all scenarios including invoices, orders, certificates, bills, and general documents, outputting standard JSON, and seamlessly integrating with automation and AI workflows.\n\n---\n\n## 💡 Core Features\n\nagentic-doc-parse-and-extract focuses on intelligent processing of the entire document workflow, taking into account both manual terminal calls and automatic calls by AI Agents. Its core functions cover all scenarios of parsing, extraction, and batch processing, requiring no complex configuration, and operations can be completed with a single command:\n\n| Function Name | Function Description | Optimal Scenario |\n|---------|------------------|----------|\n| **Document Parsing** | Automatically recognize multi-format documents such as PDFs and images, convert messy unstructured content (e.g., scanned documents, handwritten text, complex layout documents) into standardized Structured Data, while preserving the original document hierarchy and key relationships | Convert unstructured documents into Structured Data for LLM reading and subsequent extraction |\n| **Out Of The Box Document Extraction** | Based on the native AI capabilities of the ADP large model, it comes with built-in standardized extraction models for invoices, receipts, orders, commonly used certificates in China, etc. No need to configure rules or manual annotation, one-click extraction of key fields from various types of general documentation, outputting standard JSON | Account Payable automation, expense management, procurement automation, quick entry of card and certificate information into the system |\n| **Custom Document Extraction** | Supports independent creation, editing, and management of personalized extraction applications, allowing configuration of exclusive extraction fields and recognition logic for enterprise-specific documentation and industry-customized forms | Private extraction requirements for enterprise-specific documentation, industry-customized forms, and non-standardized documents |\n| **Task Query** | Supports asynchronous task submission and status query, enabling quick viewing of task execution progress, success/failure status, and final task processing results | Batch task processing, asynchronous document processing, problem troubleshooting, and processing record tracing |\n| **Application Management** | Provides comprehensive application management capabilities, allowing users to view all available extraction applications (system-built + custom), query application details, and manage application tags | Multi-scenario business switching, full lifecycle management of applications, and custom application management |\n\n## Install\n\n```bash\n# npm (recommended)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows (PowerShell)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\nOr download a prebuilt binary from [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases).\n\n## Configure\n\nGet an API key at [https://adp-global.laiye.com/](https://adp-global.laiye.com/?utm_source=github) (new users get 100 free credits per month).\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp-global.laiye.com\nadp config get\n```\n\n## Quick Examples\n\n```bash\n# List available apps\nadp app-id list\n\n# Parse a local document\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# Extract key fields\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# Parse a directory in async mode\nadp parse local ./documents/ --app-id <app-id> --async\n\n# Process a remote URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# Query an async task\nadp parse query <task-id>\n\n# Two-phase async (submit + query separately, resumable)\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# Auto retry on failure (up to 2 retries)\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# Check remaining credits\nadp credit\n```\n\n## Commands\n\n> AI agents should call `adp schema` for the machine-readable, authoritative command spec. The table below is a human-friendly summary.\n\n| Command | Description |\n|---|---|\n| `adp version` | Print version |\n| `adp config set` | Set API key / base URL |\n| `adp config get` | Show current config |\n| `adp config clear` | Clear config |\n| `adp app-id list` | List available apps |\n| `adp app-id cache` | Read app list from local cache |\n| `adp parse local <path>` | Parse local file/directory |\n| `adp parse url <url>` | Parse remote file (URL list file supported) |\n| `adp parse base64 <data>` | Parse Base64-encoded content |\n| `adp parse query <task-id...>` | Query async parse tasks (supports multiple IDs or `--file`) |\n| `adp extract local <path>` | Extract from local file/directory |\n| `adp extract url <url>` | Extract from remote file |\n| `adp extract base64 <data>` | Extract from Base64-encoded content |\n| `adp extract query <task-id...>` | Query async extract tasks (supports multiple IDs or `--file`) |\n| `adp custom-app create` | Create a custom extraction app |\n| `adp custom-app update` | Update custom app config |\n| `adp custom-app get-config` | Show app config |\n| `adp custom-app delete` | Delete a custom app |\n| `adp custom-app delete-version` | Delete a specific config version |\n| `adp custom-app ai-generate` | AI-recommend extraction fields |\n| `adp credit` | Show remaining credits |\n| `adp schema` | Output command schema (for AI agents) |\n\n## Flags\n\n| Flag | Description |\n|---|---|\n| `--json` | Output JSON |\n| `--quiet` | Quiet mode, output result only |\n| `--lang <en\\|zh>` | Interface language |\n| `--app-id` | App ID (required for parse / extract) |\n| `--async` | Async mode |\n| `--no-wait` | Submit tasks only, do not wait for results (use with `--async`) |\n| `--export <path>` | Export result to file (single file) or directory (batch) |\n| `--timeout <seconds>` | Timeout (default 900s) |\n| `--concurrency <n>` | Concurrent workers (free: max 1, paid: max 2) |\n| `--retry <n>` | Retries for retryable errors (default 0) |\n| `--file <path>` | Read task IDs from JSON file (output of `--no-wait`, query only) |\n\n## Async Workflow\n\nFor large files or batch jobs, submit with `--async` and the CLI returns a `task-id`. Poll for results with `parse query` / `extract query`:\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# returns a task-id\n\nadp parse query <task-id>\n```\n\n### Two-Phase Async (`--no-wait`)\n\nBy default, `--async` submits and polls until completion — ideal for AI agents. For resumable workflows, use two-phase mode:\n\n**Phase 1: Submit tasks**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\nOutput is a JSON array with task IDs:\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**Phase 2: Query results**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\nEven if the CLI crashes mid-way, task IDs in `tasks.json` are preserved — resume anytime with `query --file`.\n\n## Batch Processing\n\nWhen processing multiple files/URLs, the CLI writes each result to a separate file:\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # Summary (total, success, failed, per-file status)\n├── invoice_01.pdf.json        # Successful result\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # Error details\n```\n\n- `--export <dir>` — specify output directory\n- Without `--export` — auto-creates `adp_results_<timestamp>/`\n- Single file — outputs to stdout or the `--export` file path\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | All success |\n| `1` | All failed / system error |\n| `2` | Parameter error |\n| `3` | Resource not found |\n| `4` | Permission denied |\n| `5` | Conflict |\n| `6` | Partial failure (some tasks failed in batch) |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `ADP_API_KEY` | API key (overrides config file) |\n| `ADP_API_BASE_URL` | Service URL |\n| `ADP_LANG` | Interface language (`en` / `zh`) |\n| `ADP_LOG_LEVEL` | Log level (`debug` / `info` / `warn` / `error`) |\n\n## Config Storage\n\n- Config dir: `~/.adp/`\n- Config file: `~/.adp/config.json`\n- Encrypted API key: `~/.adp/key.enc` (AES-256-GCM)\n- App cache: `~/.adp/app_cache.json`\n- Version check cache: `~/.adp/version_check.json` (refreshed every 24h)\n\n## 📜 License\n\nWe adopt a combined model of open-source tools + paid services: the CLI tool is completely free and open-source, making it easy for everyone to quickly integrate; while the core ADP intelligent parsing capability is a Public Cloud commercial service, billed based on actual usage, aiming to provide users with a highly accurate and stable document processing experience.\n\n- **CLI Tool**: Open source under the MIT License, freely available for use, modification, and distribution\n- **ADP Service**: AI document processing service based on Public Cloud, billed by usage, Billing Rules\n\nFree Quota: New users can receive **100 free credits** per month after registration, allowing them to experience full functionality\n\n## 📞 Support and Contact\n- **CLI Documentation**: [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)\n- **API Documentation**: [OpenAPI User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd?from=from_copylink)\n- **User Guide**: [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/OfexwgVUQiOpEek4kO7c7NEJnAe)\n- **Problem Feedback**: [GitHub Issues](https://github.com/laiye-ai/adp-cli/issues) | global_product@laiye.com\n- **Official Website**: [Laiye Technology](https://laiye.com/en/)\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn770b2vgq91s7c13mz7syttqh81xj81\",\n  \"slug\": \"adp-invoice-recognition-and-extract\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1779193893285\n}\n\nFile v1.0.0:license.md\n\nCommercial License Agreement\n\nEffective Date: [March 30, 2026]\nCopyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nThis “Skill” (referring to the entirety including models, software, code, weights, documentation, data, and related derivative works, “the Product”) is developed and wholly owned by Laiye Technology (Beijing) Co., Ltd. (“Licensor”). The mentioned derivative works refer to new works created by modifying, integrating, fine-tuning, or further developing the Product. Subject to your (“Licensee” or “you”) compliance with the terms of this Agreement, the Licensor grants you a worldwide, royalty-free, non-exclusive license.\n\n1. Licensing\n\n1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned \"non-commercial purposes\" include, but are not limited to:\nPersonal learning, research, teaching, and evaluation.\nTechnical exchanges within academic institutions or open-source communities, non-profit projects.\nIntegration or demonstration in non-commercial products or services.\n1.2 Commercial License:\tAny activity intended to directly or indirectly obtain commercial benefits, revenue, or consideration (“Commercial Exploitation”) requires the explicit written authorization (i.e., a \"Commercial License\") from the Licensor. Commercial Exploitation includes, but is not limited to:\nDistributing the Product or derivative works thereof in forms such as sales, resale, licensing fees, subscription fees, or other charges.\nProviding the Product or derivative works thereof as a SaaS (Software as a Service) to third parties.\nIntegrating the Product or derivative works thereof, as a core function, into software, hardware, or services intended for sale or lease.\nAny for-profit activity that utilizes the functionality or content of the Product to provide services to third parties.\n\n2. Reserved Rights and Ownership\n\n2.1\tOwnership, intellectual property rights (including but not limited to copyright, patents, trademarks, trade secrets), and other related rights and interests in the Product (including all copies thereof) belong to the Licensor or its affiliates. This Agreement does not constitute any form of transfer of rights or sale of the Licensor's intellectual property.\n2.2\tThe Licensee may non-commercially distribute unmodified copies of the Product through channels such as open-source platforms, or engage in non-commercial further development, and distribution, provided that this Agreement, the copyright notice, and the original identification are fully retained.\n3. Distribution Conditions\n\nWhen the Licensee distributes or provides the Product, all of the following conditions must be met:\nRetention of Notices:\tProminently retain all copyright notices of the Product, the text of this License Agreement, and the disclaimer on distributed copies.\nNo Misrepresentation:\tShould not imply that the Licensor endorses your distribution version.\n\n4. Disclaimer of Warranties\n\nTHE PRODUCT IS PROVIDED \"AS IS\", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO: THE LICENSOR DOES NOT WARRANT THAT THE PRODUCT IS FREE FROM ERRORS, BUGS, WILL OPERATE PROPERLY, OR IS SUITABLE FOR A PARTICULAR PURPOSE; THE LICENSOR DOES NOT WARRANT THAT USE OF THE PRODUCT WILL NOT INFRINGE UPON THIRD-PARTY RIGHTS; THE LICENSOR SHALL NOT BE LIABLE TO THE LICENSEE OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES ARISING FROM THE USE OF THE PRODUCT.\n\n5. Termination\n\n5.1\tThis Agreement becomes effective from the Licensee's first use of the Product and continues until terminated.\n5.2\tIf the Licensee violates the restrictions in Article 1 \"License Grant\" of this Agreement (e.g., unauthorized Commercial Exploitation), this Agreement will terminate automatically without prior notice.\n5.3\tUpon termination, the Licensee must immediately cease using the Product and destroy all copies of the Product in its possession.\n\n6. Miscellaneous\n\n6.1\tThe formation, execution, interpretation, and dispute resolution of this Agreement shall be governed by the laws of the People's Republic of China.\n6.2\tThe Licensee shall not assign or transfer any of its rights or obligations under this Agreement without the Licensor's prior written consent.\n6.3\tThis Agreement constitutes the entire agreement between the parties concerning this license matter and supersedes any prior oral or written communications and agreements between the parties regarding this matter.\n6.4\tAny dispute related to this Agreement shall be settled through friendly negotiation between the parties. If negotiation fails, either party has the right to submit the dispute to the competent court in the place where the Licensor is registered.\n\nFor obtaining a Commercial License or if you have any questions, please contact:\n[global_product@laiye.com]\n\n\nThe Product is licensed under the Commercial License Agreement.  For commercial use, please contact us to obtain authorization.\n\nFile v1.0.0:README-CN.md\n\n## 🚀 关于来也ADP\n\nADP是来也科技公司**智能体文档处理产品 (Agentic Document Processing，简称 ADP)**， 基于大模型的通用理解能力，不依赖规则与标注，具备对多语言、多模态、多场景的通用理解能力；智能体的自主规划与执行，能够理解任务目标、自主规划步骤、调用工具、完成复杂任务；端到端的业务自动化，从文档输入到业务决策再到人机协同，形成完整闭环。\n\n**agentic-doc-parse-and-extract** 是 ADP 官方开源 CLI 工具，同时支持人工终端调用 + AI Skill 自动调用。一条命令即可完成：文档结构化解析 + 关键字段智能抽取，覆盖发票、订单、证件、票据、通用文档全场景，输出标准 JSON，无缝对接自动化与 AI 流程。\n\n---\n\n## 💡 核心功能\n\nagentic-doc-parse-and-extract 聚焦文档全流程智能处理，兼顾人工终端调用与 AI Agent 自动调用，核心功能覆盖解析、抽取、批量处理全场景，无需复杂配置，一条命令即可完成操作：\n\n| 功能名称 | 功能描述 | 最佳场景 |\n|---------|------------------|----------|\n| **文档解析** | 自动识别 PDF、图片等多格式文档，将杂乱的非结构化内容（如扫描件、手写体、复杂排版文档）转化为标准化结构化数据，保留原始文档层级与关键关联关系 | 将非结构化文档转换为结构化数据，供 LLM 阅读和后续抽取使用 |\n| **开箱即用文档抽取** | 基于 ADP 大模型原生 AI 能力，内置发票、收据、订单、中国地区常用证件等标准化抽取模型，无需配置规则、无需人工标注，一键提取各类通用单据关键字段，输出标准 JSON | 应付账款自动化、费用管理、采购自动化、卡证信息快速录入系统 |\n| **自定义文档抽取** | 支持自主创建、编辑与管理个性化抽取应用，可针对企业专属单据、行业定制表单配置专属抽取字段与识别逻辑 | 企业专属单据、行业定制表单、非标准化文档的私有化抽取需求 |\n| **任务查询** | 支持异步任务提交与状态查询，可快速查看任务执行进度、成功/失败状态，以及任务最终处理结果 | 批量任务处理、异步文档处理、问题排查与处理记录追溯 |\n| **应用管理** | 提供完整的应用管理能力，可查看所有可用的抽取应用（系统内置 + 自定义）、查询应用详情、应用标签 | 多场景业务切换、应用全生命周期管控、自定义应用管理 |\n\n## 安装\n\n```bash\n# npm（推荐）\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows（PowerShell）\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\n或从 [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases) 下载预编译二进制。\n\n## 配置\n\n访问 [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=github) 注册并获取 API Key（新用户每月 100 免费积分）。\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n## 快速示例\n\n```bash\n# 查看可用应用\nadp app-id list\n\n# 解析本地文档\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# 抽取关键字段\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# 异步解析目录\nadp parse local ./documents/ --app-id <app-id> --async\n\n# 处理远程 URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# 查询异步任务\nadp parse query <task-id>\n\n# 两阶段异步（分开提交和查询，支持断点续传）\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# 失败自动重试（最多 2 次）\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# 查看剩余积分\nadp credit\n```\n\n## 命令\n\n> AI Agent 应调用 `adp schema` 获取机器可读的权威命令规格。下表仅供人类速查。\n\n| 命令 | 说明 |\n|---|---|\n| `adp version` | 显示版本号 |\n| `adp config set` | 设置 API Key / 服务地址 |\n| `adp config get` | 查看当前配置 |\n| `adp config clear` | 清除配置 |\n| `adp app-id list` | 列出可用应用 |\n| `adp app-id cache` | 从本地缓存读取应用列表 |\n| `adp parse local <path>` | 解析本地文件/目录 |\n| `adp parse url <url>` | 解析远程文件（支持 URL 列表文件） |\n| `adp parse base64 <data>` | 解析 Base64 编码内容 |\n| `adp parse query <task-id...>` | 查询异步解析任务（支持多个 ID 或 `--file`） |\n| `adp extract local <path>` | 抽取本地文件/目录 |\n| `adp extract url <url>` | 抽取远程文件 |\n| `adp extract base64 <data>` | 抽取 Base64 编码内容 |\n| `adp extract query <task-id...>` | 查询异步抽取任务（支持多个 ID 或 `--file`） |\n| `adp custom-app create` | 创建自定义抽取应用 |\n| `adp custom-app update` | 更新自定义应用配置 |\n| `adp custom-app get-config` | 查看应用配置 |\n| `adp custom-app delete` | 删除自定义应用 |\n| `adp custom-app delete-version` | 删除指定配置版本 |\n| `adp custom-app ai-generate` | AI 推荐抽取字段 |\n| `adp credit` | 查看剩余积分 |\n| `adp schema` | 输出命令 Schema（供 AI Agent 使用） |\n\n## 参数\n\n| 参数 | 说明 |\n|---|---|\n| `--json` | 以 JSON 格式输出 |\n| `--quiet` | 静默模式，仅输出结果 |\n| `--lang <en\\|zh>` | 指定界面语言 |\n| `--app-id` | 应用 ID（parse / extract 必填） |\n| `--async` | 异步模式 |\n| `--no-wait` | 仅提交任务，不等待结果（与 `--async` 配合使用） |\n| `--export <path>` | 导出结果到文件（单文件）或目录（批量） |\n| `--timeout <seconds>` | 超时时间（默认 900 秒） |\n| `--concurrency <n>` | 并发数（免费用户最大 1，付费用户最大 2） |\n| `--retry <n>` | 可重试错误的重试次数（默认 0） |\n| `--file <path>` | 从 JSON 文件读取任务 ID（`--no-wait` 的输出文件，仅 query 可用） |\n\n## 异步工作流\n\n处理大文件或批量任务时，使用 `--async` 提交任务，CLI 返回 `task-id`，再用 `parse query` / `extract query` 轮询结果：\n\n```bash\nadp parse local ./big.pdf --app-id <app-id> --async\n# 返回一个 task-id\n\nadp parse query <task-id>\n```\n\n### 两阶段异步（`--no-wait`）\n\n默认情况下，`--async` 会提交并轮询直到完成——适合 AI Agent 使用。对于可恢复的工作流，使用两阶段模式：\n\n**第一阶段：提交任务**\n\n```bash\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\n```\n\n输出为包含任务 ID 的 JSON 数组：\n\n```json\n[\n  {\"path\": \"invoice.pdf\", \"task_id\": \"task_abc123\"},\n  {\"path\": \"contract.pdf\", \"task_id\": \"task_def456\"}\n]\n```\n\n**第二阶段：查询结果**\n\n```bash\nadp extract query --watch --file tasks.json\nadp extract query --watch --file tasks.json --export ./results/\n```\n\n即使 CLI 中途崩溃，`tasks.json` 中的任务 ID 也会被保留——随时可用 `query --file` 恢复查询。\n\n## 批量处理\n\n处理多个文件/URL 时，CLI 会将每个结果写入单独的文件：\n\n```\nadp_results_20250417_153020/\n├── _summary.json              # 汇总（总数、成功、失败、每文件状态）\n├── invoice_01.pdf.json        # 成功结果\n├── contract_02.docx.json\n└── report_03.pdf.error.json   # 错误详情\n```\n\n- `--export <dir>` — 指定输出目录\n- 不加 `--export` — 自动创建 `adp_results_<timestamp>/`\n- 单文件 — 输出到 stdout 或 `--export` 指定的文件路径\n\n## 退出码\n\n| 退出码 | 含义 |\n|------|---------|\n| `0` | 全部成功 |\n| `1` | 全部失败 / 系统错误 |\n| `2` | 参数错误 |\n| `3` | 资源未找到 |\n| `4` | 权限不足 |\n| `5` | 冲突 |\n| `6` | 部分失败（批量中部分任务失败） |\n\n## 环境变量\n\n| 变量 | 说明 |\n|---|---|\n| `ADP_API_KEY` | API Key（优先于配置文件） |\n| `ADP_API_BASE_URL` | 服务地址 |\n| `ADP_LANG` | 界面语言（`en` / `zh`） |\n| `ADP_LOG_LEVEL` | 日志级别（`debug` / `info` / `warn` / `error`） |\n\n## 配置存储\n\n- 配置目录：`~/.adp/`\n- 配置文件：`~/.adp/config.json`\n- 加密的 API Key：`~/.adp/key.enc`（AES-256-GCM）\n- 应用缓存：`~/.adp/app_cache.json`\n- 版本检查缓存：`~/.adp/version_check.json`（每 24 小时刷新）\n\n## 📜 授权许可\n\n我们采用 开源工具 + 付费服务 的组合模式：CLI 工具完全免费开源，方便大家快速接入；而核心的 ADP 智能解析能力为公有云商业服务，按实际使用量计费，旨在为用户提供高精准、高稳定的文档处理体验。\n\n- **CLI 工具**：MIT License 开源许可，可自由使用、修改和分发\n- **ADP 服务**：基于公有云的 AI 文档处理服务，按使用量计费，[计费规则](#credit)\n\n免费额度：新用户注册后每月可获得 **100 免费积分**，可体验完整功能\n\n\n## 📞 支持与联系\n- **CLI 使用指南：** [ADP CLI 使用指南](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)\n- **API 接口文档：** [Open API 使用指南](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)\n- **ADP 产品操作手册：** [公有云操作手册](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)\n\n- **问题反馈：** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)\n- **邮箱：** global_product@laiye.com\n- **官网：** [来也科技](https://laiye.com)","readmeExcerpt":"Skill: Global Invoice Recognition and extraction（ADP） Owner: laiye-adp Summary: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, t... Tags: latest:1.0.2 Version history: v1.0.2 | 2026-05-20T02:59:28.890Z | user - Added greater emphasis on the global endpoint (adp-global.laiye.com) as default for international us","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# Method 1: npm (recommended, cross-platform)\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli"},{"language":"bash","snippet":"curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash"},{"language":"bash","snippet":"# Method 2: Shell script (Linux / macOS, when npm is unavailable)\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash"},{"language":"bash","snippet":"# Method 3: PowerShell script (Windows, when npm is unavailable)\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex"},{"language":"bash","snippet":"adp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get"},{"language":"bash","snippet":"# Query OOTB apps only (recommended)\nadp app-id list --app-type 0\n\n# Or query all apps\nadp app-id list"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: invoice-recognition-and-extract\ndescription: Multi-language, multi-currency global invoice recognition and extraction — accurately extracts invoice number, date, supplier, buyer, currency, tax amount, total amount, and line items, outputting structured JSON. Zero-configuration, out-of-the-box, suitable for accounts payable automation, expense reimbursement, and cross-border trade document processing.\n---\n\n# Global Invoice Recognition and Extraction Skill\n\nPowered by [Laiye ADP (Agentic Document Processing)](https://adp-global.laiye.com/?utm_source=clawhub), this skill delivers intelligent, high-precision parsing and information extraction for standard and non-standard invoices, bills, and vouchers from all regions worldwide. It supports all file types including electronic PDFs, scanned documents, and photographs, and outputs standardized structured JSON data for seamless integration with business processes and downstream automation.\n\n> New users receive **100 free credits per month** (refreshed monthly) for invoice extraction and other document processing scenarios. **Limited-Time Offer:** Use the invoice extraction feature for the first time and receive an additional **1,000 free pages of global invoice extraction** — limited to the first **100** users only, first come first served! ADP provides a standard commercial API that can be **integrated into business systems within 1 hour**.\n</br> Register now: [Global](https://adp-global.laiye.com/?utm_source=clawhub) | [China Mainland](https://adp.laiye.com/?utm_source=clawhub)\n\nWhy choose us?\n  - Global invoices with zero barriers — multi-language, multi-format precision recognition\n  - 100+ languages fully covered: English, Japanese, Korean, German, French, Thai, and all other major languages — invoices and receipts all supported\n  - Adaptive to all formats: standard VAT invoices, unstructured receipts, mixed-format bills — all recognized\n  - 95%+ accuracy: precise extraction of key fields, dramatically reducing manual verification, translation, and data entry costs\n  - Agentic self-optimization: continuously fine-tuned on your business data — the more you use it, the more accurate and tailored it becomes\n\n---\n\n## Quick Start Guide\n\n### Core Workflow\n\n1. **Install dependencies**: On first run, install the ADP CLI tool.\n2. **Authentication setup**: On first run, execute `adp config get` to check credentials. If not configured, prompt the user to provide an API Key.\n3. **Get app list**: On first run, retrieve the out-of-the-box app list via `adp app-id list --app-type 0`, find the invoice extraction app, and record its `app_id` (prefixed with `ootb_`). For subsequent runs, prefer `adp app-id cache`.\n4. **Execute extraction**: Run `adp extract url <URL> --app-id <invoice-app-id>` or `adp extract local <file-path> --app-id <invoice-app-id>`.\n5. **Process results**: Parse the returned JSON to extract structured fields such as invoice number, date, supplier, buyer, currency, tax amount, total am"},{"path":"README.md","content":"## 🚀 About Laiye ADP\n\nADP is Laiye's **intelligent agent document processing product (Agentic Document Processing, referred to as ADP)** , based on the general understanding ability of large models, without relying on rules and annotations, with the general understanding ability of multi-language, MultiModal Machine Learning, and multi-scene; autonomous planning and execution of intelligent agents, able to understand task goals, autonomous planning steps, invoke tools, and complete complex tasks; end-to-end business automation, from document input to business decision-making to human-machine collaboration, forming a complete closed loop.\n\n**agentic-doc-parse-and-extract** is the official open-source CLI tool of ADP, supporting both manual terminal invocation and automatic invocation via AI Skill. With a single command, it can accomplish: structured document parsing + intelligent extraction of key fields, covering all scenarios including invoices, orders, certificates, bills, and general documents, outputting standard JSON, and seamlessly integrating with automation and AI workflows.\n\n---\n\n## 💡 Core Features\n\nagentic-doc-parse-and-extract focuses on intelligent processing of the entire document workflow, taking into account both manual terminal calls and automatic calls by AI Agents. Its core functions cover all scenarios of parsing, extraction, and batch processing, requiring no complex configuration, and operations can be completed with a single command:\n\n| Function Name | Function Description | Optimal Scenario |\n|---------|------------------|----------|\n| **Document Parsing** | Automatically recognize multi-format documents such as PDFs and images, convert messy unstructured content (e.g., scanned documents, handwritten text, complex layout documents) into standardized Structured Data, while preserving the original document hierarchy and key relationships | Convert unstructured documents into Structured Data for LLM reading and subsequent extraction |\n| **Out Of The Box Document Extraction** | Based on the native AI capabilities of the ADP large model, it comes with built-in standardized extraction models for invoices, receipts, orders, commonly used certificates in China, etc. No need to configure rules or manual annotation, one-click extraction of key fields from various types of general documentation, outputting standard JSON | Account Payable automation, expense management, procurement automation, quick entry of card and certificate information into the system |\n| **Custom Document Extraction** | Supports independent creation, editing, and management of personalized extraction applications, allowing configuration of exclusive extraction fields and recognition logic for enterprise-specific documentation and industry-customized forms | Private extraction requirements for enterprise-specific documentation, industry-customized forms, and non-standardized documents |\n| **Task Query** | Supports asynchronous task submission and status query, e"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn770b2vgq91s7c13mz7syttqh81xj81\",\n  \"slug\": \"adp-invoice-recognition-and-extract\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1779245968890\n}"},{"path":"license.md","content":"Commercial License Agreement\n\nEffective Date: [March 30, 2026]\nCopyright © 2026 [Laiye Technology (Beijing) Co., Ltd.] All rights reserved.\n\nThis “Skill” (referring to the entirety including models, software, code, weights, documentation, data, and related derivative works, “the Product”) is developed and wholly owned by Laiye Technology (Beijing) Co., Ltd. (“Licensor”). The mentioned derivative works refer to new works created by modifying, integrating, fine-tuning, or further developing the Product. Subject to your (“Licensee” or “you”) compliance with the terms of this Agreement, the Licensor grants you a worldwide, royalty-free, non-exclusive license.\n\n1. Licensing\n\n1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned \"non-commercial purposes\" include, but are not limited to:\nPersonal learning, research, teaching, and evaluation.\nTechnical exchanges within academic institutions or open-source communities, non-profit projects.\nIntegration or demonstration in non-commercial products or services.\n1.2 Commercial License:\tAny activity intended to directly or indirectly obtain commercial benefits, revenue, or consideration (“Commercial Exploitation”) requires the explicit written authorization (i.e., a \"Commercial License\") from the Licensor. Commercial Exploitation includes, but is not limited to:\nDistributing the Product or derivative works thereof in forms such as sales, resale, licensing fees, subscription fees, or other charges.\nProviding the Product or derivative works thereof as a SaaS (Software as a Service) to third parties.\nIntegrating the Product or derivative works thereof, as a core function, into software, hardware, or services intended for sale or lease.\nAny for-profit activity that utilizes the functionality or content of the Product to provide services to third parties.\n\n2. Reserved Rights and Ownership\n\n2.1\tOwnership, intellectual property rights (including but not limited to copyright, patents, trademarks, trade secrets), and other related rights and interests in the Product (including all copies thereof) belong to the Licensor or its affiliates. This Agreement does not constitute any form of transfer of rights or sale of the Licensor's intellectual property.\n2.2\tThe Licensee may non-commercially distribute unmodified copies of the Product through channels such as open-source platforms, or engage in non-commercial further development, and distribution, provided that this Agreement, the copyright notice, and the original identification are fully retained.\n3. Distribution Conditions\n\nWhen the Licensee distributes or provides the Product, all of the following conditions must be met:\nRetention of Notices:\tProminently retain all copyright notices of the Product, the text of this License Agreement, and the disclaimer on distributed copies.\nNo Misrepresentation:\tSh"},{"path":"README-CN.md","content":"## 🚀 关于来也ADP\n\nADP是来也科技公司**智能体文档处理产品 (Agentic Document Processing，简称 ADP)**， 基于大模型的通用理解能力，不依赖规则与标注，具备对多语言、多模态、多场景的通用理解能力；智能体的自主规划与执行，能够理解任务目标、自主规划步骤、调用工具、完成复杂任务；端到端的业务自动化，从文档输入到业务决策再到人机协同，形成完整闭环。\n\n**agentic-doc-parse-and-extract** 是 ADP 官方开源 CLI 工具，同时支持人工终端调用 + AI Skill 自动调用。一条命令即可完成：文档结构化解析 + 关键字段智能抽取，覆盖发票、订单、证件、票据、通用文档全场景，输出标准 JSON，无缝对接自动化与 AI 流程。\n\n---\n\n## 💡 核心功能\n\nagentic-doc-parse-and-extract 聚焦文档全流程智能处理，兼顾人工终端调用与 AI Agent 自动调用，核心功能覆盖解析、抽取、批量处理全场景，无需复杂配置，一条命令即可完成操作：\n\n| 功能名称 | 功能描述 | 最佳场景 |\n|---------|------------------|----------|\n| **文档解析** | 自动识别 PDF、图片等多格式文档，将杂乱的非结构化内容（如扫描件、手写体、复杂排版文档）转化为标准化结构化数据，保留原始文档层级与关键关联关系 | 将非结构化文档转换为结构化数据，供 LLM 阅读和后续抽取使用 |\n| **开箱即用文档抽取** | 基于 ADP 大模型原生 AI 能力，内置发票、收据、订单、中国地区常用证件等标准化抽取模型，无需配置规则、无需人工标注，一键提取各类通用单据关键字段，输出标准 JSON | 应付账款自动化、费用管理、采购自动化、卡证信息快速录入系统 |\n| **自定义文档抽取** | 支持自主创建、编辑与管理个性化抽取应用，可针对企业专属单据、行业定制表单配置专属抽取字段与识别逻辑 | 企业专属单据、行业定制表单、非标准化文档的私有化抽取需求 |\n| **任务查询** | 支持异步任务提交与状态查询，可快速查看任务执行进度、成功/失败状态，以及任务最终处理结果 | 批量任务处理、异步文档处理、问题排查与处理记录追溯 |\n| **应用管理** | 提供完整的应用管理能力，可查看所有可用的抽取应用（系统内置 + 自定义）、查询应用详情、应用标签 | 多场景业务切换、应用全生命周期管控、自定义应用管理 |\n\n## 安装\n\n```bash\n# npm（推荐）\nnpm install -g @laiye-adp/agentic-doc-parse-and-extract-cli\n\n# Linux / macOS\ncurl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash\n\n# Windows（PowerShell）\nirm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex\n```\n\n或从 [GitHub Releases](https://github.com/laiye-ai/adp-cli/releases) 下载预编译二进制。\n\n## 配置\n\n访问 [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=github) 注册并获取 API Key（新用户每月 100 免费积分）。\n\n```bash\nadp config set --api-key <your-api-key>\nadp config set --api-base-url https://adp.laiye.com\nadp config get\n```\n\n## 快速示例\n\n```bash\n# 查看可用应用\nadp app-id list\n\n# 解析本地文档\nadp parse local ./invoice.pdf --app-id <app-id>\n\n# 抽取关键字段\nadp extract local ./invoice.pdf --app-id <app-id>\n\n# 异步解析目录\nadp parse local ./documents/ --app-id <app-id> --async\n\n# 处理远程 URL\nadp extract url https://example.com/file.pdf --app-id <app-id>\n\n# 查询异步任务\nadp parse query <task-id>\n\n# 两阶段异步（分开提交和查询，支持断点续传）\nadp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json\nadp extract query --watch --file tasks.json\n\n# 失败自动重试（最多 2 次）\nadp parse local ./documents/ --app-id <app-id> --retry 2\n\n# 查看剩余积分\nadp credit\n```\n\n## 命令\n\n> AI Agent 应调用 `adp schema` 获取机器可读的权威命令规格。下表仅供人类速查。\n\n| 命令 | 说明 |\n|---|---|\n| `adp version` | 显示版本号 |\n| `adp config set` | 设置 API Key / 服务地址 |\n| `adp config get` | 查看当前配置 |\n| `adp config clear` | 清除配置 |\n| `adp app-id list` | 列出可用应用 |\n| `adp app-id cache` | 从本地缓存读取应用列表 |\n| `adp parse local <path>` | 解析本地文件/目录 |\n| `adp parse url <url>` | 解析远程文件（支持 URL 列表文件） |\n| `adp parse base64 <data>` | 解析 Base64 编码内容 |\n| `adp parse query <task-id...>` | 查询异步解析任务（支持多个 ID 或 `--file`） |\n| `adp extract local <path>` | 抽取本地文件/目录 |\n| `adp extract url <url>` | 抽取远程文件 |\n| `adp extract base64 <data>` | 抽取 Base64 编码内容 |\n| `adp extract query <task-id...>` | 查询异步抽取任务（支持多个 ID 或 `--file`） |\n| `adp custom-app create` | 创建自定义"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1911,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-12T02:22:55.384Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-13T01:47:30.148Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}