@epilot/cli 0.1.3 → 0.1.5

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 (60) hide show
  1. package/README.md +18 -4
  2. package/dist/{access-token-F2VH6TNQ.js → access-token-BDNU3ZFC.js} +3 -3
  3. package/dist/{address-YBOAFFFH.js → address-ZCYZYRP4.js} +3 -3
  4. package/dist/{address-suggestions-ITPRYJSF.js → address-suggestions-RP5N7NVQ.js} +3 -3
  5. package/dist/{ai-agents-EBWNYR5R.js → ai-agents-PLUGVZTI.js} +3 -3
  6. package/dist/{app-WOAQAMSE.js → app-HZECIN6N.js} +3 -3
  7. package/dist/{audit-logs-OAUUPKTJ.js → audit-logs-JWKGNHPP.js} +3 -3
  8. package/dist/{auth-NEBRZ66K.js → auth-O5LQZAG7.js} +3 -3
  9. package/dist/auth-login-NM74PQRP.js +332 -0
  10. package/dist/{auth-token-W6GXKHXB.js → auth-token-VSNRXUBI.js} +1 -1
  11. package/dist/{automation-52ONEM6D.js → automation-73BC4PYK.js} +3 -3
  12. package/dist/{billing-2RED3OVH.js → billing-GQDSK4H2.js} +3 -3
  13. package/dist/bin/epilot.js +60 -59
  14. package/dist/{blueprint-manifest-4VTVMR42.js → blueprint-manifest-4M7DNWYE.js} +3 -3
  15. package/dist/{chunk-TKZLQD2B.js → chunk-6RBLA5YE.js} +3 -1
  16. package/dist/{chunk-5CTRM3JQ.js → chunk-BJOXXFMA.js} +12 -11
  17. package/dist/{chunk-4VITQVW2.js → chunk-HN4QDJOJ.js} +19 -16
  18. package/dist/{completion-XN3BD2LS.js → completion-RCVUCEMM.js} +77 -9
  19. package/dist/{consent-25X3PFNT.js → consent-OJBGOI54.js} +3 -3
  20. package/dist/{customer-portal-T6VNRPQY.js → customer-portal-BDKNWKHA.js} +3 -3
  21. package/dist/{dashboard-MBTUKEVN.js → dashboard-IAEU3JFY.js} +3 -3
  22. package/dist/{data-management-ZHPS67MI.js → data-management-UEDSGAKB.js} +3 -3
  23. package/dist/{deduplication-L2UABHUX.js → deduplication-JJS3TOJ2.js} +3 -3
  24. package/dist/{design-ELKIZCND.js → design-WKSDZFBJ.js} +3 -3
  25. package/dist/{document-VF2C5OPK.js → document-P5OL4NYY.js} +3 -3
  26. package/dist/{email-settings-TM6TIDZQ.js → email-settings-743JHCKS.js} +3 -3
  27. package/dist/{email-template-S7NLUNON.js → email-template-MW4IVDPM.js} +3 -3
  28. package/dist/{entity-5AAD2R3S.js → entity-K5X6FWJI.js} +3 -3
  29. package/dist/{entity-mapping-UOFXQLQ2.js → entity-mapping-QBJ2I2VR.js} +3 -3
  30. package/dist/{environments-STU24LWT.js → environments-VUR7ME42.js} +3 -3
  31. package/dist/{erp-integration-DMPYQNVW.js → erp-integration-A2KAIXUQ.js} +3 -3
  32. package/dist/{event-catalog-HGSD3RZW.js → event-catalog-6YEG5CEM.js} +3 -3
  33. package/dist/{file-G355J7IL.js → file-J6PHZ447.js} +3 -3
  34. package/dist/{iban-FIL4TCSN.js → iban-DJSUCRU6.js} +3 -3
  35. package/dist/{interactive-RWCSFGXL.js → interactive-XXYFAJEI.js} +2 -2
  36. package/dist/{journey-4IZDKDY7.js → journey-QJZKU3PZ.js} +3 -3
  37. package/dist/{kanban-DNIP4AAI.js → kanban-ZF4IIG7Q.js} +3 -3
  38. package/dist/{message-W4TZ32YH.js → message-WH4GD5SC.js} +3 -3
  39. package/dist/{metering-GKGJZTDF.js → metering-FCWUZ2TC.js} +3 -3
  40. package/dist/{notes-AS7BD3B6.js → notes-KKVPGK7K.js} +3 -3
  41. package/dist/{notification-N4ACDEK7.js → notification-4MVAZTRP.js} +3 -3
  42. package/dist/{organization-IYNBC4SB.js → organization-2UT2KFMB.js} +3 -3
  43. package/dist/{partner-directory-DZX32S4J.js → partner-directory-SUNW4XN7.js} +3 -3
  44. package/dist/{permissions-Z7KVPSVL.js → permissions-36VGB4BQ.js} +3 -3
  45. package/dist/{pricing-OLSQRQZN.js → pricing-RCNFEEHO.js} +3 -3
  46. package/dist/{pricing-tier-IP274TML.js → pricing-tier-MNCLLXD5.js} +3 -3
  47. package/dist/{profile-PPVSNNBG.js → profile-MZ3VK7PO.js} +1 -1
  48. package/dist/{purpose-YCIEYFCH.js → purpose-3JN63WTQ.js} +3 -3
  49. package/dist/{sandbox-AKFR5LEQ.js → sandbox-C676YDRV.js} +3 -3
  50. package/dist/{submission-XONDJGXI.js → submission-5XTNMMCK.js} +3 -3
  51. package/dist/{targeting-QWHVJCWI.js → targeting-C52KV6IW.js} +3 -3
  52. package/dist/{template-variables-Q3J3IPSF.js → template-variables-5SKJEJF4.js} +3 -3
  53. package/dist/upgrade-VJCKIUNZ.js +124 -0
  54. package/dist/{user-QNPACYI3.js → user-DYAR3N6L.js} +3 -3
  55. package/dist/{validation-rules-XT3SRBJ3.js → validation-rules-LDAOUPOO.js} +3 -3
  56. package/dist/{webhooks-RH5VYEY6.js → webhooks-MT2P33A2.js} +3 -3
  57. package/dist/{workflow-BKSEFDUM.js → workflow-YGWGE6L4.js} +3 -3
  58. package/dist/{workflow-definition-DGEBEIGG.js → workflow-definition-JG54ZWGL.js} +3 -3
  59. package/package.json +1 -1
  60. package/dist/auth-login-QQBH7BVA.js +0 -140
