jaz-clio 4.35.0 → 4.35.2

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 (69) hide show
  1. package/assets/skills/api/SKILL.md +1 -1
  2. package/assets/skills/cli/SKILL.md +1 -1
  3. package/assets/skills/conversion/SKILL.md +1 -1
  4. package/assets/skills/jobs/SKILL.md +1 -1
  5. package/assets/skills/transaction-recipes/SKILL.md +1 -1
  6. package/dist/commands/accounts.js +6 -6
  7. package/dist/commands/attachments.js +8 -8
  8. package/dist/commands/auth.js +41 -41
  9. package/dist/commands/bank-rules.js +14 -14
  10. package/dist/commands/bank.js +27 -27
  11. package/dist/commands/bills.js +35 -35
  12. package/dist/commands/bookmarks.js +8 -8
  13. package/dist/commands/calc.js +2 -2
  14. package/dist/commands/capsules.js +14 -14
  15. package/dist/commands/cash-entry.js +16 -16
  16. package/dist/commands/cash-transfer.js +4 -4
  17. package/dist/commands/cashflow.js +2 -2
  18. package/dist/commands/contact-groups.js +10 -10
  19. package/dist/commands/contacts.js +14 -14
  20. package/dist/commands/currencies.js +2 -2
  21. package/dist/commands/currency-rates.js +8 -8
  22. package/dist/commands/custom-fields.js +12 -12
  23. package/dist/commands/customer-credit-notes.js +30 -30
  24. package/dist/commands/draft-helpers.js +12 -12
  25. package/dist/commands/exports.js +4 -4
  26. package/dist/commands/fixed-assets.js +23 -23
  27. package/dist/commands/format-helpers.js +5 -0
  28. package/dist/commands/help-examples.js +2 -2
  29. package/dist/commands/init.js +8 -8
  30. package/dist/commands/inventory.js +7 -7
  31. package/dist/commands/invoices.js +36 -36
  32. package/dist/commands/items.js +11 -11
  33. package/dist/commands/jobs.js +33 -33
  34. package/dist/commands/journals.js +27 -27
  35. package/dist/commands/kb.js +6 -6
  36. package/dist/commands/magic.js +40 -40
  37. package/dist/commands/nano-classifiers.js +8 -8
  38. package/dist/commands/org-users.js +5 -5
  39. package/dist/commands/org.js +8 -8
  40. package/dist/commands/output.js +3 -3
  41. package/dist/commands/pagination.js +2 -2
  42. package/dist/commands/parsers.js +20 -20
  43. package/dist/commands/payments.js +9 -9
  44. package/dist/commands/picker.js +88 -90
  45. package/dist/commands/quick-fix.js +8 -8
  46. package/dist/commands/recipe.js +16 -16
  47. package/dist/commands/reports.js +11 -11
  48. package/dist/commands/resolve.js +8 -8
  49. package/dist/commands/schedulers.js +25 -25
  50. package/dist/commands/schema.js +15 -24
  51. package/dist/commands/search.js +4 -4
  52. package/dist/commands/subscriptions.js +17 -17
  53. package/dist/commands/supplier-credit-notes.js +28 -28
  54. package/dist/commands/tags.js +10 -10
  55. package/dist/commands/tax-profiles.js +11 -11
  56. package/dist/commands/ui/index.js +1 -0
  57. package/dist/commands/ui/picker.js +180 -0
  58. package/dist/commands/ui/table.js +2 -3
  59. package/dist/commands/ui/theme.js +1 -0
  60. package/dist/commands/update.js +2 -2
  61. package/dist/commands/versions.js +3 -3
  62. package/dist/core/calc/format.js +126 -126
  63. package/dist/core/jobs/document-collection/tools/ingest/format.js +25 -25
  64. package/dist/core/jobs/format.js +23 -23
  65. package/dist/core/jobs/payment-run/tools/bank-file/format.js +7 -7
  66. package/dist/core/jobs/payment-run/tools/outstanding/format.js +9 -9
  67. package/dist/core/jobs/statutory-filing/tools/sg-tax/format-sg.js +19 -19
  68. package/dist/index.js +11 -11
  69. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { highlight, success } from './ui/theme.js';
2
2
  import { listCustomFields, getCustomField, searchCustomFields, createCustomField, updateCustomField, deleteCustomField } from '../core/api/custom-fields.js';
3
3
  import { apiAction } from './api-action.js';
4
4
  import { outputList } from './output.js';
@@ -39,15 +39,15 @@ export function registerCustomFieldsCommand(program) {
39
39
  console.log(JSON.stringify(f, null, 2));
40
40
  return;
41
41
  }
