@troxy/cli 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cards.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@troxy/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "AI payment control — protect your agent's payments with policies",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cards.js CHANGED
@@ -13,13 +13,13 @@ export async function runCards([sub, ...args], flags) {
13
13
  if (!cards.length) { console.log('\n No cards yet.\n'); return; }
14
14
  console.log();
15
15
  table(
16
- ['Name', 'Status', 'Budget', 'Used', 'Provider'],
16
+ ['Name', 'Last 4', 'Status', 'Budget', 'Used'],
17
17
  cards.map(c => [
18
- c.alias_name,
18
+ c.name,
19
+ c.last_four ? `···${c.last_four}` : '—',
19
20
  c.status,
20
- c.monthly_budget ? `$${c.monthly_budget}` : '',
21
- c.budget_used ? `$${Number(c.budget_used).toFixed(2)}` : '$0.00',
22
- c.provider || '—',
21
+ c.monthly_budget ? `$${c.monthly_budget}` : 'no limit',
22
+ `$${Number(c.budget_used || 0).toFixed(2)}`,
23
23
  ]),
24
24
  );
25
25
  break;
@@ -45,7 +45,7 @@ export async function runCards([sub, ...args], flags) {
45
45
  if (!name) { console.error(' --name is required\n'); process.exit(1); }
46
46
  const data = await api.listCards(jwt);
47
47
  const cards = data?.cards || [];
48
- const card = cards.find(c => c.alias_name === name);
48
+ const card = cards.find(c => c.name === name);
49
49
  if (!card) { console.error(` Card "${name}" not found\n`); process.exit(1); }
50
50
  await api.deleteCard(jwt, card.id);
51
51
  console.log(`\n Card "${name}" deleted ✓\n`);