@@ -11,7 +11,7 @@ import { defineCommand } from "citty";
11
11
  var main = defineCommand({
12
12
  meta: {
13
13
  name: "epilot",
14
- version: "0.1.3",
14
+ version: "0.1.5",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -24,64 +24,65 @@ var main = defineCommand({
24
24
  jsonata: { type: "string", description: "JSONata expression" }
25
25
  },
26
26
  subCommands: {
27
- auth: () => import("../auth-NEBRZ66K.js").then((m) => m.default),
28
- profile: () => import("../profile-PPVSNNBG.js").then((m) => m.default),
29
- completion: () => import("../completion-XN3BD2LS.js").then((m) => m.default),
30
- "access-token": () => import("../access-token-F2VH6TNQ.js").then((m) => m.default),
31
- address: () => import("../address-YBOAFFFH.js").then((m) => m.default),
32
- "address-suggestions": () => import("../address-suggestions-ITPRYJSF.js").then((m) => m.default),
33
- "ai-agents": () => import("../ai-agents-EBWNYR5R.js").then((m) => m.default),
34
- app: () => import("../app-WOAQAMSE.js").then((m) => m.default),
35
- "audit-logs": () => import("../audit-logs-OAUUPKTJ.js").then((m) => m.default),
36
- automation: () => import("../automation-52ONEM6D.js").then((m) => m.default),
37
- billing: () => import("../billing-2RED3OVH.js").then((m) => m.default),
38
- "blueprint-manifest": () => import("../blueprint-manifest-4VTVMR42.js").then((m) => m.default),
39
- consent: () => import("../consent-25X3PFNT.js").then((m) => m.default),
40
- "customer-portal": () => import("../customer-portal-T6VNRPQY.js").then((m) => m.default),
41
- dashboard: () => import("../dashboard-MBTUKEVN.js").then((m) => m.default),
42
- "data-management": () => import("../data-management-ZHPS67MI.js").then((m) => m.default),
43
- deduplication: () => import("../deduplication-L2UABHUX.js").then((m) => m.default),
44
- design: () => import("../design-ELKIZCND.js").then((m) => m.default),
45
- document: () => import("../document-VF2C5OPK.js").then((m) => m.default),
46
- "email-settings": () => import("../email-settings-TM6TIDZQ.js").then((m) => m.default),
47
- "email-template": () => import("../email-template-S7NLUNON.js").then((m) => m.default),
48
- entity: () => import("../entity-5AAD2R3S.js").then((m) => m.default),
49
- "entity-mapping": () => import("../entity-mapping-UOFXQLQ2.js").then((m) => m.default),
50
- environments: () => import("../environments-STU24LWT.js").then((m) => m.default),
51
- "erp-integration": () => import("../erp-integration-DMPYQNVW.js").then((m) => m.default),
52
- "event-catalog": () => import("../event-catalog-HGSD3RZW.js").then((m) => m.default),
53
- file: () => import("../file-G355J7IL.js").then((m) => m.default),
54
- iban: () => import("../iban-FIL4TCSN.js").then((m) => m.default),
55
- journey: () => import("../journey-4IZDKDY7.js").then((m) => m.default),
56
- kanban: () => import("../kanban-DNIP4AAI.js").then((m) => m.default),
57
- message: () => import("../message-W4TZ32YH.js").then((m) => m.default),
58
- metering: () => import("../metering-GKGJZTDF.js").then((m) => m.default),
59
- notes: () => import("../notes-AS7BD3B6.js").then((m) => m.default),
60
- notification: () => import("../notification-N4ACDEK7.js").then((m) => m.default),
61
- organization: () => import("../organization-IYNBC4SB.js").then((m) => m.default),
62
- "partner-directory": () => import("../partner-directory-DZX32S4J.js").then((m) => m.default),
63
- permissions: () => import("../permissions-Z7KVPSVL.js").then((m) => m.default),
64
- pricing: () => import("../pricing-OLSQRQZN.js").then((m) => m.default),
65
- "pricing-tier": () => import("../pricing-tier-IP274TML.js").then((m) => m.default),
66
- purpose: () => import("../purpose-YCIEYFCH.js").then((m) => m.default),
67
- sandbox: () => import("../sandbox-AKFR5LEQ.js").then((m) => m.default),
68
- submission: () => import("../submission-XONDJGXI.js").then((m) => m.default),
69
- targeting: () => import("../targeting-QWHVJCWI.js").then((m) => m.default),
70
- "template-variables": () => import("../template-variables-Q3J3IPSF.js").then((m) => m.default),
71
- user: () => import("../user-QNPACYI3.js").then((m) => m.default),
72
- "validation-rules": () => import("../validation-rules-XT3SRBJ3.js").then((m) => m.default),
73
- webhooks: () => import("../webhooks-RH5VYEY6.js").then((m) => m.default),
74
- workflow: () => import("../workflow-BKSEFDUM.js").then((m) => m.default),
75
- "workflow-definition": () => import("../workflow-definition-DGEBEIGG.js").then((m) => m.default)
27
+ auth: () => import("../auth-O5LQZAG7.js").then((m) => m.default),
28
+ profile: () => import("../profile-MZ3VK7PO.js").then((m) => m.default),
29
+ completion: () => import("../completion-RCVUCEMM.js").then((m) => m.default),
30
+ upgrade: () => import("../upgrade-VJCKIUNZ.js").then((m) => m.default),
31
+ "access-token": () => import("../access-token-BDNU3ZFC.js").then((m) => m.default),
32
+ address: () => import("../address-ZCYZYRP4.js").then((m) => m.default),
33
+ "address-suggestions": () => import("../address-suggestions-RP5N7NVQ.js").then((m) => m.default),
34
+ "ai-agents": () => import("../ai-agents-PLUGVZTI.js").then((m) => m.default),
35
+ app: () => import("../app-HZECIN6N.js").then((m) => m.default),
36
+ "audit-logs": () => import("../audit-logs-JWKGNHPP.js").then((m) => m.default),
37
+ automation: () => import("../automation-73BC4PYK.js").then((m) => m.default),
38
+ billing: () => import("../billing-GQDSK4H2.js").then((m) => m.default),
39
+ "blueprint-manifest": () => import("../blueprint-manifest-4M7DNWYE.js").then((m) => m.default),
40
+ consent: () => import("../consent-OJBGOI54.js").then((m) => m.default),
41
+ "customer-portal": () => import("../customer-portal-BDKNWKHA.js").then((m) => m.default),
42
+ dashboard: () => import("../dashboard-IAEU3JFY.js").then((m) => m.default),
43
+ "data-management": () => import("../data-management-UEDSGAKB.js").then((m) => m.default),
44
+ deduplication: () => import("../deduplication-JJS3TOJ2.js").then((m) => m.default),
45
+ design: () => import("../design-WKSDZFBJ.js").then((m) => m.default),
46
+ document: () => import("../document-P5OL4NYY.js").then((m) => m.default),
47
+ "email-settings": () => import("../email-settings-743JHCKS.js").then((m) => m.default),
48
+ "email-template": () => import("../email-template-MW4IVDPM.js").then((m) => m.default),
49
+ entity: () => import("../entity-K5X6FWJI.js").then((m) => m.default),
50
+ "entity-mapping": () => import("../entity-mapping-QBJ2I2VR.js").then((m) => m.default),
51
+ environments: () => import("../environments-VUR7ME42.js").then((m) => m.default),
52
+ "erp-integration": () => import("../erp-integration-A2KAIXUQ.js").then((m) => m.default),
53
+ "event-catalog": () => import("../event-catalog-6YEG5CEM.js").then((m) => m.default),
54
+ file: () => import("../file-J6PHZ447.js").then((m) => m.default),
55
+ iban: () => import("../iban-DJSUCRU6.js").then((m) => m.default),
56
+ journey: () => import("../journey-QJZKU3PZ.js").then((m) => m.default),
57
+ kanban: () => import("../kanban-ZF4IIG7Q.js").then((m) => m.default),
58
+ message: () => import("../message-WH4GD5SC.js").then((m) => m.default),
59
+ metering: () => import("../metering-FCWUZ2TC.js").then((m) => m.default),
60
+ notes: () => import("../notes-KKVPGK7K.js").then((m) => m.default),
61
+ notification: () => import("../notification-4MVAZTRP.js").then((m) => m.default),
62
+ organization: () => import("../organization-2UT2KFMB.js").then((m) => m.default),
63
+ "partner-directory": () => import("../partner-directory-SUNW4XN7.js").then((m) => m.default),
64
+ permissions: () => import("../permissions-36VGB4BQ.js").then((m) => m.default),
65
+ pricing: () => import("../pricing-RCNFEEHO.js").then((m) => m.default),
66
+ "pricing-tier": () => import("../pricing-tier-MNCLLXD5.js").then((m) => m.default),
67
+ purpose: () => import("../purpose-3JN63WTQ.js").then((m) => m.default),
68
+ sandbox: () => import("../sandbox-C676YDRV.js").then((m) => m.default),
69
+ submission: () => import("../submission-5XTNMMCK.js").then((m) => m.default),
70
+ targeting: () => import("../targeting-C52KV6IW.js").then((m) => m.default),
71
+ "template-variables": () => import("../template-variables-5SKJEJF4.js").then((m) => m.default),
72
+ user: () => import("../user-DYAR3N6L.js").then((m) => m.default),
73
+ "validation-rules": () => import("../validation-rules-LDAOUPOO.js").then((m) => m.default),
74
+ webhooks: () => import("../webhooks-MT2P33A2.js").then((m) => m.default),
75
+ workflow: () => import("../workflow-YGWGE6L4.js").then((m) => m.default),
76
+ "workflow-definition": () => import("../workflow-definition-JG54ZWGL.js").then((m) => m.default)
76
77
  }
77
78
  });
78
79
 
79
80
  // bin/epilot.ts
80
- var VERSION = true ? "0.1.3" : (await null).default.version;
81
+ var VERSION = true ? "0.1.5" : (await null).default.version;
81
82
  var args = process.argv.slice(2);
82
83
  var completionsIdx = args.indexOf("--_completions");
83
84
  if (completionsIdx >= 0) {
84
- const { handleCompletions } = await import("../completion-XN3BD2LS.js");
85
+ const { handleCompletions } = await import("../completion-RCVUCEMM.js");
85
86
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
86
87
  process.exit(0);
87
88
  }
@@ -97,19 +98,17 @@ if (hasNoSubcommand && (hasHelp || args.length === 0)) {
97
98
  printRootHelp();
98
99
  process.exit(0);
99
100
  }
100
- if (hasHelp && args.length >= 2) {
101
+ if (hasHelp) {
101
102
  const apiArg = args.find((a) => !a.startsWith("-"));
102
103
  const isApi = apiArg && API_LIST.some((api) => api.kebabName === apiArg);
103
104
  if (isApi) {
104
105
  const positionals = args.filter((a) => !a.startsWith("-"));
105
106
  const operationId = positionals[1];
107
+ const filteredArgs = args.filter((a) => a !== "--help" && a !== "-h");
106
108
  if (operationId) {
107
- process.argv = [
108
- process.argv[0],
109
- process.argv[1],
110
- ...args.filter((a) => a !== "--help" && a !== "-h"),
111
- "--_ophelp"
112
- ];
109
+ process.argv = [process.argv[0], process.argv[1], ...filteredArgs, "--_ophelp"];
110
+ } else {
111
+ process.argv = [process.argv[0], process.argv[1], ...filteredArgs];
113
112
  }
114
113
  }
115
114
  }
@@ -179,6 +178,8 @@ function printRootHelp() {
179
178
  w(` ${CYAN}profile${R} Manage named profiles
180
179
  `);
181
180
  w(` ${CYAN}completion${R} Generate shell completion scripts
181
+ `);
182
+ w(` ${CYAN}upgrade${R} Upgrade to the latest version
182
183
  `);
183
184
  w(`
184
185
  `);
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/blueprint-manifest.ts
11
11
  import { defineCommand } from "citty";
@@ -57,6 +57,7 @@ var DIM = "\x1B[2m";
57
57
  var GREEN = "\x1B[32m";
58
58
  var RED = "\x1B[31m";
59
59
  var YELLOW = "\x1B[33m";
60
+ var CYAN = "\x1B[36m";
60
61
 
61
62
  export {
62
63
  isValidJson,
@@ -68,5 +69,6 @@ export {
68
69
  DIM,
69
70
  GREEN,
70
71
  RED,
71
- YELLOW
72
+ YELLOW,
73
+ CYAN
72
74
  };
@@ -10,7 +10,7 @@ import {
10
10
  pickOperation,
11
11
  printOperationsTable,
12
12
  promptParam
13
- } from "./chunk-4VITQVW2.js";
13
+ } from "./chunk-HN4QDJOJ.js";
14
14
  import {
15
15
  BOLD,
16
16
  DIM,
@@ -22,7 +22,7 @@ import {
22
22
  methodColor,
23
23
  parseKeyValue,
24
24
  parseParamValue
25
- } from "./chunk-TKZLQD2B.js";
25
+ } from "./chunk-6RBLA5YE.js";
26
26
 
27
27
  // src/lib/call.ts
28
28
  import OpenAPIClientAxiosModule from "openapi-client-axios";
@@ -159,6 +159,10 @@ var resolveBody = async (opts) => {
159
159
  const parseError = getJsonParseError(trimmed);
160
160
  process.stderr.write(`\x1B[31mInvalid JSON: ${parseError}\x1B[0m
161
161
  `);
162
+ if (attempt < MAX_RETRIES - 1) {
163
+ const { input } = await import("@inquirer/prompts");
164
+ await input({ message: "Press ENTER to reopen editor...", theme: { prefix: "" } });
165
+ }
162
166
  editorDefault = trimmed;
163
167
  }
164
168
  throw new Error("Invalid JSON from editor after multiple attempts.");
@@ -268,7 +272,7 @@ var formatResponse = async (response, options) => {
268
272
  }
269
273
  process.stderr.write("\n");
270
274
  }
271
- if (!json && process.stdout.isTTY && process.stderr.isTTY) {
275
+ if (!json && !include && process.stdout.isTTY && process.stderr.isTTY) {
272
276
  const statusColor = response.status >= 200 && response.status < 300 ? GREEN : response.status >= 400 ? RED : YELLOW;
273
277
  process.stderr.write(
274
278
  `${statusColor}${BOLD}${response.status}${RESET} ${statusColor}${response.statusText}${RESET}
@@ -323,7 +327,8 @@ var extractOperations = (spec) => {
323
327
  operationId: op.operationId,
324
328
  method: method.toUpperCase(),
325
329
  path,
326
- summary: ((op.description || "").split("\n")[0] || "").substring(0, 120)
330
+ summary: (op.summary || "").substring(0, 120),
331
+ description: (op.description || "").split("\n")[0].substring(0, 200)
327
332
  });
328
333
  }
329
334
  }
@@ -602,20 +607,16 @@ ${BOLD}epilot ${apiName}${RESET} - ${spec.info?.title || apiName}
602
607
  const opExists = operations.some((op) => op.operationId === operationId);
603
608
  if (!opExists) {
604
609
  process.stderr.write(`${RED}Unknown operation "${operationId}" for ${apiName}.${RESET}
610
+
605
611
  `);
606
- process.stderr.write(`
607
- Available operations:
608
- `);
609
- for (const op of operations) {
610
- process.stderr.write(` ${op.operationId}
612
+ process.stderr.write(`Available: ${operations.map((op) => op.operationId).join(", ")}
611
613
  `);
612
- }
613
614
  process.exit(1);
614
615
  }
615
616
  let token = resolveToken(args.token, args.profile);
616
617
  if (!token) {
617
618
  if (isInteractive({ interactive: args.interactive })) {
618
- const { promptToken } = await import("./interactive-RWCSFGXL.js");
619
+ const { promptToken } = await import("./interactive-XXYFAJEI.js");
619
620
  token = await promptToken();
620
621
  }
621
622
  if (!token) {
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  DIM,
4
- RESET,
5
- methodColor
6
- } from "./chunk-TKZLQD2B.js";
4
+ RESET
5
+ } from "./chunk-6RBLA5YE.js";
7
6
 
8
7
  // src/lib/interactive.ts
9
8
  var isInteractive = (flags) => {
@@ -11,14 +10,21 @@ var isInteractive = (flags) => {
11
10
  return !!process.stdout.isTTY;
12
11
  };
13
12
  var pickOperation = async (operations) => {
14
- const { select } = await import("@inquirer/prompts");
15
- const result = await select({
16
- message: "Select an operation:",
17
- choices: operations.map((op) => ({
18
- name: `${op.method.padEnd(7)} ${op.path} ${DIM}${op.summary}${RESET}`,
19
- value: op.operationId,
20
- description: op.operationId
21
- })),
13
+ const { search } = await import("@inquirer/prompts");
14
+ const choices = operations.map((op) => ({
15
+ name: `${op.operationId} ${DIM}${op.method.toUpperCase()} ${op.path}${RESET}`,
16
+ value: op.operationId,
17
+ description: op.description
18
+ }));
19
+ const result = await search({
20
+ message: "Select an operation (type to filter):",
21
+ source: (input) => {
22
+ if (!input) return choices;
23
+ const term = input.toLowerCase();
24
+ return choices.filter(
25
+ (c) => c.value.toLowerCase().includes(term) || c.name.toLowerCase().includes(term)
26
+ );
27
+ },
22
28
  pageSize: 20
23
29
  });
24
30
  return result;
@@ -53,11 +59,8 @@ var promptToken = async () => {
53
59
  };
54
60
  var printOperationsTable = (apiName, operations) => {
55
61
  for (const op of operations) {
56
- const color = methodColor(op.method);
57
- const method = op.method.toUpperCase().padEnd(7);
58
- const path = op.path;
59
- const summary = op.summary ? ` ${DIM}${op.summary}${RESET}` : "";
60
- process.stdout.write(` ${color}${method}${RESET} ${path.padEnd(50)} ${op.operationId}${summary}
62
+ const desc = op.description ? ` \u2013 ${op.description}` : "";
63
+ process.stdout.write(` ${op.operationId} ${DIM}${op.method.toUpperCase()} ${op.path}${desc}${RESET}
61
64
  `);
62
65
  }
63
66
  process.stdout.write(`
@@ -2,24 +2,31 @@
2
2
  import {
3
3
  API_LIST
4
4
  } from "./chunk-PHXL66VA.js";
5
+ import {
6
+ DIM,
7
+ GREEN,
8
+ RED,
9
+ RESET,
10
+ YELLOW
11
+ } from "./chunk-6RBLA5YE.js";
5
12
 
6
13
  // src/commands/completion.ts
7
14
  import { defineCommand } from "citty";
15
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, appendFileSync } from "fs";
16
+ import { homedir } from "os";
17
+ import { join } from "path";
8
18
  var BASH_SCRIPT = `
9
19
  _epilot_completions() {
10
- local cur prev words cword
11
- _init_completion || return
12
-
13
- # Get all words on the command line
20
+ local cur="\${COMP_WORDS[COMP_CWORD]}"
14
21
  local cmd="\${COMP_WORDS[0]}"
15
22
 
16
- if [[ \${cword} -eq 1 ]]; then
23
+ if [[ \${COMP_CWORD} -eq 1 ]]; then
17
24
  # First arg: subcommands (APIs + auth + profile + completion)
18
25
  COMPREPLY=( $(compgen -W "$(\${cmd} --_completions subcommands 2>/dev/null)" -- "\${cur}") )
19
26
  return
20
27
  fi
21
28
 
22
- if [[ \${cword} -eq 2 ]]; then
29
+ if [[ \${COMP_CWORD} -eq 2 ]]; then
23
30
  # Second arg: operationIds for the given API
24
31
  local api="\${COMP_WORDS[1]}"
25
32
  COMPREPLY=( $(compgen -W "$(\${cmd} --_completions operations \${api} 2>/dev/null)" -- "\${cur}") )
@@ -111,7 +118,7 @@ complete -c epilot -l help -d 'Show help'
111
118
  var handleCompletions = (type, api) => {
112
119
  if (type === "subcommands") {
113
120
  const names = API_LIST.map((a) => a.kebabName);
114
- names.push("auth", "profile", "completion");
121
+ names.push("auth", "profile", "completion", "upgrade");
115
122
  console.log(names.join("\n"));
116
123
  return;
117
124
  }
@@ -124,31 +131,42 @@ var handleCompletions = (type, api) => {
124
131
  }
125
132
  };
126
133
  var completion_default = defineCommand({
127
- meta: { name: "completion", description: "Generate shell completion scripts" },
134
+ meta: { name: "completion", description: "Generate or install shell completion scripts" },
128
135
  args: {
129
136
  shell: {
130
137
  type: "positional",
131
138
  description: "Shell type: bash, zsh, or fish",
132
139
  required: false
140
+ },
141
+ install: {
142
+ type: "boolean",
143
+ description: "Install completions to your shell config"
133
144
  }
134
145
  },
135
- run: ({ args }) => {
146
+ run: async ({ args }) => {
136
147
  const shell = args.shell || detectShell();
148
+ if (args.install) {
149
+ await installCompletions(shell);
150
+ return;
151
+ }
137
152
  switch (shell) {
138
153
  case "bash":
139
154
  console.log(BASH_SCRIPT);
140
155
  console.log("\n# Add to your ~/.bashrc:");
141
156
  console.log('# eval "$(epilot completion bash)"');
157
+ console.log("# Or run: epilot completion --install");
142
158
  break;
143
159
  case "zsh":
144
160
  console.log(ZSH_SCRIPT);
145
161
  console.log("\n# Add to your ~/.zshrc:");
146
162
  console.log('# eval "$(epilot completion zsh)"');
163
+ console.log("# Or run: epilot completion --install");
147
164
  break;
148
165
  case "fish":
149
166
  console.log(FISH_SCRIPT);
150
167
  console.log("\n# Save to ~/.config/fish/completions/epilot.fish:");
151
168
  console.log("# epilot completion fish > ~/.config/fish/completions/epilot.fish");
169
+ console.log("# Or run: epilot completion --install");
152
170
  break;
153
171
  default:
154
172
  console.error(`Unknown shell: ${shell}. Supported: bash, zsh, fish`);
@@ -156,6 +174,56 @@ var completion_default = defineCommand({
156
174
  }
157
175
  }
158
176
  });
177
+ var EVAL_LINE_BASH = 'eval "$(epilot completion bash)"';
178
+ var EVAL_LINE_ZSH = 'eval "$(epilot completion zsh)"';
179
+ var installCompletions = async (shell) => {
180
+ const home = homedir();
181
+ switch (shell) {
182
+ case "bash": {
183
+ const rcFile = join(home, ".bashrc");
184
+ addEvalLine(rcFile, EVAL_LINE_BASH, ".bashrc");
185
+ break;
186
+ }
187
+ case "zsh": {
188
+ const rcFile = join(home, ".zshrc");
189
+ addEvalLine(rcFile, EVAL_LINE_ZSH, ".zshrc");
190
+ break;
191
+ }
192
+ case "fish": {
193
+ const dir = join(home, ".config", "fish", "completions");
194
+ const file = join(dir, "epilot.fish");
195
+ mkdirSync(dir, { recursive: true });
196
+ writeFileSync(file, `${FISH_SCRIPT}
197
+ `);
198
+ process.stdout.write(`${GREEN}Completions written to ${file}${RESET}
199
+ `);
200
+ process.stdout.write(`${DIM}Fish will pick them up automatically.${RESET}
201
+ `);
202
+ break;
203
+ }
204
+ default:
205
+ process.stderr.write(`${RED}Unknown shell: ${shell}. Supported: bash, zsh, fish${RESET}
206
+ `);
207
+ process.exit(1);
208
+ }
209
+ };
210
+ var addEvalLine = (rcFile, evalLine, rcName) => {
211
+ const existing = existsSync(rcFile) ? readFileSync(rcFile, "utf-8") : "";
212
+ if (existing.includes(evalLine)) {
213
+ process.stdout.write(`${YELLOW}Completions already installed in ~/${rcName}${RESET}
214
+ `);
215
+ return;
216
+ }
217
+ const line = `
218
+ # epilot CLI completions
219
+ ${evalLine}
220
+ `;
221
+ appendFileSync(rcFile, line);
222
+ process.stdout.write(`${GREEN}Completions added to ~/${rcName}${RESET}
223
+ `);
224
+ process.stdout.write(`${DIM}Restart your shell or run: source ~/${rcName}${RESET}
225
+ `);
226
+ };
159
227
  var detectShell = () => {
160
228
  const shell = process.env.SHELL || "";
161
229
  if (shell.includes("zsh")) return "zsh";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/consent.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/customer-portal.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/dashboard.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/data-management.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/deduplication.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/design.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/document.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/email-settings.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/email-template.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/entity.ts
11
11
  import { defineCommand } from "citty";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-5CTRM3JQ.js";
4
+ } from "./chunk-BJOXXFMA.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
- import "./chunk-4VITQVW2.js";
8
- import "./chunk-TKZLQD2B.js";
7
+ import "./chunk-HN4QDJOJ.js";
8
+ import "./chunk-6RBLA5YE.js";
9
9
 
10
10
  // src/commands/apis/entity-mapping.ts
11
11
  import { defineCommand } from "citty";