42
- console.log(chalk.bold('Name:'), f.customFieldName || f.name || '(unnamed)');
43
- console.log(chalk.bold('ID:'), f.resourceId);
44
- console.log(chalk.bold('Type:'), f.datatypeCode || f.fieldType || '—');
42
+ console.log(highlight('Name:'), f.customFieldName || f.name || '(unnamed)');
43
+ console.log(highlight('ID:'), f.resourceId);
44
+ console.log(highlight('Type:'), f.datatypeCode || f.fieldType || '—');
45
45
  if (f.description)
46
- console.log(chalk.bold('Description:'), f.description);
46
+ console.log(highlight('Description:'), f.description);
47
47
  if (f.defaultValue)
48
- console.log(chalk.bold('Default:'), f.defaultValue);
48
+ console.log(highlight('Default:'), f.defaultValue);
49
49
  if (f.listOptions?.length)
50
- console.log(chalk.bold('Options:'), f.listOptions.join(', '));
50
+ console.log(highlight('Options:'), f.listOptions.join(', '));
51
51
  const isTrue = (v) => v === true || v === 'true';
52
52
  const applies = [];
53
53
  if (isTrue(f.applyToSales))
@@ -63,7 +63,7 @@ export function registerCustomFieldsCommand(program) {
63
63
  if (isTrue(f.appliesToFixedAssets))
64
64
  applies.push('fixed assets');
65
65
  if (applies.length)
66
- console.log(chalk.bold('Applies to:'), applies.join(', '));
66
+ console.log(highlight('Applies to:'), applies.join(', '));
67
67
  })(opts));
68
68
  cmd
69
69
  .command('search')
@@ -126,8 +126,8 @@ export function registerCustomFieldsCommand(program) {
126
126
  console.log(JSON.stringify(res.data, null, 2));
127
127
  return;
128
128
  }
129
- console.log(chalk.green(`Custom field "${opts.name}" created.`));
130
- console.log(chalk.bold('ID:'), res.data.resourceId);
129
+ console.log(success(`Custom field "${opts.name}" created.`));
130
+ console.log(highlight('ID:'), res.data.resourceId);
131
131
  }));
132
132
  cmd
133
133
  .command('update <resourceId>')
@@ -168,7 +168,7 @@ export function registerCustomFieldsCommand(program) {
168
168
  console.log(JSON.stringify(res.data, null, 2));
169
169
  return;
170
170
  }
171
- console.log(chalk.green(`Custom field ${resourceId} updated.`));
171
+ console.log(success(`Custom field ${resourceId} updated.`));
172
172
  })(opts));
173
173
  cmd
174
174
  .command('delete <resourceId>')
@@ -182,6 +182,6 @@ export function registerCustomFieldsCommand(program) {
182
182
  console.log(JSON.stringify({ deleted: true, resourceId }));
183
183
  return;
184
184
  }
185
- console.log(chalk.green(`Custom field ${resourceId} deleted.`));
185
+ console.log(success(`Custom field ${resourceId} deleted.`));
186
186
  })(opts));
187
187
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { danger, success, accent, warning, muted, highlight } from './ui/theme.js';
2
2
  import { formatStatus, formatId, formatReference, formatCurrency } from './format-helpers.js';
3
3
  import { buildCnFilter } from '../core/registry/index.js';
4
4
  import { listCustomerCreditNotes, getCustomerCreditNote, searchCustomerCreditNotes, createCustomerCreditNote, updateCustomerCreditNote, deleteCustomerCreditNote, createCustomerCreditNoteRefund, listCustomerCreditNoteRefunds, finalizeCustomerCreditNote, downloadCustomerCreditNotePdf, } from '../core/api/customer-cn.js';
@@ -48,14 +48,14 @@ export function registerCustomerCreditNotesCommand(program) {
48
48
  console.log(JSON.stringify(cn, null, 2));
49
49
  }
50
50
  else {
51
- console.log(chalk.bold('Reference:'), cn.reference || '(none)');
52
- console.log(chalk.bold('ID:'), cn.resourceId);
53
- console.log(chalk.bold('Status:'), cn.status);
54
- console.log(chalk.bold('Date:'), normalizeDate(cn.valueDate));
51
+ console.log(highlight('Reference:'), cn.reference || '(none)');
52
+ console.log(highlight('ID:'), cn.resourceId);
53
+ console.log(highlight('Status:'), cn.status);
54
+ console.log(highlight('Date:'), normalizeDate(cn.valueDate));
55
55
  if (cn.totalAmount !== undefined)
56
- console.log(chalk.bold('Total:'), cn.totalAmount.toFixed(2));
56
+ console.log(highlight('Total:'), cn.totalAmount.toFixed(2));
57
57
  if (cn.lineItems?.length) {
58
- console.log(chalk.bold('Line Items:'));
58
+ console.log(highlight('Line Items:'));
59
59
  for (const li of cn.lineItems) {
60
60
  const qty = li.quantity ?? 1;
61
61
  const price = li.unitPrice ?? 0;
@@ -63,7 +63,7 @@ export function registerCustomerCreditNotesCommand(program) {
63
63
  }
64
64
  }
65
65
  if (cn.notes)
66
- console.log(chalk.bold('Notes:'), cn.notes);
66
+ console.log(highlight('Notes:'), cn.notes);
67
67
  }
68
68
  })(opts));
