jaz-clio 4.49.1 → 4.50.1
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 +1 -1
- package/assets/skills/api/SKILL.md +1 -1
- package/assets/skills/api/references/search-enums.md +1 -1
- package/assets/skills/api/references/search-reference.md +5 -5
- package/assets/skills/cli/SKILL.md +27 -1
- package/assets/skills/cli/references/agent-gotchas.md +36 -0
- package/assets/skills/cli/references/error-recovery.md +112 -0
- package/assets/skills/cli/references/output-shapes.md +181 -0
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +1 -1
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/cli.mjs +511 -513
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ clio search "overdue" # Find it across all entities
|
|
|
51
51
|
|
|
52
52
|
## MCP Server
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
242 CLI tools, available to any AI agent that speaks MCP. Runs locally — no cloud, no ports.
|
|
55
55
|
|
|
56
56
|
**Claude Code:**
|
|
57
57
|
```bash
|
|
@@ -271,7 +271,7 @@ No enum fields. String filters only: `categoryCode`, `typeName`, `typeCode`, `re
|
|
|
271
271
|
|-------|-------------|
|
|
272
272
|
| `status` | `ACTIVE`, `INACTIVE` |
|
|
273
273
|
| `subscriptionStatus` | `ACTIVE`, `CANCELLED`, `INACTIVE` |
|
|
274
|
-
| `interval` | `ONE_TIME`, `DAILY`, `WEEKLY`, `MONTHLY`, `YEARLY` |
|
|
274
|
+
| `interval` | `ONE_TIME`, `DAILY`, `WEEKLY`, `MONTHLY`, `QUARTERLY`, `YEARLY` |
|
|
275
275
|
|
|
276
276
|
**Amount fields**: `totalAmount`, `paymentRecordedAmount`
|
|
277
277
|
**Date fields**: `startDate`, `endDate`, `lastScheduleDate`, `nextScheduleDate`, `proratedStartDate`
|
|
@@ -169,7 +169,7 @@ To convert response dates: `new Date(epochMs).toISOString().slice(0, 10)` → `Y
|
|
|
169
169
|
| `contact` | ContactNestedFilter | Nested: name, resourceId, status, taxId |
|
|
170
170
|
| `valueDate` | DateExpression | |
|
|
171
171
|
| `dueDate` | DateExpression | |
|
|
172
|
-
| `tags` | StringExpression | |
|
|
172
|
+
| `tags` | Nested: `name` (StringExpression) | |
|
|
173
173
|
| `currencyCode` | StringExpression | |
|
|
174
174
|
| `approvalStatus` | StringExpression | |
|
|
175
175
|
| `approvedAt` | DateExpression | |
|
|
@@ -206,7 +206,7 @@ To convert response dates: `new Date(epochMs).toISOString().slice(0, 10)` → `Y
|
|
|
206
206
|
| `valueDate` | DateExpression | |
|
|
207
207
|
| `dueDate` | DateExpression | |
|
|
208
208
|
| `terms` | IntExpression | |
|
|
209
|
-
| `tags` | StringExpression | |
|
|
209
|
+
| `tags` | Nested: `name` (StringExpression) | |
|
|
210
210
|
| `currencyCode` | StringExpression | |
|
|
211
211
|
| `approvalStatus` | StringExpression | |
|
|
212
212
|
| `submittedBy` | UserNestedFilter | |
|
|
@@ -239,7 +239,7 @@ To convert response dates: `new Date(epochMs).toISOString().slice(0, 10)` → `Y
|
|
|
239
239
|
| `contactResourceId` | StringExpression |
|
|
240
240
|
| `status` | StringExpression |
|
|
241
241
|
| `reference` | StringExpression |
|
|
242
|
-
| `tags` | StringExpression |
|
|
242
|
+
| `tags` | Nested: `name` (StringExpression) |
|
|
243
243
|
| `valueDate` | DateExpression |
|
|
244
244
|
| `contact` | ContactNestedFilter |
|
|
245
245
|
| `currencyCode` | StringExpression |
|
|
@@ -274,7 +274,7 @@ To convert response dates: `new Date(epochMs).toISOString().slice(0, 10)` → `Y
|
|
|
274
274
|
| Field | Type | Notes |
|
|
275
275
|
|-------|------|-------|
|
|
276
276
|
| `resourceId` | StringExpression | |
|
|
277
|
-
| `tags` | StringExpression | |
|
|
277
|
+
| `tags` | Nested: `name` (StringExpression) | |
|
|
278
278
|
| `reference` | StringExpression | |
|
|
279
279
|
| `status` | StringExpression | |
|
|
280
280
|
| `contact` | ContactNestedFilter | |
|
|
@@ -548,7 +548,7 @@ To convert response dates: `new Date(epochMs).toISOString().slice(0, 10)` → `Y
|
|
|
548
548
|
| `disposalType` | StringExpression |
|
|
549
549
|
| `typeName` | StringExpression |
|
|
550
550
|
| `typeCode` | StringExpression |
|
|
551
|
-
| `tags` | StringExpression |
|
|
551
|
+
| `tags` | Nested: `name` (StringExpression) |
|
|
552
552
|
| `status` | StringExpression |
|
|
553
553
|
| `registrationType` | StringExpression |
|
|
554
554
|
| `purchaseBusinessTransactionType` | StringExpression |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jaz-cli
|
|
3
|
-
version: 4.
|
|
3
|
+
version: 4.50.1
|
|
4
4
|
description: >-
|
|
5
5
|
Use this skill when running Clio CLI commands, building shell scripts with
|
|
6
6
|
Clio, debugging auth issues, understanding --json output, paginating results,
|
|
@@ -26,6 +26,18 @@ You are working with **Clio** (`jaz-clio`) — the CLI for the Jaz accounting pl
|
|
|
26
26
|
- Chaining multi-step accounting workflows (create -> finalize -> pay -> verify)
|
|
27
27
|
- Answering "what commands are available?" or "how do I do X from the CLI?"
|
|
28
28
|
|
|
29
|
+
## Skill Relationships
|
|
30
|
+
|
|
31
|
+
| Need | Skill |
|
|
32
|
+
|------|-------|
|
|
33
|
+
| CLI command syntax, flags, output | **jaz-cli** (this skill) |
|
|
34
|
+
| API field names, error codes, 117 gotchas | **jaz-api** |
|
|
35
|
+
| IFRS transaction recipes (depreciation, leases, loans) | **jaz-recipes** |
|
|
36
|
+
| Month-end close, bank recon, GST filing workflows | **jaz-jobs** |
|
|
37
|
+
| Migration from Xero/QuickBooks/Sage | **jaz-conversion** |
|
|
38
|
+
|
|
39
|
+
Use **jaz-cli** when running commands. Use **jaz-api** when debugging API errors or understanding field mappings.
|
|
40
|
+
|
|
29
41
|
## Auth Precedence
|
|
30
42
|
|
|
31
43
|
Resolution stops at the first match. Higher priority wins silently.
|
|
@@ -93,6 +105,8 @@ clio journals create --account "Bank - SGD" # Resolves by account name
|
|
|
93
105
|
clio journals create --account "1000" # Resolves by account code
|
|
94
106
|
```
|
|
95
107
|
|
|
108
|
+
> **IMPORTANT for agents:** Fuzzy matching works for `--contact` and top-level `--account` flags. It does NOT work inside `--lines` JSON arrays. Line item `accountResourceId` must be a UUID or exact account name.
|
|
109
|
+
|
|
96
110
|
## Pagination
|
|
97
111
|
|
|
98
112
|
All list/search commands support pagination. Two modes:
|
|
@@ -173,6 +187,8 @@ When `--input` or stdin provides a body, CLI flags are ignored.
|
|
|
173
187
|
|
|
174
188
|
**Organization**: `org` (info), `org-users`, `auth`
|
|
175
189
|
|
|
190
|
+
**Introspection**: `schema` (list groups, inspect tools, show params), `health` (version, connectivity, environment checks)
|
|
191
|
+
|
|
176
192
|
**Utilities**: `help-center` (alias: `hc`), `context`, `mcp`, `serve`, `init`, `versions`, `update`
|
|
177
193
|
|
|
178
194
|
See `references/command-catalog.md` for the full catalog with subcommands and flags.
|
|
@@ -259,6 +275,16 @@ clio ct loan --principal 100000 --rate 5 --term 60 --start-date 2026-01-01 \
|
|
|
259
275
|
|
|
260
276
|
See `references/common-workflows.md` for end-to-end multi-command patterns.
|
|
261
277
|
|
|
278
|
+
## Agent Gotchas (Top 5)
|
|
279
|
+
|
|
280
|
+
1. **Create returns only {resourceId}.** Always `get` afterward for full data.
|
|
281
|
+
2. **Line-item accounts don't fuzzy-resolve.** Use UUID or exact name.
|
|
282
|
+
3. **Cash entries finalize immediately.** Unlike invoices which default to draft.
|
|
283
|
+
4. **--offset is page number (0-indexed), not row count.**
|
|
284
|
+
5. **JAZ_API_KEY env overrides --org.** Unset to use profiles.
|
|
285
|
+
|
|
286
|
+
See [references/agent-gotchas.md](./references/agent-gotchas.md) for the full list of 15 gotchas. See [references/output-shapes.md](./references/output-shapes.md) for `--json` output structures. See [references/error-recovery.md](./references/error-recovery.md) for 30+ error patterns with fixes.
|
|
287
|
+
|
|
262
288
|
## See Also
|
|
263
289
|
|
|
264
290
|
- **jaz-api** — Field names, endpoints, error codes, and 117 production gotchas
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Agent Gotchas
|
|
2
|
+
|
|
3
|
+
> 15 critical gotchas for AI agents using the CLI. Learned from production testing.
|
|
4
|
+
> Violating these causes silent data errors or wasted API calls.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
1. **Cash entries finalize immediately.** `clio cash-in` and `clio cash-out` default to `saveAsDraft: false` (API default). Unlike invoices/bills/journals which the CLI overrides to draft. Use `--finalize` on invoices to finalize; cash entries are already final.
|
|
9
|
+
|
|
10
|
+
2. **Line-item account resolution is NOT fuzzy.** The `accountResourceId` field inside `--lines` JSON arrays requires a UUID or exact account name. Fuzzy matching only works for top-level flags (`--contact`, `--account`). Always resolve accounts first: `clio accounts list --json | jq '.data[] | {name, id: .resourceId}'`.
|
|
11
|
+
|
|
12
|
+
3. **Create responses are minimal.** All create commands return only `{ "resourceId": "uuid" }`. To get the full entity (status, amounts, line items), run `clio <entity> get <id> --json` afterward.
|
|
13
|
+
|
|
14
|
+
4. **--offset is page number (0-indexed), not row skip count.** `--offset 0 --limit 100` = rows 1-100. `--offset 1 --limit 100` = rows 101-200. This is not the same as SQL OFFSET.
|
|
15
|
+
|
|
16
|
+
5. **--all caps at 10,000 rows by default.** For large orgs, pass `--max-rows 50000` explicitly. The CLI auto-paginates with concurrent requests and shows progress on stderr.
|
|
17
|
+
|
|
18
|
+
6. **JAZ_API_KEY env var overrides --org and active profile.** If set, all commands use that key regardless of `--org` or `clio auth switch`. Run `unset JAZ_API_KEY` to restore profile-based auth. Run `echo $JAZ_API_KEY` to check.
|
|
19
|
+
|
|
20
|
+
7. **--json output goes to stdout; errors go to stderr.** Piping `clio invoices list --json | jq .` works cleanly. Resolution feedback ("Contact: Acme Corp (abc1234...)") is on stderr and won't corrupt JSON. Always parse stdout only.
|
|
21
|
+
|
|
22
|
+
8. **Dates are YYYY-MM-DD in org-local timezone.** Not UTC, not epoch. The API stores dates without time component. `--date 2026-03-15` means March 15 in the org's configured timezone.
|
|
23
|
+
|
|
24
|
+
9. **Currency codes are uppercase ISO 4217.** `SGD`, `USD`, `EUR` -- not `sgd`, `usd`. Lowercase will be rejected by the API with a validation error.
|
|
25
|
+
|
|
26
|
+
10. **The `customer` and `supplier` fields on contacts are booleans.** `{ "customer": true, "supplier": false }` -- not strings. A contact can be both customer and supplier simultaneously.
|
|
27
|
+
|
|
28
|
+
11. **Search returns results grouped by entity type, not a flat array.** `clio search "Acme" --json` returns `{ contacts: [...], sales: [...], purchases: [...], ... }`. Each key may be empty. Always access the specific entity key you need.
|
|
29
|
+
|
|
30
|
+
12. **`clio schema` is for tool introspection, not data.** `clio schema --json` lists command groups and tool counts. `clio schema invoices --json` shows tool definitions. `clio schema invoices create --json` shows parameter schema. None of these hit the API.
|
|
31
|
+
|
|
32
|
+
13. **Job blueprints output plain text by default.** `clio jobs month-end` prints a checklist. Add `--json` for structured output. Some job tools (`match`, `outstanding`, `sg-cs`) require auth; blueprint generators are offline.
|
|
33
|
+
|
|
34
|
+
14. **Capsule-transaction recipes: always `--plan` first.** `clio ct loan --plan` shows what accounts and transactions will be created, offline. Only run without `--plan` when you know the account mapping is correct. Recipes create real finalized transactions.
|
|
35
|
+
|
|
36
|
+
15. **The `--input` flag reads JSON from a file.** For complex payloads (multi-line-item invoices, detailed journals), write JSON to a temp file and pass `--input payload.json` instead of long `--lines` flags with shell escaping issues. When `--input` is provided, all other body flags are ignored.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# CLI Error Recovery Guide
|
|
2
|
+
|
|
3
|
+
> 30+ error patterns with root cause and fix. Grouped by category.
|
|
4
|
+
> CLI errors go to stderr. Exit codes: 0 = success, 1 = user error, 2 = API/network error, 3 = auth error.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Auth Errors (Exit 3)
|
|
9
|
+
|
|
10
|
+
| Error | Cause | Fix |
|
|
11
|
+
|-------|-------|-----|
|
|
12
|
+
| `No API key configured` | No auth source found in resolution chain | `clio auth add jk-xxx` or `export JAZ_API_KEY=jk-xxx` |
|
|
13
|
+
| `Invalid API key` | Key doesn't start with `jk-` or is malformed | Verify key format: must be `jk-` prefix + UUID |
|
|
14
|
+
| `Unauthorized (401)` | Key expired, revoked, or wrong org | Run `clio auth whoami` to check; re-add key with `clio auth add` |
|
|
15
|
+
| `--api-key and --org cannot be used together` | Conflicting auth flags | Use one or the other, not both |
|
|
16
|
+
| `Profile 'xyz' not found` | `--org xyz` references non-existent profile | Run `clio auth list` to see available profiles |
|
|
17
|
+
| `JAZ_API_KEY overrides --org` | Env var takes precedence silently | `unset JAZ_API_KEY` before using `--org` or `clio auth switch` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Entity Resolution Errors (Exit 1)
|
|
22
|
+
|
|
23
|
+
| Error | Cause | Fix |
|
|
24
|
+
|-------|-------|-----|
|
|
25
|
+
| `Multiple contacts match 'Acme'` | Fuzzy match found 2+ candidates above threshold | Use exact billingName or UUID |
|
|
26
|
+
| `Contact not found: 'xyz'` | No match in org's contact list | Run `clio contacts search xyz` to check spelling |
|
|
27
|
+
| `Account not found: 'xyz'` | No matching account name or code | Run `clio accounts list --json` to see available accounts |
|
|
28
|
+
| `Bank account not found` | Name doesn't match any bank-type account | Run `clio bank accounts --json` for exact names |
|
|
29
|
+
| `Tax profile not found` | No match on tax profile name or code | Run `clio tax-profiles list --json` for available profiles |
|
|
30
|
+
| `Multiple accounts match` | Ambiguous account name | Use account code (e.g., `1000`) or UUID instead |
|
|
31
|
+
|
|
32
|
+
**Key rule**: Contact resolution is fuzzy. Account resolution in `--lines` JSON is NOT fuzzy -- use UUID or exact name.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Validation Errors (Exit 1)
|
|
37
|
+
|
|
38
|
+
| Error | Cause | Fix |
|
|
39
|
+
|-------|-------|-----|
|
|
40
|
+
| `missing required option(s): --contact, --lines` | Required flag not provided | Add the missing flags |
|
|
41
|
+
| `lineItems[0].accountResourceId is required` | Line item missing account (required for finalized) | Add accountResourceId to each line item |
|
|
42
|
+
| `currency is required` | FX transaction without currency | Add `--currency SGD` (or target currency) |
|
|
43
|
+
| `contactResourceId is required` | Transaction without contact | Add `--contact "Name"` or `--contact <uuid>` |
|
|
44
|
+
| `valueDate is required` | Transaction without date | Add `--date YYYY-MM-DD` |
|
|
45
|
+
| `journalEntries must have equal debits and credits` | Journal out of balance | Ensure DEBIT total equals CREDIT total |
|
|
46
|
+
| `At least one line item is required` | Empty --lines array | Provide at least one line item object |
|
|
47
|
+
| `Invalid date format` | Date not in YYYY-MM-DD | Use ISO format: `--date 2026-03-15` |
|
|
48
|
+
| `unitPrice must be a number` | String passed for numeric field | Remove quotes from numeric values in JSON |
|
|
49
|
+
| `Invalid status filter` | Wrong status value for entity type | Check valid statuses: DRAFT, APPROVED, PAID, VOIDED, DELETED |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Pagination Errors (Exit 1)
|
|
54
|
+
|
|
55
|
+
| Error | Cause | Fix |
|
|
56
|
+
|-------|-------|-----|
|
|
57
|
+
| `--all and --offset cannot be combined` | Conflicting pagination modes | Use either `--all` or `--offset`, not both |
|
|
58
|
+
| `offset must be >= 0` | Negative offset value | Offset is 0-indexed page number (0 = first page) |
|
|
59
|
+
| `limit must be between 1 and 100` | Out-of-range page size | Max 100 per page; use `--all` for larger fetches |
|
|
60
|
+
| `Result truncated (10000 row cap)` | `--all` hit default max-rows | Add `--max-rows 50000` to increase the cap |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## API / Network Errors (Exit 1 or 2)
|
|
65
|
+
|
|
66
|
+
| Error | Cause | Fix |
|
|
67
|
+
|-------|-------|-----|
|
|
68
|
+
| `ECONNREFUSED` | API server unreachable | Check network connection; verify API URL |
|
|
69
|
+
| `ETIMEDOUT` | Request timed out | Retry; check for slow network or large payload |
|
|
70
|
+
| `429 Too Many Requests` | Rate limited by API | Wait 30-60 seconds and retry |
|
|
71
|
+
| `API error 422: ...` | Server-side validation failure | Read the error message -- it names the bad field |
|
|
72
|
+
| `API error 400: ...` | Malformed request body | Check JSON syntax in `--lines` or `--input` |
|
|
73
|
+
| `API error 404: ...` | Endpoint or resource not found | Verify resourceId exists; check command spelling |
|
|
74
|
+
| `API error 500: ...` | Server-side error | Retry once; if persistent, check API status |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## File / Input Errors (Exit 1)
|
|
79
|
+
|
|
80
|
+
| Error | Cause | Fix |
|
|
81
|
+
|-------|-------|-----|
|
|
82
|
+
| `File not found: ./payload.json` | `--input` path doesn't exist | Check file path and working directory |
|
|
83
|
+
| `Invalid JSON in input file` | Malformed JSON in `--input` file | Validate with `jq . payload.json` before passing |
|
|
84
|
+
| `Unexpected token in JSON` | Bad JSON in `--lines` flag | Escape quotes properly; use single quotes around JSON |
|
|
85
|
+
| `Bank file format not supported` | Unsupported statement format | Supported: CSV, OFX, QIF, XLS, XLSX |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Recovery Patterns
|
|
90
|
+
|
|
91
|
+
**Auth not working?** Systematic diagnosis:
|
|
92
|
+
```bash
|
|
93
|
+
clio auth whoami # Check current auth source
|
|
94
|
+
clio auth list # See all saved profiles
|
|
95
|
+
echo $JAZ_API_KEY # Check for env override
|
|
96
|
+
echo $JAZ_ORG # Check for pinned org
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Entity not found?** Search before creating:
|
|
100
|
+
```bash
|
|
101
|
+
clio contacts search "partial name" --json | jq '.data[] | {name, resourceId}'
|
|
102
|
+
clio accounts list --json | jq '.data[] | {name, code: .accountCode, id: .resourceId}'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Create failed?** Check the draft first:
|
|
106
|
+
```bash
|
|
107
|
+
# Validate JSON offline
|
|
108
|
+
echo '[{"name":"Item","quantity":1,"unitPrice":100}]' | jq .
|
|
109
|
+
|
|
110
|
+
# Try without --finalize (less strict validation)
|
|
111
|
+
clio invoices create --contact "Acme" --date 2026-01-15 --lines '[...]'
|
|
112
|
+
```
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# CLI Output Shapes
|
|
2
|
+
|
|
3
|
+
> `--json` output shapes from real CLI runs. Use these for `jq` pipelines.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## List Commands (Paginated Envelope)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
clio invoices list --json # Any list command: invoices, contacts, bills, etc.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"totalElements": 7297,
|
|
16
|
+
"totalPages": 73,
|
|
17
|
+
"truncated": false,
|
|
18
|
+
"data": [{ "resourceId": "...", "reference": "INV-175", "status": "DRAFT", ... }]
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Optional when truncated: `"_meta": { "fetchedRows": 10000, "maxRows": 10000 }`
|
|
23
|
+
|
|
24
|
+
**jq examples:**
|
|
25
|
+
```bash
|
|
26
|
+
clio invoices list --json | jq '.data[] | {ref: .reference, amount: .totalAmount, status}'
|
|
27
|
+
clio contacts list --all --json | jq '[.data[].resourceId]'
|
|
28
|
+
clio invoices list --all --json | jq '.truncated'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Key fields by entity
|
|
32
|
+
|
|
33
|
+
**Invoices/Bills**: reference, status, valueDate, dueDate, contactResourceId, terms, resourceId, isTaxVATApplicable, taxInclusion, lineItems, billFrom, contact, subTotal, totalShipping, totalVat, totalAmount, currencyCode, currencySymbol, taxCurrencyExchange
|
|
34
|
+
|
|
35
|
+
**Contacts**: addresses, contactGroups, contactPeople, currencyCode, customer, jazMagicAutofill, name, billingName, organizationId, paymentDetail, resourceId, status, supplier, theyOwe, youOwe, createdAt
|
|
36
|
+
|
|
37
|
+
**Journals**: reference, status, valueDate, resourceId, journalEntries, totalDebit, totalCredit, currencyCode
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Get Commands (Single Entity)
|
|
42
|
+
|
|
43
|
+
Returns the full entity object directly (no envelope).
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
clio invoices get <id> --json # → { resourceId, reference, status, ... }
|
|
47
|
+
clio contacts get <id> --json # → { resourceId, name, theyOwe, youOwe, ... }
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**jq examples:**
|
|
51
|
+
```bash
|
|
52
|
+
clio invoices get "$ID" --json | jq '{status, totalAmount, reference}'
|
|
53
|
+
clio contacts get "$ID" --json | jq '{name, theyOwe, youOwe}'
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Create Commands (Minimal Response)
|
|
59
|
+
|
|
60
|
+
All create commands return only `{ resourceId: string }`. Fetch full data afterward.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
ID=$(clio invoices create --contact "Acme" --date 2026-01-15 --lines '[...]' --json | jq -r '.resourceId')
|
|
64
|
+
clio invoices get "$ID" --json # Now you have the full record
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Search Command (Multi-Entity)
|
|
70
|
+
|
|
71
|
+
Universal search returns results grouped by entity type.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
clio search "Acme" --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"contacts": [],
|
|
80
|
+
"sales": [],
|
|
81
|
+
"purchases": [],
|
|
82
|
+
"journals": [],
|
|
83
|
+
"credit_notes": [],
|
|
84
|
+
"sale_items": [],
|
|
85
|
+
"purchase_items": [],
|
|
86
|
+
"sale_credit_note_items": [],
|
|
87
|
+
"purchase_credit_note_items": [],
|
|
88
|
+
"supplier_notes": []
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**jq examples:**
|
|
93
|
+
```bash
|
|
94
|
+
clio search "Acme" --json | jq '.contacts[] | {name, resourceId}'
|
|
95
|
+
clio search "laptop" --json | jq 'to_entries | map({key, count: (.value | length)})'
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Calc Commands (Calculator Output)
|
|
101
|
+
|
|
102
|
+
Offline calculators return structured results with an amortization schedule.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
clio calc loan --principal 10000 --rate 5 --term 12 --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"type": "loan",
|
|
111
|
+
"currency": null,
|
|
112
|
+
"inputs": { "principal": 10000, "annualRate": 5, "termMonths": 12, "startDate": null },
|
|
113
|
+
"monthlyPayment": 856.07,
|
|
114
|
+
"totalPayments": 10272.89,
|
|
115
|
+
"totalInterest": 272.89,
|
|
116
|
+
"totalPrincipal": 10000,
|
|
117
|
+
"schedule": [{ "period": 1, "date": "2025-02-01", "openingBalance": 10000, "payment": 856.07, "interest": 41.67, "principal": 814.40, "closingBalance": 9185.60, "journal": {...} }],
|
|
118
|
+
"blueprint": { ... }
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**jq examples:**
|
|
123
|
+
```bash
|
|
124
|
+
clio calc loan --principal 10000 --rate 5 --term 12 --json | jq '.monthlyPayment'
|
|
125
|
+
clio calc loan --principal 10000 --rate 5 --term 12 --json | jq '.schedule[-1].closingBalance'
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Health Command
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
clio health --json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"version": "4.50.0",
|
|
139
|
+
"checks": [
|
|
140
|
+
{ "name": "CLI version", "status": "ok", "value": "4.50.0" },
|
|
141
|
+
{ "name": "Node.js", "status": "ok", "value": "v24.6.0" },
|
|
142
|
+
{ "name": "Auth", "status": "ok", "value": "global-sg-demo (Global SG Demo, SGD)", "detail": "connected" },
|
|
143
|
+
{ "name": "API connection", "status": "ok", "value": "200 OK (142ms)" }
|
|
144
|
+
],
|
|
145
|
+
"ok": true
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Each check has: `name`, `status` ("ok"/"warn"/"fail"), `value`, and optional `detail` (actionable hint).
|
|
150
|
+
|
|
151
|
+
**jq examples:**
|
|
152
|
+
```bash
|
|
153
|
+
clio health --json | jq '.ok'
|
|
154
|
+
clio health --json | jq '.checks[] | select(.status != "ok")'
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Schema Command (Tool Introspection)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
clio schema --json
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"totalTools": 243,
|
|
168
|
+
"totalGroups": 39,
|
|
169
|
+
"groups": [
|
|
170
|
+
{ "group": "invoices", "tools": 10, "read": 4, "write": 6, "cliCommand": "clio invoices" }
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**jq examples:**
|
|
176
|
+
```bash
|
|
177
|
+
clio schema --json | jq '.groups[].group'
|
|
178
|
+
clio schema --json | jq '.groups[] | select(.write > 0) | {group, write}'
|
|
179
|
+
clio schema invoices --json # Tool definitions for a group
|
|
180
|
+
clio schema invoices create --json # Parameter schema for a specific tool
|
|
181
|
+
```
|