@laiye-adp/agentic-doc-parse-and-extract-cli 1.11.0-beta.6 → 1.11.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -22
- package/README.zh.md +87 -22
- package/bin/adp +40 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
## 🚀 About Laiye ADP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ADP 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.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**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.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **Invoice/Receipt/Purchase Order Extraction** — Extract key information and line items from invoices, receipts, purchase orders and more
|
|
11
|
-
- **Custom Document Extraction** — Extract custom fields from any type of document
|
|
12
|
-
- **Batch Processing** — Concurrently process multiple documents in a folder or from URLs, with per-file result output
|
|
13
|
-
- **Sync/Async** — Support both sync and async processing modes
|
|
14
|
-
- **Two-Phase Async** — `--async --no-wait` submits tasks and outputs task-id list; `query --file` resumes from where you left off
|
|
15
|
-
- **Reliability** — Automatic retry with exponential backoff (`--retry`), fine-grained exit codes
|
|
16
|
-
- **Cross Platform** — Windows / Linux / macOS, static binaries with no dependencies
|
|
9
|
+
## 💡 Core Features
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
agentic-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:
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
| Function Name | Function Description | Optimal Scenario |
|
|
14
|
+
|---------|------------------|----------|
|
|
15
|
+
| **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 |
|
|
16
|
+
| **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 |
|
|
17
|
+
| **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 |
|
|
18
|
+
| **Human-Review Collaboration** | Provides complete human-review collaboration APIs and CLI commands, supporting creation, editing, querying and deletion of review rules, AI-recommended rules, task execution (sync/async), and document result updates | Automated quality assurance, compliance review, human-in-the-loop document processing |
|
|
19
|
+
| **Webhook Callbacks** | Supports configuring Webhook callback URLs and trigger events, enabling real-time push notifications when task status changes, eliminating the need for continuous polling | Real-time task status monitoring, third-party system integration, event-driven workflows |
|
|
20
|
+
| **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 |
|
|
21
|
+
| **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 |
|
|
21
22
|
|
|
22
23
|
## Agent Integration
|
|
23
24
|
|
|
@@ -34,10 +35,12 @@ The skills package will guide you through CLI installation, authentication, and
|
|
|
34
35
|
```bash
|
|
35
36
|
# npm (recommended)
|
|
36
37
|
npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli
|
|
37
|
-
|
|
38
|
+
```
|
|
39
|
+
```bash
|
|
38
40
|
# Linux / macOS
|
|
39
41
|
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
|
|
40
|
-
|
|
42
|
+
```
|
|
43
|
+
```bash
|
|
41
44
|
# Windows (PowerShell)
|
|
42
45
|
irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex
|
|
43
46
|
```
|
|
@@ -46,7 +49,7 @@ Or download a prebuilt binary from [GitHub Releases](https://github.com/laiye-ai
|
|
|
46
49
|
|
|
47
50
|
## Configure
|
|
48
51
|
|
|
49
|
-
Get an API key at [https://adp-global.laiye.com/](https://adp-global.laiye.com
|
|
52
|
+
Get 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).
|
|
50
53
|
|
|
51
54
|
```bash
|
|
52
55
|
adp config set --api-key <your-api-key>
|
|
@@ -112,6 +115,19 @@ adp credit
|
|
|
112
115
|
| `adp custom-app delete` | Delete a custom app |
|
|
113
116
|
| `adp custom-app delete-version` | Delete a specific config version |
|
|
114
117
|
| `adp custom-app ai-generate` | AI-recommend extraction fields |
|
|
118
|
+
| `adp human-review rule-create` | Create a human-review collaboration rule |
|
|
119
|
+
| `adp human-review get-config` | View human-review rule for an app |
|
|
120
|
+
| `adp human-review rule-update` | Update a human-review collaboration rule |
|
|
121
|
+
| `adp human-review rule-delete` | Delete a human-review collaboration rule |
|
|
122
|
+
| `adp human-review rule-ai-generate` | AI-recommended review rules |
|
|
123
|
+
| `adp human-review task-create` | Create a human-review task (sync/async) |
|
|
124
|
+
| `adp human-review task-query` | Query human-review async task status |
|
|
125
|
+
| `adp human-review result-update` | Update document human-review result |
|
|
126
|
+
| `adp webhook create` | Create a webhook callback configuration |
|
|
127
|
+
| `adp webhook get-config` | List webhook configurations |
|
|
128
|
+
| `adp webhook update` | Update a webhook configuration |
|
|
129
|
+
| `adp webhook delete` | Delete a webhook configuration |
|
|
130
|
+
| `adp webhook log` | Query webhook push logs |
|
|
115
131
|
| `adp credit` | Show remaining credits |
|
|
116
132
|
| `adp schema` | Output command schema (for AI agents) |
|
|
117
133
|
|
|
@@ -127,7 +143,6 @@ adp credit
|
|
|
127
143
|
| `--no-wait` | Submit tasks only, do not wait for results (use with `--async`) |
|
|
128
144
|
| `--export <path>` | Export result to file (single file) or directory (batch) |
|
|
129
145
|
| `--timeout <seconds>` | Timeout (default 900s) |
|
|
130
|
-
| `--concurrency <n>` | Concurrent workers (free: max 1, paid: max 2) |
|
|
131
146
|
| `--retry <n>` | Retries for retryable errors (default 0) |
|
|
132
147
|
| `--file <path>` | Read task IDs from JSON file (output of `--no-wait`, query only) |
|
|
133
148
|
|
|
@@ -170,6 +185,44 @@ adp extract query --watch --file tasks.json --export ./results/
|
|
|
170
185
|
|
|
171
186
|
Even if the CLI crashes mid-way, task IDs in `tasks.json` are preserved — resume anytime with `query --file`.
|
|
172
187
|
|
|
188
|
+
## Human-Review Collaboration
|
|
189
|
+
|
|
190
|
+
Human-review commands manage collaboration rules and tasks for document quality assurance:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Create a review rule
|
|
194
|
+
adp human-review rule-create --app-id <app-id> --rule-name "my-rule" \
|
|
195
|
+
--rule '[{"rule_dimension":"整体文档","rule_setting":"所有字段不能为空"}]' \
|
|
196
|
+
--rule-status "true" --rule-logic 2
|
|
197
|
+
|
|
198
|
+
# Update a review rule
|
|
199
|
+
adp human-review rule-update --app-id <app-id> --rule-name "my-rule" \
|
|
200
|
+
--rule '[{"rule_dimension":"文档置信度","rule_setting":"不能小于0.9"}]' \
|
|
201
|
+
--rule-status "false" --rule-logic 1
|
|
202
|
+
|
|
203
|
+
# Query rule config
|
|
204
|
+
adp human-review get-config --app-id <app-id>
|
|
205
|
+
|
|
206
|
+
# AI-generate rules
|
|
207
|
+
adp human-review rule-ai-generate --app-id <app-id> \
|
|
208
|
+
--fields '[{"field_name":"amount","field_accuracy":"high"}]'
|
|
209
|
+
|
|
210
|
+
# Create async task
|
|
211
|
+
adp human-review task-create --app-id <app-id> --url https://example.com/file.pdf --async
|
|
212
|
+
|
|
213
|
+
# Query task status
|
|
214
|
+
adp human-review task-query <task-id> --watch
|
|
215
|
+
|
|
216
|
+
# Update document result
|
|
217
|
+
adp human-review result-update --file-task-id <task-id> \
|
|
218
|
+
--collaboration-result '[{"field_name":"amount","field_type":"string","field_values":["100"]}]'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Flags:**
|
|
222
|
+
- `--rule-status`: string (`"true"` / `"false"`, default: `"true"`) — use `=` to pass value (e.g. `--rule-status=false`)
|
|
223
|
+
- `--rule-logic`: integer — `1` = any condition, `2` = all conditions
|
|
224
|
+
- `--collaboration-result`: JSON — required fields: `field_name`, `field_type` (string/date/table), `field_values` (array). When `field_type=table`, use `table_values: [[{field_name, field_type (string/date only), field_values}]]`
|
|
225
|
+
|
|
173
226
|
## Batch Processing
|
|
174
227
|
|
|
175
228
|
When processing multiple files/URLs, the CLI writes each result to a separate file:
|
|
@@ -215,10 +268,18 @@ adp_results_20250417_153020/
|
|
|
215
268
|
- App cache: `~/.adp/app_cache.json`
|
|
216
269
|
- Version check cache: `~/.adp/version_check.json` (refreshed every 24h)
|
|
217
270
|
|
|
218
|
-
## License
|
|
271
|
+
## 📜 License
|
|
272
|
+
|
|
273
|
+
We 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.
|
|
219
274
|
|
|
220
|
-
|
|
275
|
+
- **CLI Tool**: Open source under the MIT License, freely available for use, modification, and distribution
|
|
276
|
+
- **ADP Service**: AI document processing service based on Public Cloud, billed by usage, Billing Rules
|
|
221
277
|
|
|
222
|
-
|
|
278
|
+
Free Quota: New users can receive **100 free credits** per month after registration, allowing them to experience full functionality
|
|
223
279
|
|
|
224
|
-
|
|
280
|
+
## 📞 Support and Contact
|
|
281
|
+
- **CLI Documentation**: [ADP CLI User Guide](https://laiye-tech.feishu.cn/wiki/YIaawiK2DimisZk5KfDc8a8cnLh)
|
|
282
|
+
- **API Documentation**: [OpenAPI User Guide](https://laiye-tech.feishu.cn/wiki/S1t2wYR04ivndKkMDxxcp2SFnKd?from=from_copylink)
|
|
283
|
+
- **User Guide**: [Public Cloud Operation Manual](https://laiye-tech.feishu.cn/wiki/OfexwgVUQiOpEek4kO7c7NEJnAe)
|
|
284
|
+
- **Problem Feedback**: [GitHub Issues](https://github.com/laiye-ai/adp-cli/issues) | global_product@laiye.com
|
|
285
|
+
- **Official Website**: [Laiye Technology](https://laiye.com/en/)
|
package/README.zh.md
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
## 🚀 关于来也ADP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ADP是来也科技公司**智能体文档处理产品 (Agentic Document Processing,简称 ADP)**, 基于大模型的通用理解能力,不依赖规则与标注,具备对多语言、多模态、多场景的通用理解能力;智能体的自主规划与执行,能够理解任务目标、自主规划步骤、调用工具、完成复杂任务;端到端的业务自动化,从文档输入到业务决策再到人机协同,形成完整闭环。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**agentic-doc-parse-and-extract** 是 ADP 官方开源 CLI 工具,同时支持人工终端调用 + AI Skill 自动调用。一条命令即可完成:文档结构化解析 + 关键字段智能抽取,覆盖发票、订单、证件、票据、通用文档全场景,输出标准 JSON,无缝对接自动化与 AI 流程。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **发票/订单抽取** — 从发票、收据、采购订单等文档中抽取关键字段和表格
|
|
11
|
-
- **自定义文档抽取** — 从任意类型的文档中抽取自定义字段或表格
|
|
12
|
-
- **批量处理** — 并发处理文件夹或 URL 列表中的多个文档,每个文件单独输出结果
|
|
13
|
-
- **同步/异步** — 支持同步和异步两种模式
|
|
14
|
-
- **两阶段异步** — `--async --no-wait` 仅提交任务并输出 task-id 列表;`query --file` 从中断处恢复查询
|
|
15
|
-
- **可靠性** — 自动重试与指数退避(`--retry`),细粒度退出码
|
|
16
|
-
- **跨平台** — Windows / Linux / macOS,静态二进制无依赖
|
|
9
|
+
## 💡 核心功能
|
|
17
10
|
|
|
18
|
-
|
|
11
|
+
agentic-doc-parse-and-extract 聚焦文档全流程智能处理,兼顾人工终端调用与 AI Agent 自动调用,核心功能覆盖解析、抽取、批量处理全场景,无需复杂配置,一条命令即可完成操作:
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
| 功能名称 | 功能描述 | 最佳场景 |
|
|
14
|
+
|---------|------------------|----------|
|
|
15
|
+
| **文档解析** | 自动识别 PDF、图片等多格式文档,将杂乱的非结构化内容(如扫描件、手写体、复杂排版文档)转化为标准化结构化数据,保留原始文档层级与关键关联关系 | 将非结构化文档转换为结构化数据,供 LLM 阅读和后续抽取使用 |
|
|
16
|
+
| **开箱即用文档抽取** | 基于 ADP 大模型原生 AI 能力,内置发票、收据、订单、中国地区常用证件等标准化抽取模型,无需配置规则、无需人工标注,一键提取各类通用单据关键字段,输出标准 JSON | 应付账款自动化、费用管理、采购自动化、卡证信息快速录入系统 |
|
|
17
|
+
| **自定义文档抽取** | 支持自主创建、编辑与管理个性化抽取应用,可针对企业专属单据、行业定制表单配置专属抽取字段与识别逻辑 | 企业专属单据、行业定制表单、非标准化文档的私有化抽取需求 |
|
|
18
|
+
| **人机协同** | 提供完整的人机协同 API 和 CLI 命令,支持审核规则的创建、编辑、查询与删除,AI 推荐规则,任务执行(同步/异步),以及文档处理结果修改 | 自动化质量保证、合规审核、人机协同文档处理 |
|
|
19
|
+
| **Webhook 回调** | 支持配置 Webhook 回调地址和触发事件,任务状态变化时系统主动推送通知,无需持续轮询接口 | 实时任务状态监控、第三方系统集成、事件驱动工作流 |
|
|
20
|
+
| **任务查询** | 支持异步任务提交与状态查询,可快速查看任务执行进度、成功/失败状态,以及任务最终处理结果 | 批量任务处理、异步文档处理、问题排查与处理记录追溯 |
|
|
21
|
+
| **应用管理** | 提供完整的应用管理能力,可查看所有可用的抽取应用(系统内置 + 自定义)、查询应用详情、应用标签 | 多场景业务切换、应用全生命周期管控、自定义应用管理 |
|
|
21
22
|
|
|
22
23
|
## Agent 集成
|
|
23
24
|
|
|
@@ -34,10 +35,12 @@ Skills 会自动引导 CLI 安装、认证配置和使用。
|
|
|
34
35
|
```bash
|
|
35
36
|
# npm(推荐)
|
|
36
37
|
npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli
|
|
37
|
-
|
|
38
|
+
```
|
|
39
|
+
```bash
|
|
38
40
|
# Linux / macOS
|
|
39
41
|
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
|
|
40
|
-
|
|
42
|
+
```
|
|
43
|
+
```bash
|
|
41
44
|
# Windows(PowerShell)
|
|
42
45
|
irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1 | iex
|
|
43
46
|
```
|
|
@@ -46,7 +49,7 @@ irm https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.ps1
|
|
|
46
49
|
|
|
47
50
|
## 配置
|
|
48
51
|
|
|
49
|
-
访问 [https://adp.laiye.com/](https://adp.laiye.com
|
|
52
|
+
访问 [https://adp.laiye.com/](https://adp.laiye.com/?utm_source=github) 注册并获取 API Key(新用户每月 100 免费积分)。
|
|
50
53
|
|
|
51
54
|
```bash
|
|
52
55
|
adp config set --api-key <your-api-key>
|
|
@@ -112,6 +115,19 @@ adp credit
|
|
|
112
115
|
| `adp custom-app delete` | 删除自定义应用 |
|
|
113
116
|
| `adp custom-app delete-version` | 删除指定配置版本 |
|
|
114
117
|
| `adp custom-app ai-generate` | AI 推荐抽取字段 |
|
|
118
|
+
| `adp human-review rule-create` | 创建人机协同审核规则 |
|
|
119
|
+
| `adp human-review get-config` | 查看人机协同审核规则 |
|
|
120
|
+
| `adp human-review rule-update` | 修改人机协同审核规则 |
|
|
121
|
+
| `adp human-review rule-delete` | 删除人机协同审核规则 |
|
|
122
|
+
| `adp human-review rule-ai-generate` | AI 推荐审核规则 |
|
|
123
|
+
| `adp human-review task-create` | 创建人机协同任务(同步/异步) |
|
|
124
|
+
| `adp human-review task-query` | 查询人机协同异步任务状态 |
|
|
125
|
+
| `adp human-review result-update` | 修改文档人机协同处理结果 |
|
|
126
|
+
| `adp webhook create` | 创建 Webhook 回调配置 |
|
|
127
|
+
| `adp webhook get-config` | 查看回调配置列表 |
|
|
128
|
+
| `adp webhook update` | 修改回调配置 |
|
|
129
|
+
| `adp webhook delete` | 删除回调配置 |
|
|
130
|
+
| `adp webhook log` | 查询 Webhook 推送日志 |
|
|
115
131
|
| `adp credit` | 查看剩余积分 |
|
|
116
132
|
| `adp schema` | 输出命令 Schema(供 AI Agent 使用) |
|
|
117
133
|
|
|
@@ -127,7 +143,6 @@ adp credit
|
|
|
127
143
|
| `--no-wait` | 仅提交任务,不等待结果(与 `--async` 配合使用) |
|
|
128
144
|
| `--export <path>` | 导出结果到文件(单文件)或目录(批量) |
|
|
129
145
|
| `--timeout <seconds>` | 超时时间(默认 900 秒) |
|
|
130
|
-
| `--concurrency <n>` | 并发数(免费用户最大 1,付费用户最大 2) |
|
|
131
146
|
| `--retry <n>` | 可重试错误的重试次数(默认 0) |
|
|
132
147
|
| `--file <path>` | 从 JSON 文件读取任务 ID(`--no-wait` 的输出文件,仅 query 可用) |
|
|
133
148
|
|
|
@@ -170,6 +185,44 @@ adp extract query --watch --file tasks.json --export ./results/
|
|
|
170
185
|
|
|
171
186
|
即使 CLI 中途崩溃,`tasks.json` 中的任务 ID 也会被保留——随时可用 `query --file` 恢复查询。
|
|
172
187
|
|
|
188
|
+
## 人机协同
|
|
189
|
+
|
|
190
|
+
人机协同命令用于管理文档质量审核规则和任务:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# 创建审核规则
|
|
194
|
+
adp human-review rule-create --app-id <app-id> --rule-name "my-rule" \
|
|
195
|
+
--rule '[{"rule_dimension":"整体文档","rule_setting":"所有字段不能为空"}]' \
|
|
196
|
+
--rule-status "true" --rule-logic 2
|
|
197
|
+
|
|
198
|
+
# 修改审核规则
|
|
199
|
+
adp human-review rule-update --app-id <app-id> --rule-name "my-rule" \
|
|
200
|
+
--rule '[{"rule_dimension":"文档置信度","rule_setting":"不能小于0.9"}]' \
|
|
201
|
+
--rule-status "false" --rule-logic 1
|
|
202
|
+
|
|
203
|
+
# 查询规则配置
|
|
204
|
+
adp human-review get-config --app-id <app-id>
|
|
205
|
+
|
|
206
|
+
# AI 生成规则
|
|
207
|
+
adp human-review rule-ai-generate --app-id <app-id> \
|
|
208
|
+
--fields '[{"field_name":"amount","field_accuracy":"high"}]'
|
|
209
|
+
|
|
210
|
+
# 创建异步任务
|
|
211
|
+
adp human-review task-create --app-id <app-id> --url https://example.com/file.pdf --async
|
|
212
|
+
|
|
213
|
+
# 查询任务状态
|
|
214
|
+
adp human-review task-query <task-id> --watch
|
|
215
|
+
|
|
216
|
+
# 修改文档结果
|
|
217
|
+
adp human-review result-update --file-task-id <task-id> \
|
|
218
|
+
--collaboration-result '[{"field_name":"amount","field_type":"string","field_values":["100"]}]'
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**参数说明:**
|
|
222
|
+
- `--rule-status`:字符串(`"true"` / `"false"`,默认:`"true"`)——传值需用 `=`(如 `--rule-status=false`)
|
|
223
|
+
- `--rule-logic`:整数 —— `1` = 任一条件, `2` = 所有条件
|
|
224
|
+
- `--collaboration-result`:JSON —— 必填字段:`field_name`、`field_type`(string/date/table)、`field_values`(数组)。当 `field_type=table` 时,使用 `table_values: [[{field_name, field_type (仅 string/date), field_values}]]`
|
|
225
|
+
|
|
173
226
|
## 批量处理
|
|
174
227
|
|
|
175
228
|
处理多个文件/URL 时,CLI 会将每个结果写入单独的文件:
|
|
@@ -215,10 +268,22 @@ adp_results_20250417_153020/
|
|
|
215
268
|
- 应用缓存:`~/.adp/app_cache.json`
|
|
216
269
|
- 版本检查缓存:`~/.adp/version_check.json`(每 24 小时刷新)
|
|
217
270
|
|
|
218
|
-
##
|
|
271
|
+
## 📜 授权许可
|
|
272
|
+
|
|
273
|
+
我们采用 开源工具 + 付费服务 的组合模式:CLI 工具完全免费开源,方便大家快速接入;而核心的 ADP 智能解析能力为公有云商业服务,按实际使用量计费,旨在为用户提供高精准、高稳定的文档处理体验。
|
|
274
|
+
|
|
275
|
+
- **CLI 工具**:MIT License 开源许可,可自由使用、修改和分发
|
|
276
|
+
- **ADP 服务**:基于公有云的 AI 文档处理服务,按使用量计费,[计费规则](#credit)
|
|
277
|
+
|
|
278
|
+
免费额度:新用户注册后每月可获得 **100 免费积分**,可体验完整功能
|
|
279
|
+
|
|
219
280
|
|
|
220
|
-
|
|
281
|
+
## 📞 支持与联系
|
|
282
|
+
- **CLI 使用指南:** [ADP CLI 使用指南](https://laiye-tech.feishu.cn/wiki/Hz3Vw1IQki3YQtk33gLcSdwSndc)
|
|
283
|
+
- **API 接口文档:** [Open API 使用指南](https://laiye-tech.feishu.cn/wiki/PO9Jw4cH3iV2ThkMPW2c539pnkc)
|
|
284
|
+
- **ADP 产品操作手册:** [公有云操作手册](https://laiye-tech.feishu.cn/wiki/UDYIwG42pisBbFkJI39ctpeKnWh)
|
|
221
285
|
|
|
222
|
-
|
|
286
|
+
- **问题反馈:** [GitHub Issues](https://github.com/laiye-ai-repos/adp-skill/issues)
|
|
287
|
+
- **邮箱:** global_product@laiye.com
|
|
288
|
+
- **官网:** [来也科技](https://laiye.com)
|
|
223
289
|
|
|
224
|
-
跨平台构建:`make build-all VERSION=v1.0.0`。运行 E2E 测试:`bash tests/test.sh`。
|
package/bin/adp
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
const platform = process.platform;
|
|
10
|
+
const arch = process.arch;
|
|
11
|
+
const pkgName = `@laiye-adp/adp-cli-${platform}-${arch}`;
|
|
12
|
+
const binName = platform === 'win32' ? 'adp.exe' : 'adp';
|
|
13
|
+
|
|
14
|
+
function findBinPath() {
|
|
15
|
+
// Method 1: require.resolve (works for local/project installs)
|
|
16
|
+
try {
|
|
17
|
+
const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
|
|
18
|
+
const p = path.join(pkgDir, 'bin', binName);
|
|
19
|
+
if (fs.existsSync(p)) return p;
|
|
20
|
+
} catch {}
|
|
21
|
+
|
|
22
|
+
// Method 2: look in sibling node_modules (works for global installs)
|
|
23
|
+
// Global layout: <prefix>/node_modules/@laiye-adp/agentic-doc-parse-and-extract-cli/bin/adp
|
|
24
|
+
// <prefix>/node_modules/@laiye-adp/adp-cli-win32-x64/bin/adp.exe
|
|
25
|
+
const scopeDir = path.resolve(__dirname, '..', '..');
|
|
26
|
+
const p = path.join(scopeDir, `adp-cli-${platform}-${arch}`, 'bin', binName);
|
|
27
|
+
if (fs.existsSync(p)) return p;
|
|
28
|
+
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const binPath = findBinPath();
|
|
33
|
+
if (!binPath) {
|
|
34
|
+
console.error(`[adp-cli] Platform package "${pkgName}" is not installed.`);
|
|
35
|
+
console.error(`[adp-cli] Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64, win32-arm64`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
|
|
40
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laiye-adp/agentic-doc-parse-and-extract-cli",
|
|
3
|
-
"version": "1.11.0-beta.
|
|
3
|
+
"version": "1.11.0-beta.8",
|
|
4
4
|
"description": "Official CLI for Laiye ADP (Agentic Document Processing) - document parsing and intelligent extraction",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"adp",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"arm64"
|
|
40
40
|
],
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@laiye-adp/adp-cli-linux-x64": "1.11.0-beta.
|
|
43
|
-
"@laiye-adp/adp-cli-linux-arm64": "1.11.0-beta.
|
|
44
|
-
"@laiye-adp/adp-cli-darwin-x64": "1.11.0-beta.
|
|
45
|
-
"@laiye-adp/adp-cli-darwin-arm64": "1.11.0-beta.
|
|
46
|
-
"@laiye-adp/adp-cli-win32-x64": "1.11.0-beta.
|
|
47
|
-
"@laiye-adp/adp-cli-win32-arm64": "1.11.0-beta.
|
|
42
|
+
"@laiye-adp/adp-cli-linux-x64": "1.11.0-beta.8",
|
|
43
|
+
"@laiye-adp/adp-cli-linux-arm64": "1.11.0-beta.8",
|
|
44
|
+
"@laiye-adp/adp-cli-darwin-x64": "1.11.0-beta.8",
|
|
45
|
+
"@laiye-adp/adp-cli-darwin-arm64": "1.11.0-beta.8",
|
|
46
|
+
"@laiye-adp/adp-cli-win32-x64": "1.11.0-beta.8",
|
|
47
|
+
"@laiye-adp/adp-cli-win32-arm64": "1.11.0-beta.8"
|
|
48
48
|
}
|
|
49
49
|
}
|