69
69
  // ── clio customer-credit-notes search ─────────────────────────
@@ -153,8 +153,8 @@ export function registerCustomerCreditNotesCommand(program) {
153
153
  }
154
154
  else {
155
155
  const status = opts.finalize ? 'finalized' : 'draft';
156
- console.log(chalk.green(`Customer credit note created (${status}): ${res.data.reference || res.data.resourceId}`));
157
- console.log(chalk.bold('ID:'), res.data.resourceId);
156
+ console.log(success(`Customer credit note created (${status}): ${res.data.reference || res.data.resourceId}`));
157
+ console.log(highlight('ID:'), res.data.resourceId);
158
158
  }
159
159
  }));
160
160
  // ── clio customer-credit-notes update ─────────────────────────
@@ -196,7 +196,7 @@ export function registerCustomerCreditNotesCommand(program) {
196
196
  console.log(JSON.stringify(res.data, null, 2));
197
197
  }
198
198
  else {
199
- console.log(chalk.green(`Customer credit note updated: ${res.data.reference || res.data.resourceId}`));
199
+ console.log(success(`Customer credit note updated: ${res.data.reference || res.data.resourceId}`));
200
200
  }
201
201
  })(opts));
202
202
  // ── clio customer-credit-notes delete ─────────────────────────
@@ -211,7 +211,7 @@ export function registerCustomerCreditNotesCommand(program) {
211
211
  console.log(JSON.stringify({ deleted: true, resourceId }));
212
212
  }
213
213
  else {
214
- console.log(chalk.green(`Customer credit note ${resourceId} deleted.`));
214
+ console.log(success(`Customer credit note ${resourceId} deleted.`));
215
215
  }
216
216
  })(opts));
217
217
  // ── clio customer-credit-notes refund ───────────────────────
@@ -264,7 +264,7 @@ export function registerCustomerCreditNotesCommand(program) {
264
264
  console.log(JSON.stringify(res.data, null, 2));
265
265
  }
266
266
  else {
267
- console.log(chalk.green(`Refund recorded for customer credit note ${resourceId}`));
267
+ console.log(success(`Refund recorded for customer credit note ${resourceId}`));
268
268
  }
269
269
  })(opts));
270
270
  // ── clio customer-credit-notes refunds ──────────────────────
@@ -284,9 +284,9 @@ export function registerCustomerCreditNotesCommand(program) {
284
284
  console.log('No refunds found.');
285
285
  return;
286
286
  }
287
- console.log(chalk.bold(`Refunds (${refunds.length}):\n`));
287
+ console.log(highlight(`Refunds (${refunds.length}):\n`));
288
288
  for (const r of refunds) {
289
- console.log(` ${chalk.cyan(r.resourceId)} ${r.reference || '(no ref)'} ${r.status} ${r.refundAmount} ${normalizeDate(r.valueDate)}`);
289
+ console.log(` ${accent(r.resourceId)} ${r.reference || '(no ref)'} ${r.status} ${r.refundAmount} ${normalizeDate(r.valueDate)}`);
290
290
  }
291
291
  }
292
292
  })(opts));
@@ -302,8 +302,8 @@ export function registerCustomerCreditNotesCommand(program) {
302
302
  console.log(JSON.stringify(res.data, null, 2));
303
303
  }
304
304
  else {
305
- console.log(chalk.green('PDF download ready:'));
306
- console.log(chalk.dim(res.data.fileUrl));
305
+ console.log(success('PDF download ready:'));
306
+ console.log(muted(res.data.fileUrl));
307
307
  }
308
308
  })(opts));
309
309
  // ── clio customer-credit-notes draft ──────────────────────────
@@ -379,7 +379,7 @@ export function registerCustomerCreditNotesCommand(program) {
379
379
  console.log(JSON.stringify({ finalized: false, error: msg }));
380
380
  }
381
381
  else {
382
- console.error(chalk.red(msg));
382
+ console.error(danger(msg));
383
383
  }
384
384
  process.exit(1);
385
385
  }
@@ -441,13 +441,13 @@ export function registerCustomerCreditNotesCommand(program) {
441
441
  }
