cli-dolibarr 2.0.0__tar.gz

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.
Files changed (86) hide show
  1. cli_dolibarr-2.0.0/LICENSE +21 -0
  2. cli_dolibarr-2.0.0/PKG-INFO +434 -0
  3. cli_dolibarr-2.0.0/README.md +410 -0
  4. cli_dolibarr-2.0.0/cli_anything/dolibarr/README.md +410 -0
  5. cli_dolibarr-2.0.0/cli_anything/dolibarr/__init__.py +1 -0
  6. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/__init__.py +0 -0
  7. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/_template.py +118 -0
  8. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/accountancy.py +130 -0
  9. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/agendaevents.py +127 -0
  10. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/apibridge.py +86 -0
  11. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/bankaccounts.py +148 -0
  12. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/boms.py +211 -0
  13. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/categories.py +178 -0
  14. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/config.py +129 -0
  15. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/contacts.py +130 -0
  16. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/contracts.py +221 -0
  17. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/delivery.py +287 -0
  18. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/documents.py +118 -0
  19. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/donations.py +121 -0
  20. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/expensereports.py +135 -0
  21. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/interventions.py +135 -0
  22. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/invoices.py +265 -0
  23. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/knowledge.py +118 -0
  24. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/login.py +26 -0
  25. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/member_types.py +118 -0
  26. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/members.py +141 -0
  27. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/mobilehub.py +284 -0
  28. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/mobilehubapi.py +81 -0
  29. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/mos.py +211 -0
  30. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/multicurrencies.py +142 -0
  31. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/orderprocessor.py +275 -0
  32. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/orders.py +299 -0
  33. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/partnerships.py +124 -0
  34. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/pdfa.py +115 -0
  35. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/products.py +167 -0
  36. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/projects.py +252 -0
  37. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/proposals.py +249 -0
  38. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/quickprint.py +130 -0
  39. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/receptions.py +216 -0
  40. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/recruitments.py +124 -0
  41. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/salaries.py +138 -0
  42. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/schema.py +270 -0
  43. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/setup.py +52 -0
  44. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/shipments.py +116 -0
  45. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/status.py +42 -0
  46. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/stock.py +198 -0
  47. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/stockmodule.py +204 -0
  48. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/stockmovements.py +86 -0
  49. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/subscriptions.py +124 -0
  50. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplier_invoices.py +265 -0
  51. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplier_orders.py +259 -0
  52. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplier_proposals.py +249 -0
  53. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplierinvoices.py +263 -0
  54. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplierorders.py +268 -0
  55. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/supplierproposals.py +122 -0
  56. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/system.py +59 -0
  57. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/tasks.py +221 -0
  58. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/thirdparties.py +165 -0
  59. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/tickets.py +153 -0
  60. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/users.py +152 -0
  61. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/warehouses.py +122 -0
  62. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/webhook.py +94 -0
  63. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/workstations.py +121 -0
  64. cli_dolibarr-2.0.0/cli_anything/dolibarr/commands/zapier.py +46 -0
  65. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/__init__.py +0 -0
  66. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/client.py +111 -0
  67. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/config.py +70 -0
  68. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/output.py +127 -0
  69. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/schema_agents.py +247 -0
  70. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/schema_generator.py +593 -0
  71. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/schema_manager.py +270 -0
  72. cli_dolibarr-2.0.0/cli_anything/dolibarr/core/session_client.py +127 -0
  73. cli_dolibarr-2.0.0/cli_anything/dolibarr/dolibarr_cli.py +119 -0
  74. cli_dolibarr-2.0.0/cli_anything/dolibarr/schema.json +10832 -0
  75. cli_dolibarr-2.0.0/cli_anything/dolibarr/tests/__init__.py +0 -0
  76. cli_dolibarr-2.0.0/cli_anything/dolibarr/tests/test_core.py +311 -0
  77. cli_dolibarr-2.0.0/cli_anything/dolibarr/tests/test_full_e2e.py +248 -0
  78. cli_dolibarr-2.0.0/cli_anything/dolibarr/utils/__init__.py +0 -0
  79. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/PKG-INFO +434 -0
  80. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/SOURCES.txt +84 -0
  81. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/dependency_links.txt +1 -0
  82. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/entry_points.txt +2 -0
  83. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/requires.txt +2 -0
  84. cli_dolibarr-2.0.0/cli_dolibarr.egg-info/top_level.txt +1 -0
  85. cli_dolibarr-2.0.0/pyproject.toml +45 -0
  86. cli_dolibarr-2.0.0/setup.cfg +4 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 CLI Anything
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,434 @@
1
+ Metadata-Version: 2.4
2
+ Name: cli-dolibarr
3
+ Version: 2.0.0
4
+ Summary: CLI tool for Dolibarr ERP/CRM REST API management
5
+ Author: CLI Anything
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/zswll2/cli-dolibarr
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: System Administrators
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Office/Business
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: click>=8.0
22
+ Requires-Dist: requests>=2.25
23
+ Dynamic: license-file
24
+
25
+ # cli-dolibarr
26
+
27
+ A stateful command-line interface for managing Dolibarr ERP/CRM via its REST API. Supports third parties, products, invoices, orders, proposals, stock movements, warehouses, projects, tasks, and more.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ pip install cli-dolibarr
33
+ ```
34
+
35
+ Or install from GitHub:
36
+
37
+ ```bash
38
+ pip install git+https://github.com/zswll2/cli-dolibarr.git
39
+ ```
40
+
41
+ ## Configuration
42
+
43
+ ```bash
44
+ cli-dolibarr config init
45
+ ```
46
+
47
+ Or set environment variables:
48
+
49
+ ```bash
50
+ export DOLIBARR_URL="https://your-dolibarr.example.com/api/index.php"
51
+ export DOLIBARR_API_KEY="your_api_key"
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ### Third Parties (Customers/Companies)
57
+
58
+ ```bash
59
+ # List all third parties
60
+ cli-dolibarr thirdparties list
61
+
62
+ # Get a specific third party
63
+ cli-dolibarr thirdparties get 42
64
+
65
+ # Create a third party (required: name)
66
+ cli-dolibarr thirdparties create --name "Acme Corp"
67
+
68
+ # Update a third party
69
+ cli-dolibarr thirdparties update 42 --town "New York" --phone "+1234567890"
70
+
71
+ # Delete a third party
72
+ cli-dolibarr thirdparties delete 42
73
+ ```
74
+
75
+ ### Products
76
+
77
+ ```bash
78
+ # List products
79
+ cli-dolibarr products list
80
+
81
+ # Get a specific product
82
+ cli-dolibarr products get 7
83
+
84
+ # Create a product (required: ref, label)
85
+ cli-dolibarr products create --ref "PROD-001" --label "Widget A"
86
+
87
+ # Update a product
88
+ cli-dolibarr products update 7 --description "Updated description"
89
+
90
+ # Delete a product
91
+ cli-dolibarr products delete 7
92
+ ```
93
+
94
+ ### Invoices
95
+
96
+ ```bash
97
+ # List invoices
98
+ cli-dolibarr invoices list
99
+
100
+ # Get a specific invoice
101
+ cli-dolibarr invoices get 15
102
+
103
+ # Create an invoice (required: socid)
104
+ cli-dolibarr invoices create --socid 42
105
+
106
+ # Update an invoice
107
+ cli-dolibarr invoices update 15 --note "Payment pending"
108
+
109
+ # Delete an invoice
110
+ cli-dolibarr invoices delete 15
111
+ ```
112
+
113
+ ### Orders
114
+
115
+ ```bash
116
+ # List orders
117
+ cli-dolibarr orders list
118
+
119
+ # Get a specific order
120
+ cli-dolibarr orders get 23
121
+
122
+ # Create an order (required: socid, date)
123
+ cli-dolibarr orders create --socid 42 --date "2026-01-15"
124
+
125
+ # Update an order
126
+ cli-dolibarr orders update 23 --note "Expedited shipping"
127
+
128
+ # Delete an order
129
+ cli-dolibarr orders delete 23
130
+ ```
131
+
132
+ ### Proposals
133
+
134
+ ```bash
135
+ # List proposals
136
+ cli-dolibarr proposals list
137
+
138
+ # Get a specific proposal
139
+ cli-dolibarr proposals get 31
140
+
141
+ # Create a proposal (required: socid)
142
+ cli-dolibarr proposals create --socid 42
143
+
144
+ # Update a proposal
145
+ cli-dolibarr proposals update 31 --note "Revised terms"
146
+
147
+ # Delete a proposal
148
+ cli-dolibarr proposals delete 31
149
+ ```
150
+
151
+ ### Stock Movements
152
+
153
+ ```bash
154
+ # List stock movements
155
+ cli-dolibarr stockmovements list
156
+
157
+ # Stock in (type=3, positive qty)
158
+ cli-dolibarr stockmovements create --product-id 7 --warehouse-id 1 --qty 50
159
+
160
+ # Stock out (type=2, negative qty)
161
+ cli-dolibarr stockmovements create --product-id 7 --warehouse-id 1 --qty -10
162
+ ```
163
+
164
+ ### Warehouses
165
+
166
+ ```bash
167
+ # List warehouses
168
+ cli-dolibarr warehouses list
169
+
170
+ # Get a specific warehouse
171
+ cli-dolibarr warehouses get 1
172
+
173
+ # Create a warehouse (required: label)
174
+ cli-dolibarr warehouses create --label "Main Warehouse"
175
+
176
+ # Update a warehouse
177
+ cli-dolibarr warehouses update 1 --town "Shanghai"
178
+
179
+ # Delete a warehouse
180
+ cli-dolibarr warehouses delete 1
181
+ ```
182
+
183
+ ### Projects
184
+
185
+ ```bash
186
+ # List projects
187
+ cli-dolibarr projects list
188
+
189
+ # Get a specific project
190
+ cli-dolibarr projects get 5
191
+
192
+ # Create a project (required: title)
193
+ cli-dolibarr projects create --title "Website Redesign"
194
+
195
+ # Update a project
196
+ cli-dolibarr projects update 5 --description "Phase 2 started"
197
+
198
+ # Delete a project
199
+ cli-dolibarr projects delete 5
200
+ ```
201
+
202
+ ### Tasks
203
+
204
+ ```bash
205
+ # List tasks
206
+ cli-dolibarr tasks list
207
+
208
+ # Get a specific task
209
+ cli-dolibarr tasks get 12
210
+
211
+ # Create a task (requires project context)
212
+ cli-dolibarr tasks create --title "Design mockups" --project-id 5
213
+
214
+ # Update a task
215
+ cli-dolibarr tasks update 12 --progress 75
216
+
217
+ # Delete a task
218
+ cli-dolibarr tasks delete 12
219
+ ```
220
+
221
+ ## Global Options
222
+
223
+ | Option | Description |
224
+ |-----------------|------------------------------------|
225
+ | `--json` | Output in JSON format |
226
+ | `--csv` | Output in CSV format |
227
+ | `--url` | Override Dolibarr API URL |
228
+ | `--api-key` | Override API key |
229
+ | `--limit N` | Limit results to N items |
230
+ | `--verify` | Enable SSL certificate verification|
231
+
232
+ ```bash
233
+ # Example: JSON output with limit
234
+ cli-dolibarr products list --json --limit 5
235
+
236
+ # Example: CSV output
237
+ cli-dolibarr invoices list --csv
238
+
239
+ # Example: Override URL and API key
240
+ cli-dolibarr thirdparties list --url "https://your-dolibarr.example.com/api/index.php" --api-key "your_api_key"
241
+ ```
242
+
243
+ ## REPL Mode
244
+
245
+ Start an interactive session for repeated commands without re-authenticating:
246
+
247
+ ```bash
248
+ cli-dolibarr repl
249
+ ```
250
+
251
+ Inside the REPL, use commands directly:
252
+
253
+ ```
254
+ dolibarr> thirdparties list
255
+ dolibarr> products get 7
256
+ dolibarr> exit
257
+ ```
258
+
259
+ ## Environment Variables
260
+
261
+ | Variable | Description |
262
+ |---------------------|--------------------------------------|
263
+ | `DOLIBARR_URL` | Full API URL (e.g., `https://your-dolibarr.example.com/api/index.php`) |
264
+ | `DOLIBARR_API_KEY` | API key from Dolibarr user settings |
265
+ | `DOLIBARR_VERIFY_SSL`| Set to `1` or `true` to verify SSL |
266
+
267
+ ## SQL Filters
268
+
269
+ Use the `--sql-filter` option to apply advanced filters on list commands:
270
+
271
+ ```bash
272
+ # Filter by name pattern
273
+ cli-dolibarr thirdparties list --sql-filter "(t.name:like:'Acme%')"
274
+
275
+ # Filter by date range
276
+ cli-dolibarr invoices list --sql-filter "(t.datec:>=:'2026-01-01')"
277
+
278
+ # Combined filters
279
+ cli-dolibarr products list --sql-filter "(t.toselect:=:1) and (t.status:=:1)"
280
+
281
+ # IN operator
282
+ cli-dolibarr orders list --sql-filter "(t.status:IN:1,2,3)"
283
+ ```
284
+
285
+ Operators: `:=`, `:like:`, `:<`, `:>`, `:<=`, `:>=`, `:!=`, `:IN:`, `:NOTIN:`
286
+
287
+ ## SSL Verification
288
+
289
+ By default, SSL verification is **disabled** (`--no-verify`) to support self-signed certificates common in self-hosted Dolibarr installations. To enable verification:
290
+
291
+ ```bash
292
+ cli-dolibarr --verify thirdparties list
293
+ ```
294
+
295
+ Or set the environment variable:
296
+
297
+ ```bash
298
+ export DOLIBARR_VERIFY_SSL="true"
299
+ ```
300
+
301
+ ## Schema Management
302
+
303
+ Built-in schema-driven API discovery system for keeping CLI commands in sync with Dolibarr API changes.
304
+
305
+ ```bash
306
+ # Fetch latest API spec from Dolibarr
307
+ cli-dolibarr schema sync
308
+
309
+ # Check coverage (which endpoints have CLI commands)
310
+ cli-dolibarr schema diff
311
+
312
+ # Auto-generate CLI commands for uncovered endpoints
313
+ cli-dolibarr schema generate --all
314
+
315
+ # Preview without writing files
316
+ cli-dolibarr schema generate --all --dry-run
317
+
318
+ # Generate AI code map (AGENTS.md)
319
+ cli-dolibarr schema agents
320
+
321
+ # Export endpoint data for AI fine-tuning
322
+ cli-dolibarr schema export --format jsonl --output data.jsonl
323
+ ```
324
+
325
+ ## Available Commands
326
+
327
+ 49 command groups covering all Dolibarr REST API resources: thirdparties, products, invoices, orders, proposals, shipments, projects, tasks, warehouses, stockmovements, contacts, bankaccounts, categories, users, tickets, webhooks, and more. Run `cli-dolibarr --help` for the full list.
328
+
329
+ ---
330
+
331
+ ## 中文说明
332
+
333
+ Dolibarr ERP/CRM REST API 的命令行管理工具。支持客户、产品、发票、订单、报价、库存、仓库、项目、任务等 49 个模块。
334
+
335
+ ### 安装
336
+
337
+ ```bash
338
+ pip install cli-dolibarr
339
+ ```
340
+
341
+ 或从 GitHub 安装:
342
+
343
+ ```bash
344
+ pip install git+https://github.com/zswll2/cli-dolibarr.git
345
+ ```
346
+
347
+ ### 配置
348
+
349
+ ```bash
350
+ # 交互式配置(输入 URL 和 API Key)
351
+ cli-dolibarr config init
352
+
353
+ # 或使用环境变量
354
+ export DOLIBARR_URL="https://your-dolibarr.example.com/api/index.php"
355
+ export DOLIBARR_API_KEY="your_api_key"
356
+ ```
357
+
358
+ ### 常用命令
359
+
360
+ ```bash
361
+ # 客户管理
362
+ cli-dolibarr thirdparties list # 列出所有客户
363
+ cli-dolibarr thirdparties get 42 # 查看客户详情
364
+ cli-dolibarr thirdparties create --name "Acme Corp" # 创建客户
365
+
366
+ # 产品管理
367
+ cli-dolibarr products list # 列出产品
368
+ cli-dolibarr products create --ref "P001" --label "产品A" # 创建产品
369
+
370
+ # 发票管理
371
+ cli-dolibarr invoices list # 列出发票
372
+ cli-dolibarr invoices create --socid 42 # 创建发票
373
+
374
+ # 订单管理
375
+ cli-dolibarr orders list # 列出订单
376
+ cli-dolibarr orders create --socid 42 --date "2026-01-15" # 创建订单
377
+
378
+ # 库存管理
379
+ cli-dolibarr stockmovements create --product-id 7 --warehouse-id 1 --qty 50 # 入库
380
+ cli-dolibarr stockmovements create --product-id 7 --warehouse-id 1 --qty -10 # 出库
381
+
382
+ # 项目与任务
383
+ cli-dolibarr projects list # 列出项目
384
+ cli-dolibarr tasks list # 列出任务
385
+ ```
386
+
387
+ ### Schema 管理系统
388
+
389
+ 内置 API 自动发现系统,Dolibarr 升级后可自动同步新端点:
390
+
391
+ ```bash
392
+ cli-dolibarr schema sync # 从 Dolibarr 拉取最新 API 定义
393
+ cli-dolibarr schema diff # 查看覆盖情况(哪些有命令、哪些没有)
394
+ cli-dolibarr schema generate --all # 自动生成缺失的 CLI 命令
395
+ cli-dolibarr schema agents # 生成 AI 代码地图 (AGENTS.md)
396
+ cli-dolibarr schema export --format jsonl --output data.jsonl # 导出微调数据
397
+ ```
398
+
399
+ ### 输出格式
400
+
401
+ ```bash
402
+ cli-dolibarr --json products list # JSON 格式
403
+ cli-dolibarr --csv invoices list # CSV 格式(可导入 Excel)
404
+ ```
405
+
406
+ ### 全局选项
407
+
408
+ | 选项 | 说明 |
409
+ |------|------|
410
+ | `--json` | JSON 格式输出 |
411
+ | `--csv` | CSV 格式输出 |
412
+ | `--url` | 覆盖 API URL |
413
+ | `--api-key` | 覆盖 API Key |
414
+ | `--limit N` | 限制返回条数 |
415
+ | `--verify` | 启用 SSL 证书验证 |
416
+
417
+ ### 交互模式
418
+
419
+ ```bash
420
+ cli-dolibarr repl
421
+ # 进入后可直接输入命令:
422
+ # doli> thirdparties list
423
+ # doli> products get 7
424
+ # doli> exit
425
+ ```
426
+
427
+ ### SQL 过滤器
428
+
429
+ ```bash
430
+ cli-dolibarr thirdparties list --sql-filter "(t.name:like:'Acme%')" # 按名称筛选
431
+ cli-dolibarr invoices list --sql-filter "(t.datec:>=:'2026-01-01')" # 按日期筛选
432
+ ```
433
+
434
+ 支持的操作符:`:=`, `:like:`, `:<`, `:>`, `:<=`, `:>=`, `:!=`, `:IN:`, `:NOTIN:`