442
442
  else {
443
443
  if (ready) {
444
- console.log(chalk.green(`✓ ${merged.reference || resourceId} is ready to finalize.`));
444
+ console.log(success(`✓ ${merged.reference || resourceId} is ready to finalize.`));
445
445
  }
446
446
  else {
447
- console.error(chalk.yellow(`✗ ${merged.reference || resourceId} — ${missingCount} issue${missingCount > 1 ? 's' : ''} remaining:`));
447
+ console.error(warning(`✗ ${merged.reference || resourceId} — ${missingCount} issue${missingCount > 1 ? 's' : ''} remaining:`));
448
448
  for (const f of missingFields) {
449
449
  const spec = CREDIT_NOTE_REQUIRED_FIELDS.find((s) => f === s.field || f.endsWith(`.${s.field}`));
450
- console.log(` ${f}: ${chalk.red('MISSING')} — ${spec?.hint ?? ''}`);
450
+ console.log(` ${f}: ${danger('MISSING')} — ${spec?.hint ?? ''}`);
451
451
  }
452
452
  }
453
453
  }
@@ -460,12 +460,12 @@ export function registerCustomerCreditNotesCommand(program) {
460
460
  console.log(JSON.stringify({ finalized: false, resourceId, reference: merged.reference || null, ready: false, missingCount, missingFields, validation }, null, 2));
461
461
  }
462
462
  else {
463
- console.error(chalk.red(`\n✗ Cannot finalize ${merged.reference || resourceId} — ${missingCount} issue${missingCount > 1 ? 's' : ''} remaining:\n`));
463
+ console.error(danger(`\n✗ Cannot finalize ${merged.reference || resourceId} — ${missingCount} issue${missingCount > 1 ? 's' : ''} remaining:\n`));
464
464
  for (const f of missingFields) {
465
465
  const spec = CREDIT_NOTE_REQUIRED_FIELDS.find((s) => f === s.field || f.endsWith(`.${s.field}`));
466
- console.error(` ${f}: ${chalk.red('MISSING')} — ${spec?.hint ?? ''}`);
466
+ console.error(` ${f}: ${danger('MISSING')} — ${spec?.hint ?? ''}`);
467
467
  }
468
- console.error(chalk.dim(`\n Fix the issues and retry:\n clio customer-credit-notes draft finalize ${resourceId} ...\n`));
468
+ console.error(muted(`\n Fix the issues and retry:\n clio customer-credit-notes draft finalize ${resourceId} ...\n`));
469
469
  }
470
470
  process.exit(1);
471
471
  }
@@ -479,10 +479,10 @@ export function registerCustomerCreditNotesCommand(program) {
479
479
  console.log(JSON.stringify({ finalized: true, resourceId: updated.resourceId, reference: updated.reference || null, status: updated.status, fieldsUpdated }, null, 2));
480
480
  }
481
481
  else {
482
- console.log(chalk.green(`\n✓ Customer credit note finalized: ${updated.reference || updated.resourceId}`));
483
- console.log(chalk.bold(' Status:'), updated.status);
482
+ console.log(success(`\n✓ Customer credit note finalized: ${updated.reference || updated.resourceId}`));
483
+ console.log(highlight(' Status:'), updated.status);
484
484
  if (fieldsUpdated.length > 0) {
485
- console.log(chalk.bold(' Updated:'), fieldsUpdated.join(', '));
485
+ console.log(highlight(' Updated:'), fieldsUpdated.join(', '));
486
486
  }
487
487
  }
488
488
  })(opts));
@@ -505,11 +505,11 @@ export function registerCustomerCreditNotesCommand(program) {
505
505
  console.log(`No attachments for customer credit note ${cn.reference || resourceId}.`);
506
506
  return;
507
507
  }
508
- console.log(chalk.bold(`Attachments for ${cn.reference || resourceId}:\n`));
508
+ console.log(highlight(`Attachments for ${cn.reference || resourceId}:\n`));
509
509
  for (const att of attachments) {
510
- console.log(` ${chalk.cyan(att.resourceId)} ${att.fileName || '(unnamed)'}`);
510
+ console.log(` ${accent(att.resourceId)} ${att.fileName || '(unnamed)'}`);
511
511
  if (att.fileUrl)
512
- console.log(` ${chalk.dim(att.fileUrl)}`);
512
+ console.log(` ${muted(att.fileUrl)}`);
513
513
  }
514
514
  }
515
515
  })(opts));
@@ -7,7 +7,7 @@
7
7
  * - addDraftFinalizeOptions() — Commander flag registration
8
8
  * - addJournalDraftFinalizeOptions() — Commander flag registration (journals)
9
9
  */
10
- import chalk from 'chalk';
10
+ import { danger, success, warning, muted, highlight } from './ui/theme.js';
11
11
  import { parseLineItems, parseJournalEntries } from './parsers.js';
12
12
  // ── Re-export core logic (preserves import paths for all existing consumers) ──
13
13
  export {
@@ -28,15 +28,15 @@ export function formatDraftTable(label, drafts) {
28
28
  return;
29
29
  }
30
30
  const summary = readyCount === drafts.length
31
- ? chalk.green(`${drafts.length} drafts, all ready`)
32
- : `${drafts.length} drafts, ${chalk.green(`${readyCount} ready`)}, ${chalk.yellow(`${needsAttention} need attention`)}`;
33
- console.log(chalk.bold(`Draft ${label} — ${summary}\n`));
31
+ ? success(`${drafts.length} drafts, all ready`)
32
+ : `${drafts.length} drafts, ${success(`${readyCount} ready`)}, ${warning(`${needsAttention} need attention`)}`;
33
+ console.log(highlight(`Draft ${label} — ${summary}\n`));
34
34
  for (let idx = 0; idx < drafts.length; idx++) {
35
35
  const d = drafts[idx];
36
36
  const ref = d.reference || '(no ref)';
37
37
  const amount = d.totalAmount > 0 ? `$${d.totalAmount.toFixed(2)}` : '$0.00';
38
38
  const shortId = d.resourceId.length > 12 ? d.resourceId.slice(0, 8) + '-...' : d.resourceId;
39
- console.log(` ${chalk.bold(`${idx + 1}.`)} ${ref} ${chalk.dim(`(${shortId})`)} ${chalk.dim(amount)}`);
39
+ console.log(` ${highlight(`${idx + 1}.`)} ${ref} ${muted(`(${shortId})`)} ${muted(amount)}`);
40
40
  // Top-level fields (only show those present in validation)
41
41
  const v = d.validation;
42
42
  if (v.contact)
@@ -49,22 +49,22 @@ export function formatDraftTable(label, drafts) {
49
49
  const name = li.name || '(unnamed)';
50
50
  const price = li.unitPrice != null ? `$${li.unitPrice.toFixed(2)}` : 'no price';
51
51
  const acctStatus = li.account.status === 'ok'
52
- ? chalk.green('✓')
53
- : chalk.red('MISSING');
52
+ ? success('✓')
53
+ : danger('MISSING');
54
54
  console.log(` Line ${li.index + 1}: ${name} — ${price} — account: ${acctStatus}`);
55
55
  }
56
56
  // Attachments
57
57
  const attachLabel = d.attachmentCount > 0
58
58
  ? `${d.attachmentCount} file${d.attachmentCount > 1 ? 's' : ''}`
59
59
  : 'none';
60
- console.log(` Attach: ${chalk.dim(attachLabel)}`);
60
+ console.log(` Attach: ${muted(attachLabel)}`);
61
61
  // Summary
62
62
  if (d.ready) {
63
- console.log(chalk.green(' ✓ READY TO FINALIZE'));
63
+ console.log(success(' ✓ READY TO FINALIZE'));
64
64
  }
65
65
  else {
66
66
  const hints = uniqueHints(d);
67
- console.error(chalk.yellow(` → ${d.missingCount} issue${d.missingCount > 1 ? 's' : ''}: ${hints}`));
67
+ console.error(warning(` → ${d.missingCount} issue${d.missingCount > 1 ? 's' : ''}: ${hints}`));
68
68
  }
69
69
  console.log('');
70
70
  }
@@ -73,10 +73,10 @@ function formatFieldLine(label, fv) {
73
73
  const padLabel = label.padEnd(8);
74
74
  if (fv.status === 'ok') {
75
75
  const display = fv.value != null ? String(fv.value) : '';
76
- console.log(` ${padLabel} ${display} ${chalk.green('✓')}`);
76
+ console.log(` ${padLabel} ${display} ${success('✓')}`);
77
77
  }
78
78
  else {
79
- console.log(` ${padLabel} ${chalk.red('MISSING')}`);
79
+ console.log(` ${padLabel} ${danger('MISSING')}`);
80
80
  }
81
81
  }
82
82
  function uniqueHints(d) {
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { success, highlight } from './ui/theme.js';
2
2
  import { downloadExport } from '../core/api/data-exports.js';
3
3
  import { apiAction } from './api-action.js';
4
4
  import { requireFields } from './parsers.js';
@@ -48,11 +48,11 @@ export function registerExportsCommand(program) {
48
48
  }
49
49
  else {
50
50
  const d = res.data;
51
- console.log(chalk.green('Export ready'));
51
+ console.log(success('Export ready'));
52
52
  if (d.fileName)
53
- console.log(chalk.bold('File:'), d.fileName);
53
+ console.log(highlight('File:'), d.fileName);
54
54
  if (d.fileUrl)
55
- console.log(chalk.bold('URL:'), d.fileUrl);
55
+ console.log(highlight('URL:'), d.fileUrl);
56
56
  }
57
57
  }));
58
58
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import { danger, success, muted, highlight } from './ui/theme.js';
2
2
  import { listFixedAssets, getFixedAsset, searchFixedAssets, createFixedAsset, updateFixedAsset, deleteFixedAsset, discardFixedAsset, markFixedAssetSold, transferFixedAsset, undoFixedAssetDisposal, } from '../core/api/fixed-assets.js';
3
3
  import { apiAction } from './api-action.js';
4
4
  import { parsePositiveInt, parseNonNegativeInt, parseMoney, readBodyInput, parseCustomFields } from './parsers.js';
@@ -42,13 +42,13 @@ export function registerFixedAssetsCommand(program) {
42
42
  return;
43
43
  }
44
44
  const a = res.data;
45
- console.log(chalk.bold('Name:'), a.name);
46
- console.log(chalk.bold('Ref:'), a.reference);
47
- console.log(chalk.bold('Status:'), a.status);
48
- console.log(chalk.bold('Type:'), a.typeName);
49
- console.log(chalk.bold('Purchase:'), a.purchaseAmount);
50
- console.log(chalk.bold('NBV:'), a.netBookValueAmount);
51
- console.log(chalk.bold('ID:'), a.resourceId);
45
+ console.log(highlight('Name:'), a.name);
46
+ console.log(highlight('Ref:'), a.reference);
47
+ console.log(highlight('Status:'), a.status);
48
+ console.log(highlight('Type:'), a.typeName);
49
+ console.log(highlight('Purchase:'), a.purchaseAmount);
50
+ console.log(highlight('NBV:'), a.netBookValueAmount);
51
+ console.log(highlight('ID:'), a.resourceId);
52
52
  })(opts));
53
53
  cmd
54
54
  .command('search')
@@ -112,8 +112,8 @@ export function registerFixedAssetsCommand(program) {
112
112
  if (!body) {
113
113
  // Build body from flags
114
114
  if (!opts.name || opts.amount === undefined || !opts.date || !opts.assetAccount || !opts.depreciationStart) {
115
- console.error(chalk.red('Required: --name, --amount, --date, --depreciation-start, --asset-account'));
116
- console.error(chalk.dim('Or use --input <file> to provide full JSON body.'));
115
+ console.error(danger('Required: --name, --amount, --date, --depreciation-start, --asset-account'));
116
+ console.error(muted('Or use --input <file> to provide full JSON body.'));
117
117
  process.exit(1);
118
118
  }
119
119
  body = {
@@ -156,8 +156,8 @@ export function registerFixedAssetsCommand(program) {
156
156
  console.log(JSON.stringify(res.data, null, 2));
157
157
  return;
158
158
  }
159
- console.log(chalk.green('Fixed asset created.'));
160
- console.log(chalk.bold('ID:'), res.data.resourceId);
159
+ console.log(success('Fixed asset created.'));
160
+ console.log(highlight('ID:'), res.data.resourceId);
161
161
  }));
162
162
  cmd
163
163
  .command('delete <resourceId>')
@@ -171,7 +171,7 @@ export function registerFixedAssetsCommand(program) {
171
171
  console.log(JSON.stringify({ deleted: true, resourceId }));
172
172
  return;
173
173
  }
174
- console.log(chalk.green(`Fixed asset ${resourceId} deleted.`));
174
+ console.log(success(`Fixed asset ${resourceId} deleted.`));
175
175
  })(opts));
176
176
  cmd
177
177
  .command('update <resourceId>')
@@ -212,7 +212,7 @@ export function registerFixedAssetsCommand(program) {
212
212
  console.log(JSON.stringify(res.data, null, 2));
213
213
  return;
214
214
  }
215
- console.log(chalk.green(`Fixed asset ${resourceId} updated.`));
215
+ console.log(success(`Fixed asset ${resourceId} updated.`));
216
216
  })(opts));
217
217
  cmd
218
218
  .command('sell')
@@ -234,11 +234,11 @@ export function registerFixedAssetsCommand(program) {
234
234
  console.log(JSON.stringify(res.data, null, 2));
235
235
  return;
236
236
  }
237
- console.log(chalk.green('Fixed asset marked as sold.'));
237
+ console.log(success('Fixed asset marked as sold.'));
238
238
  return;
239
239
  }
240
240
  if (!opts.id || !opts.depreciationEndDate || !opts.gainLossAccount || !opts.saleType || !opts.saleItem) {
241
- console.error(chalk.red('Required: --id, --depreciation-end-date, --gain-loss-account, --sale-type, --sale-item'));
241
+ console.error(danger('Required: --id, --depreciation-end-date, --gain-loss-account, --sale-type, --sale-item'));
242
242
  process.exit(1);
243
243
  }
244
244
  const res = await markFixedAssetSold(client, {
@@ -252,7 +252,7 @@ export function registerFixedAssetsCommand(program) {
252
252
  console.log(JSON.stringify(res.data, null, 2));
253
253
  return;
254
254
  }
255
- console.log(chalk.green(`Fixed asset ${opts.id} marked as sold.`));
255
+ console.log(success(`Fixed asset ${opts.id} marked as sold.`));
256
256
  }));
257
257
  cmd
258
258
  .command('transfer')
@@ -269,8 +269,8 @@ export function registerFixedAssetsCommand(program) {
269
269
  let body = readBodyInput(opts);
270
270
  if (!body) {
271
271
  if (!opts.id) {
272
- console.error(chalk.red('Required: --id <resourceId>'));
273
- console.error(chalk.dim('Or use --input <file> to provide full JSON body.'));
272
+ console.error(danger('Required: --id <resourceId>'));
273
+ console.error(muted('Or use --input <file> to provide full JSON body.'));
274
274
  process.exit(1);
275
275
  }
276
276
  body = { resourceId: opts.id };
@@ -286,7 +286,7 @@ export function registerFixedAssetsCommand(program) {
286
286
  console.log(JSON.stringify(res.data, null, 2));
287
287
  return;
288
288
  }
289
- console.log(chalk.green('Fixed asset transferred.'));
289
+ console.log(success('Fixed asset transferred.'));
290
290
  }));
291
291
  cmd
292
292
  .command('discard <resourceId>')
@@ -299,7 +299,7 @@ export function registerFixedAssetsCommand(program) {
299
299
  .option('--json', 'JSON output')
300
300
  .action((resourceId, opts) => apiAction(async (client) => {
301
301
  if (!opts.disposalDate || !opts.depreciationEndDate) {
302
- console.error(chalk.red('--disposal-date and --depreciation-end-date are required.'));
302
+ console.error(danger('--disposal-date and --depreciation-end-date are required.'));
303
303
  process.exit(1);
304
304
  }
305
305
  const res = await discardFixedAsset(client, resourceId, {
@@ -311,7 +311,7 @@ export function registerFixedAssetsCommand(program) {
311
311
  console.log(JSON.stringify(res.data, null, 2));
312
312
  return;
313
313
  }
314
- console.log(chalk.green(`Fixed asset ${resourceId} discarded.`));
314
+ console.log(success(`Fixed asset ${resourceId} discarded.`));
315
315
  })(opts));
316
316
  cmd
317
317
  .command('undo-disposal <resourceId>')
@@ -325,6 +325,6 @@ export function registerFixedAssetsCommand(program) {
325
325
  console.log(JSON.stringify(res.data, null, 2));
326
326
  return;
327
327
  }
328
- console.log(chalk.green(`Disposal undone for ${resourceId}.`));
328
+ console.log(success(`Disposal undone for ${resourceId}.`));
329
329
  })(opts));
330
330
  }
@@ -5,6 +5,11 @@ const STATUS_COLORS = {
5
5
  VOIDED: danger,
6
6
  FAILED: danger,
7
7
  DELETED: danger,
8
+ OVERDUE: danger,
9
+ CANCELLED: muted,
10
+ PENDING: warning,
11
+ SUBMITTED: warning,
12
+ PROCESSING: warning,
8
13
  };
9
14
  export function formatStatus(status) {
10
15
  const s = status || 'UNKNOWN';
@@ -4,7 +4,7 @@
4
4
  * After all register*Command() calls, one call to applyAllExamples() walks the
5
5
  * command tree and attaches examples via Commander.js .addHelpText().
6
6
  */
7
- import chalk from 'chalk';
7
+ import { muted } from './ui/theme.js';
8
8
  const EXAMPLES = {
9
9
  'invoices list': [
10
10
  { description: 'List first 100 invoices', command: 'clio invoices list' },
@@ -96,7 +96,7 @@ function formatExamples(examples) {
96
96
  const lines = ['\nEXAMPLES'];
97
97
  for (const ex of examples) {
98
98
  if (ex.description)
99
- lines.push(` ${chalk.dim(ex.description)}`);
99
+ lines.push(` ${muted(ex.description)}`);
100
100
  lines.push(` $ ${ex.command}`);
101
101
  lines.push('');
102
102
  }
@@ -1,9 +1,9 @@
1
- import chalk from 'chalk';
2
1
  import ora from 'ora';
3
2
  import * as p from '@clack/prompts';
4
3
  import { SKILL_DESCRIPTIONS } from '../types/index.js';
5
4
  import { installSkills, detectPlatform } from '../utils/template.js';
6
5
  import { logger } from '../utils/logger.js';
6
+ import { accent, highlight, muted, underline, success as themeSuccess } from './ui/theme.js';
7
7
  export async function initCommand(options) {
8
8
  logger.title('Clio — Skill Installer');
9
9
  let skillType = options.skill ?? 'all';
@@ -54,7 +54,7 @@ export async function initCommand(options) {
54
54
  const skillLabel = skillType === 'all'
55
55
  ? 'jaz-api + jaz-cli + jaz-conversion + jaz-recipes + jaz-jobs'
56
56
  : skillType;
57
- logger.info(`Installing: ${chalk.cyan(skillLabel)}`);
57
+ logger.info(`Installing: ${accent(skillLabel)}`);
58
58
  const spinner = ora('Installing skill files...').start();
59
59
  const cwd = process.cwd();
60
60
  const platform = options.platform ?? 'auto';
@@ -70,19 +70,19 @@ export async function initCommand(options) {
70
70
  console.log();
71
71
  logger.info('Installed:');
72
72
  installedPaths.forEach((folder) => {
73
- console.log(` ${chalk.green('+')} ${folder}/`);
73
+ console.log(` ${themeSuccess('+')} ${folder}/`);
74
74
  });
75
75
  console.log();
76
76
  logger.success('Clio — Jaz AI skills installed successfully!');
77
77
  console.log();
78
- console.log(chalk.bold('Next steps:'));
79
- console.log(chalk.dim(' 1. Restart your AI tool (Claude Code, Antigravity, Codex, Copilot, Cursor, etc.)'));
80
- console.log(chalk.dim(' 2. Try: "Create an invoice with line items and tax"'));
78
+ console.log(highlight('Next steps:'));
79
+ console.log(muted(' 1. Restart your AI tool (Claude Code, Antigravity, Codex, Copilot, Cursor, etc.)'));
80
+ console.log(muted(' 2. Try: "Create an invoice with line items and tax"'));
81
81
  if (skillType === 'all' || skillType === 'jaz-conversion') {
82
- console.log(chalk.dim(' 3. Try: "Convert this Xero trial balance to Jaz"'));
82
+ console.log(muted(' 3. Try: "Convert this Xero trial balance to Jaz"'));
83
83
  }
84
84
  console.log();
85
- console.log(chalk.dim(` Docs: ${chalk.underline('https://help.jaz.ai')}`));
85
+ console.log(muted(` Docs: ${underline('https://help.jaz.ai')}`));
86
86
  console.log();
87
87
  }
88
88
  catch (error) {
@@ -1,14 +1,14 @@
1
- import chalk from 'chalk';
2
1
  import { listInventoryItems, createInventoryItem, getInventoryBalance } from '../core/api/inventory.js';
3
2
  import { apiAction } from './api-action.js';
4
3
  import { parsePositiveInt, parseNonNegativeInt, readBodyInput, requireFields } from './parsers.js';
5
4
  import { paginatedFetch } from './pagination.js';
6
5
  import { outputList } from './output.js';
7
6
  import { formatId } from './format-helpers.js';
7
+ import { highlight, muted, success } from './ui/theme.js';
8
8
  const INVENTORY_ITEM_COLUMNS = [
9
9
  { key: 'resourceId', header: 'ID', format: formatId },
10
10
  { key: 'internalName', header: 'Name', format: (v) => String(v ?? '') },
11
- { key: 'itemCode', header: 'Code', format: (v) => chalk.dim(String(v ?? '')) },
11
+ { key: 'itemCode', header: 'Code', format: (v) => muted(String(v ?? '')) },
12
12
  ];
13
13
  export function registerInventoryCommand(program) {
14
14
  const cmd = program
@@ -41,9 +41,9 @@ export function registerInventoryCommand(program) {
41
41
  return;
42
42
  }
43
43
  const b = res.data;
44
- console.log(chalk.bold('Item:'), b.itemResourceId);
45
- console.log(chalk.bold('Qty:'), `${b.baseQty} ${b.baseUnit}`);
46
- console.log(chalk.bold('Avg Cost:'), b.latestAverageCostAmount);
44
+ console.log(highlight('Item:'), b.itemResourceId);
45
+ console.log(highlight('Qty:'), `${b.baseQty} ${b.baseUnit}`);
46
+ console.log(highlight('Avg Cost:'), b.latestAverageCostAmount);
47
47
  })(opts));
48
48
  cmd
49
49
  .command('create')
@@ -76,7 +76,7 @@ export function registerInventoryCommand(program) {
76
76
  console.log(JSON.stringify(res.data, null, 2));
77
77
  return;
78
78
  }
79
- console.log(chalk.green(`Inventory item created.`));
80
- console.log(chalk.bold('ID:'), res.data.resourceId);
79
+ console.log(success(`Inventory item created.`));
80
+ console.log(highlight('ID:'), res.data.resourceId);
81
81
  }));
82
82
  }