@guildai/cli 0.11.0 → 0.12.0

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 (198) hide show
  1. package/dist/auth-CRMO5O3N.js +29 -0
  2. package/dist/auth-CRMO5O3N.js.map +7 -0
  3. package/dist/chat-5VX2WJH2.js +303 -0
  4. package/dist/chat-5VX2WJH2.js.map +7 -0
  5. package/dist/chat-SIKDYZQK.js +31 -0
  6. package/dist/chat-SIKDYZQK.js.map +7 -0
  7. package/dist/chunk-56YCMGL3.js +522 -0
  8. package/dist/chunk-56YCMGL3.js.map +7 -0
  9. package/dist/chunk-6EX6E7WP.js +7042 -0
  10. package/dist/chunk-6EX6E7WP.js.map +7 -0
  11. package/dist/chunk-B7VAF5UG.js +532 -0
  12. package/dist/chunk-B7VAF5UG.js.map +7 -0
  13. package/dist/chunk-DOIYVBNY.js +3057 -0
  14. package/dist/chunk-DOIYVBNY.js.map +7 -0
  15. package/dist/chunk-ENKEEJ45.js +17 -0
  16. package/dist/chunk-ENKEEJ45.js.map +7 -0
  17. package/dist/chunk-IBRKVGMZ.js +97041 -0
  18. package/dist/chunk-IBRKVGMZ.js.map +7 -0
  19. package/dist/chunk-LFMQJOKC.js +19778 -0
  20. package/dist/chunk-LFMQJOKC.js.map +7 -0
  21. package/dist/chunk-M347HP6M.js +22896 -0
  22. package/dist/chunk-M347HP6M.js.map +7 -0
  23. package/dist/chunk-OYQ476FQ.js +44 -0
  24. package/dist/chunk-OYQ476FQ.js.map +7 -0
  25. package/dist/chunk-PNCUR4OB.js +257 -0
  26. package/dist/chunk-PNCUR4OB.js.map +7 -0
  27. package/dist/chunk-RIG2HZWM.js +317 -0
  28. package/dist/chunk-RIG2HZWM.js.map +7 -0
  29. package/dist/chunk-SPZPZXUN.js +826 -0
  30. package/dist/chunk-SPZPZXUN.js.map +7 -0
  31. package/dist/chunk-VVSOU6ON.js +53 -0
  32. package/dist/chunk-VVSOU6ON.js.map +7 -0
  33. package/dist/chunk-X3ADGWOF.js +3643 -0
  34. package/dist/chunk-X3ADGWOF.js.map +7 -0
  35. package/dist/commands/skill/create.d.ts +3 -0
  36. package/dist/commands/skill/get.d.ts +3 -0
  37. package/dist/commands/skill/list.d.ts +3 -0
  38. package/dist/commands/skill/update.d.ts +3 -0
  39. package/dist/commands/skill/version/create.d.ts +3 -0
  40. package/dist/commands/skill/version/get.d.ts +3 -0
  41. package/dist/commands/skill/version/list.d.ts +3 -0
  42. package/dist/devtools-AO7YSDOD.js +67 -0
  43. package/dist/devtools-AO7YSDOD.js.map +7 -0
  44. package/dist/dist-4CBK6X5H.js +1566 -0
  45. package/dist/dist-4CBK6X5H.js.map +7 -0
  46. package/dist/esm-FRAVZP4J.js +13 -0
  47. package/dist/esm-FRAVZP4J.js.map +7 -0
  48. package/dist/execa-XQMWSABC.js +35 -0
  49. package/dist/execa-XQMWSABC.js.map +7 -0
  50. package/dist/index.js +8230 -263
  51. package/dist/index.js.map +7 -0
  52. package/dist/lib/api-types.d.ts +44 -0
  53. package/dist/lib/config.d.ts +9 -0
  54. package/dist/lib/errors.d.ts +1 -1
  55. package/dist/lib/output.d.ts +11 -1
  56. package/dist/lib/session-events.d.ts +1 -1
  57. package/dist/lib/session-polling.d.ts +24 -1
  58. package/dist/lib/websocket-client.d.ts +46 -0
  59. package/dist/open-RF4X5MOP.js +13 -0
  60. package/dist/open-RF4X5MOP.js.map +7 -0
  61. package/dist/server-JYVH64FD.js +27659 -0
  62. package/dist/server-JYVH64FD.js.map +7 -0
  63. package/dist/test-SNIYRJ32.js +692 -0
  64. package/dist/test-SNIYRJ32.js.map +7 -0
  65. package/docs/skills/codex-agent-dev.md +2 -2
  66. package/package.json +8 -12
  67. package/dist/commands/agent/chat.js +0 -281
  68. package/dist/commands/agent/clone.js +0 -118
  69. package/dist/commands/agent/code.js +0 -87
  70. package/dist/commands/agent/fork.js +0 -220
  71. package/dist/commands/agent/get.js +0 -37
  72. package/dist/commands/agent/grep.js +0 -107
  73. package/dist/commands/agent/init.js +0 -403
  74. package/dist/commands/agent/list.js +0 -110
  75. package/dist/commands/agent/logs.js +0 -62
  76. package/dist/commands/agent/owners.js +0 -74
  77. package/dist/commands/agent/publish.js +0 -91
  78. package/dist/commands/agent/pull.js +0 -194
  79. package/dist/commands/agent/revalidate.js +0 -56
  80. package/dist/commands/agent/save.js +0 -345
  81. package/dist/commands/agent/search.js +0 -61
  82. package/dist/commands/agent/tags/add.js +0 -73
  83. package/dist/commands/agent/tags/list.js +0 -43
  84. package/dist/commands/agent/tags/remove.js +0 -84
  85. package/dist/commands/agent/tags/set.js +0 -71
  86. package/dist/commands/agent/test.js +0 -489
  87. package/dist/commands/agent/unpublish.js +0 -64
  88. package/dist/commands/agent/update.js +0 -118
  89. package/dist/commands/agent/versions.js +0 -55
  90. package/dist/commands/agent/workspaces.js +0 -54
  91. package/dist/commands/auth/login.js +0 -31
  92. package/dist/commands/auth/logout.js +0 -24
  93. package/dist/commands/auth/status.js +0 -38
  94. package/dist/commands/auth/token.js +0 -19
  95. package/dist/commands/chat.js +0 -1416
  96. package/dist/commands/config/get.js +0 -64
  97. package/dist/commands/config/list.js +0 -46
  98. package/dist/commands/config/path.js +0 -37
  99. package/dist/commands/config/set.js +0 -132
  100. package/dist/commands/credentials/endpoint-list.js +0 -88
  101. package/dist/commands/credentials/list.js +0 -50
  102. package/dist/commands/credentials/policy-create.js +0 -66
  103. package/dist/commands/credentials/policy-delete.js +0 -33
  104. package/dist/commands/credentials/policy-list.js +0 -45
  105. package/dist/commands/credentials/policy-update.js +0 -66
  106. package/dist/commands/doctor.js +0 -233
  107. package/dist/commands/integration/connect.js +0 -76
  108. package/dist/commands/integration/create.js +0 -298
  109. package/dist/commands/integration/get.js +0 -95
  110. package/dist/commands/integration/list.js +0 -62
  111. package/dist/commands/integration/operation/create.js +0 -164
  112. package/dist/commands/integration/operation/list.js +0 -92
  113. package/dist/commands/integration/update.js +0 -139
  114. package/dist/commands/integration/version/build.js +0 -86
  115. package/dist/commands/integration/version/create.js +0 -45
  116. package/dist/commands/integration/version/get.js +0 -72
  117. package/dist/commands/integration/version/list.js +0 -45
  118. package/dist/commands/integration/version/publish.js +0 -79
  119. package/dist/commands/integration/version/test.js +0 -104
  120. package/dist/commands/job/get-step.js +0 -40
  121. package/dist/commands/job/get.js +0 -44
  122. package/dist/commands/mcp.js +0 -34
  123. package/dist/commands/session/create.js +0 -59
  124. package/dist/commands/session/events.js +0 -56
  125. package/dist/commands/session/get.js +0 -33
  126. package/dist/commands/session/interrupt.js +0 -33
  127. package/dist/commands/session/list.js +0 -59
  128. package/dist/commands/session/send.js +0 -54
  129. package/dist/commands/session/tasks.js +0 -45
  130. package/dist/commands/setup.js +0 -260
  131. package/dist/commands/trigger/activate.js +0 -41
  132. package/dist/commands/trigger/create.js +0 -197
  133. package/dist/commands/trigger/deactivate.js +0 -41
  134. package/dist/commands/trigger/get.js +0 -33
  135. package/dist/commands/trigger/list.js +0 -57
  136. package/dist/commands/trigger/sessions.js +0 -48
  137. package/dist/commands/trigger/update.js +0 -128
  138. package/dist/commands/version.js +0 -24
  139. package/dist/commands/workspace/agent/add.js +0 -114
  140. package/dist/commands/workspace/agent/list.js +0 -78
  141. package/dist/commands/workspace/agent/remove.js +0 -78
  142. package/dist/commands/workspace/clear.js +0 -45
  143. package/dist/commands/workspace/context/edit.js +0 -107
  144. package/dist/commands/workspace/context/get.js +0 -47
  145. package/dist/commands/workspace/context/list.js +0 -51
  146. package/dist/commands/workspace/context/publish.js +0 -42
  147. package/dist/commands/workspace/create.js +0 -51
  148. package/dist/commands/workspace/current.js +0 -63
  149. package/dist/commands/workspace/get.js +0 -39
  150. package/dist/commands/workspace/list.js +0 -70
  151. package/dist/commands/workspace/select.js +0 -184
  152. package/dist/components/AgentInstallPrompt.js +0 -97
  153. package/dist/components/SplashAnimation.js +0 -321
  154. package/dist/components/TaskView.js +0 -268
  155. package/dist/lib/agent-helpers.js +0 -306
  156. package/dist/lib/alternate-screen.js +0 -59
  157. package/dist/lib/api-client.js +0 -154
  158. package/dist/lib/api-types.js +0 -10
  159. package/dist/lib/auth.js +0 -284
  160. package/dist/lib/braille-canvas.js +0 -321
  161. package/dist/lib/colors.js +0 -46
  162. package/dist/lib/config-cache.js +0 -45
  163. package/dist/lib/config.js +0 -153
  164. package/dist/lib/did-you-mean.js +0 -144
  165. package/dist/lib/errors.js +0 -375
  166. package/dist/lib/event-filter.js +0 -91
  167. package/dist/lib/generated-types.js +0 -56
  168. package/dist/lib/git.js +0 -176
  169. package/dist/lib/gk.js +0 -91
  170. package/dist/lib/guild-config.js +0 -178
  171. package/dist/lib/iap.js +0 -117
  172. package/dist/lib/integration-helpers.js +0 -38
  173. package/dist/lib/loading-messages.js +0 -72
  174. package/dist/lib/logo.js +0 -141
  175. package/dist/lib/lottie-serverside.js +0 -181
  176. package/dist/lib/markdown.js +0 -38
  177. package/dist/lib/npmrc.js +0 -59
  178. package/dist/lib/output-mode.js +0 -54
  179. package/dist/lib/output.js +0 -622
  180. package/dist/lib/owner-helpers.js +0 -112
  181. package/dist/lib/polling.js +0 -76
  182. package/dist/lib/progress.js +0 -324
  183. package/dist/lib/session-events-fetch.js +0 -25
  184. package/dist/lib/session-events.js +0 -126
  185. package/dist/lib/session-polling.js +0 -166
  186. package/dist/lib/session-resume.js +0 -229
  187. package/dist/lib/spinners.js +0 -770
  188. package/dist/lib/splash.js +0 -42
  189. package/dist/lib/stdin.js +0 -91
  190. package/dist/lib/svg-to-braille.js +0 -76
  191. package/dist/lib/table.js +0 -59
  192. package/dist/lib/update-check.js +0 -65
  193. package/dist/lib/validate-input-schema.js +0 -208
  194. package/dist/lib/version-helpers.js +0 -137
  195. package/dist/lib/workspace-helpers.js +0 -49
  196. package/dist/mcp/resources.js +0 -67
  197. package/dist/mcp/server.js +0 -64
  198. package/dist/mcp/tools.js +0 -753
@@ -1,118 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import * as readline from 'readline';
5
- import { GuildAPIClient } from '../../lib/api-client.js';
6
- import { getAgentId, resolveAgentRef } from '../../lib/agent-helpers.js';
7
- import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
8
- import { createOutputWriter } from '../../lib/output.js';
9
- import { isInteractive } from '../../lib/stdin.js';
10
- async function confirmVisibilityChange(agentName, makePublic) {
11
- const rl = readline.createInterface({
12
- input: process.stdin,
13
- output: process.stdout,
14
- });
15
- const action = makePublic ? 'PUBLIC' : 'PRIVATE';
16
- const warning = makePublic
17
- ? 'This will make the agent visible to everyone.\nWarning: Once public, an agent cannot be made private again.'
18
- : 'This will hide the agent from public discovery.';
19
- return new Promise((resolve) => {
20
- rl.question(`\nAre you sure you want to make "${agentName}" ${action}?\n${warning}\n\nContinue? [y/N] `, (answer) => {
21
- rl.close();
22
- resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
23
- });
24
- });
25
- }
26
- export function createAgentUpdateCommand() {
27
- const cmd = new Command('update');
28
- cmd
29
- .description('Update agent properties (visibility)')
30
- .argument('[identifier]', 'Agent ID or full name (e.g., owner~agent-name)')
31
- .option('--public', 'Make the agent public (visible to everyone)')
32
- .option('--private', 'Make the agent private (only visible to owner)')
33
- .option('--yes', 'Skip confirmation prompt for visibility changes')
34
- .action(async (identifierArg, options) => {
35
- const output = createOutputWriter();
36
- // Validate that at least one option is provided
37
- if (!options.public && !options.private) {
38
- output.error('No update options provided.', 'Usage: guild agent update [identifier] [options]\n\nOptions:\n --public Make the agent public\n --private Make the agent private\n --yes Skip confirmation prompt\n\nExamples:\n guild agent update my-agent --public\n guild agent update my-agent --private --yes\n guild agent update --public (uses guild.json)\n\nNote: Agent descriptions are set from README.md when publishing.');
39
- process.exit(1);
40
- }
41
- // Validate that --public and --private are not both specified
42
- if (options.public && options.private) {
43
- output.error('Cannot specify both --public and --private');
44
- process.exit(1);
45
- }
46
- const { agentId } = await getAgentId(identifierArg);
47
- const client = new GuildAPIClient();
48
- try {
49
- const resolvedId = await resolveAgentRef(client, agentId);
50
- // Fetch current agent info for confirmation prompts
51
- const agent = await client.get(`/agents/${resolvedId}`);
52
- // Handle visibility change confirmation
53
- const changingVisibility = options.public || options.private;
54
- if (changingVisibility) {
55
- const makePublic = Boolean(options.public);
56
- // Check if already in desired state
57
- if (agent.is_public === makePublic) {
58
- output.progress(`Agent "${agent.full_name}" is already ${makePublic ? 'public' : 'private'}.`);
59
- process.exit(0);
60
- }
61
- // Confirm unless --yes is specified
62
- if (!options.yes) {
63
- if (!isInteractive()) {
64
- output.error('Confirmation required for visibility changes.', 'Use --yes to skip confirmation in non-interactive mode:\n guild agent update ' +
65
- (identifierArg ?? '') +
66
- (makePublic ? ' --public' : ' --private') +
67
- ' --yes');
68
- process.exit(1);
69
- }
70
- const confirmed = await confirmVisibilityChange(agent.full_name, makePublic);
71
- if (!confirmed) {
72
- output.progress('Cancelled.');
73
- process.exit(0);
74
- }
75
- }
76
- }
77
- // Build update payload
78
- const updatePayload = {};
79
- if (options.public) {
80
- updatePayload.is_public = true;
81
- }
82
- if (options.private) {
83
- updatePayload.is_public = false;
84
- }
85
- const result = await client.patch(`/agents/${resolvedId}`, updatePayload);
86
- // Build success message
87
- const changes = [];
88
- if (changingVisibility) {
89
- changes.push(`visibility: ${result.is_public ? 'public' : 'private'}`);
90
- }
91
- output.data({
92
- success: 'Agent updated',
93
- id: result.id,
94
- full_name: result.full_name,
95
- is_public: result.is_public,
96
- changes: changes,
97
- });
98
- }
99
- catch (error) {
100
- const formattedError = handleAxiosError(error);
101
- if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
102
- output.error('Not logged in.', 'Please authenticate first:\n guild auth login');
103
- }
104
- else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
105
- output.error('Cannot connect to Guild servers');
106
- }
107
- else if (formattedError.code === ErrorCodes.NOT_FOUND) {
108
- output.error(`Agent not found: ${agentId}`, 'Check the agent ID:\n guild agent list');
109
- }
110
- else {
111
- output.error(`Failed to update agent: ${formattedError.details}`);
112
- }
113
- process.exit(1);
114
- }
115
- });
116
- return cmd;
117
- }
118
- //# sourceMappingURL=update.js.map
@@ -1,55 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { GuildAPIClient } from '../../lib/api-client.js';
5
- import { getGuildcoreUrl } from '../../lib/config.js';
6
- import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
7
- import { getAgentId, resolveAgentRef } from '../../lib/agent-helpers.js';
8
- import { isMachineReadable } from '../../lib/output-mode.js';
9
- import { createOutputWriter, formatVersionTable } from '../../lib/output.js';
10
- import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
11
- export function createAgentVersionsCommand() {
12
- const cmd = new Command('versions');
13
- cmd
14
- .description('List all versions of an agent')
15
- .argument('[identifier]', 'Agent ID or full name (e.g., owner~agent-name)')
16
- .option('--limit <number>', `Maximum number of versions to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
17
- .option('--offset <number>', 'Number of versions to skip (default: 0)', '0')
18
- .action(async (agentIdArg, options) => {
19
- const output = createOutputWriter();
20
- // Get agent ID from argument or guild.json
21
- const { agentId } = await getAgentId(agentIdArg);
22
- const baseUrl = getGuildcoreUrl();
23
- const client = new GuildAPIClient({ baseUrl });
24
- const limit = parseInt(options.limit, 10);
25
- const offset = parseInt(options.offset, 10);
26
- try {
27
- const resolvedId = await resolveAgentRef(client, agentId);
28
- const result = await client.get(`/agents/${resolvedId}/versions?limit=${limit}&offset=${offset}`);
29
- if (isMachineReadable()) {
30
- output.data(result);
31
- }
32
- else {
33
- formatVersionTable(result.items, result.pagination);
34
- }
35
- }
36
- catch (error) {
37
- const formattedError = handleAxiosError(error);
38
- if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
39
- output.error('Not logged in.', 'Please authenticate first:\n guild auth login');
40
- }
41
- else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
42
- output.error('Cannot connect to Guild servers');
43
- }
44
- else if (formattedError.code === ErrorCodes.NOT_FOUND) {
45
- output.error(`Agent not found: ${agentId}`, 'Check the agent ID:\n guild agent list');
46
- }
47
- else {
48
- output.error(`Failed to list agent versions: ${formattedError.details}`);
49
- }
50
- process.exit(1);
51
- }
52
- });
53
- return cmd;
54
- }
55
- //# sourceMappingURL=versions.js.map
@@ -1,54 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { GuildAPIClient } from '../../lib/api-client.js';
5
- import { getGuildcoreUrl } from '../../lib/config.js';
6
- import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
7
- import { getAgentId, resolveAgentRef } from '../../lib/agent-helpers.js';
8
- import { createOutputWriter, formatWorkspaceTable } from '../../lib/output.js';
9
- import { isMachineReadable } from '../../lib/output-mode.js';
10
- import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
11
- export function createAgentWorkspacesCommand() {
12
- const cmd = new Command('workspaces');
13
- cmd
14
- .description('List workspaces that use an agent')
15
- .argument('[identifier]', 'Agent ID or full name (e.g., owner~agent-name)')
16
- .option('--limit <number>', `Maximum number of workspaces to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
17
- .option('--offset <number>', 'Number of workspaces to skip (default: 0)', '0')
18
- .action(async (agentIdArg, options) => {
19
- const output = createOutputWriter();
20
- const { agentId } = await getAgentId(agentIdArg);
21
- const baseUrl = getGuildcoreUrl();
22
- const client = new GuildAPIClient({ baseUrl });
23
- const limit = parseInt(options.limit, 10);
24
- const offset = parseInt(options.offset, 10);
25
- try {
26
- const resolvedId = await resolveAgentRef(client, agentId);
27
- const result = await client.get(`/agents/${resolvedId}/workspaces?limit=${limit}&offset=${offset}`);
28
- if (isMachineReadable()) {
29
- output.data(result);
30
- }
31
- else {
32
- formatWorkspaceTable(result.items, result.pagination);
33
- }
34
- }
35
- catch (error) {
36
- const formattedError = handleAxiosError(error);
37
- if (formattedError.code === ErrorCodes.AUTH_REQUIRED) {
38
- output.error('Not logged in.', 'Please authenticate first:\n guild auth login');
39
- }
40
- else if (formattedError.code === ErrorCodes.CONN_REFUSED) {
41
- output.error('Cannot connect to Guild servers');
42
- }
43
- else if (formattedError.code === ErrorCodes.NOT_FOUND) {
44
- output.error(`Agent not found: ${agentId}`, 'Check the agent ID:\n guild agent list');
45
- }
46
- else {
47
- output.error(`Failed to list workspaces: ${formattedError.details}`);
48
- }
49
- process.exit(1);
50
- }
51
- });
52
- return cmd;
53
- }
54
- //# sourceMappingURL=workspaces.js.map
@@ -1,31 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { login } from '../../lib/auth.js';
5
- import { configureNpmrc } from '../../lib/npmrc.js';
6
- import { debug } from '../../lib/errors.js';
7
- import { createOutputWriter } from '../../lib/output.js';
8
- export function createAuthLoginCommand() {
9
- const cmd = new Command('login');
10
- cmd
11
- .description('Login to Guild.ai')
12
- .option('--return-url <url>', 'Custom URL to redirect to after authentication')
13
- .option('--return-label <text>', 'Friendly label for return button (e.g., "VSCode")')
14
- .action(async (options) => {
15
- const output = createOutputWriter();
16
- const success = await login(options.returnUrl, options.returnLabel);
17
- if (success) {
18
- try {
19
- await configureNpmrc();
20
- output.progress('Configured registry in ~/.npmrc');
21
- }
22
- catch (error) {
23
- debug('npmrc configuration failed:', error);
24
- output.error('Could not configure npm registry in ~/.npmrc');
25
- }
26
- }
27
- process.exit(success ? 0 : 1);
28
- });
29
- return cmd;
30
- }
31
- //# sourceMappingURL=login.js.map
@@ -1,24 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { logout } from '../../lib/auth.js';
5
- import { cleanupNpmrc } from '../../lib/npmrc.js';
6
- import { debug } from '../../lib/errors.js';
7
- import { createOutputWriter } from '../../lib/output.js';
8
- export function createAuthLogoutCommand() {
9
- const cmd = new Command('logout');
10
- cmd.description('Logout from Guild.ai').action(async () => {
11
- const output = createOutputWriter();
12
- await logout();
13
- try {
14
- await cleanupNpmrc();
15
- }
16
- catch (error) {
17
- debug('npmrc cleanup failed:', error);
18
- output.error('Could not clean up npm registry entries from ~/.npmrc');
19
- }
20
- process.exit(0);
21
- });
22
- return cmd;
23
- }
24
- //# sourceMappingURL=logout.js.map
@@ -1,38 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { getAuthStatus } from '../../lib/auth.js';
5
- import { createOutputWriter } from '../../lib/output.js';
6
- import { GuildAPIClient } from '../../lib/api-client.js';
7
- import { GuildCLIError, ErrorCodes } from '../../lib/errors.js';
8
- export function createAuthStatusCommand() {
9
- const cmd = new Command('status');
10
- cmd.description('Check authentication status').action(async () => {
11
- const output = createOutputWriter();
12
- const { authenticated } = await getAuthStatus();
13
- if (!authenticated) {
14
- output.error('Not authenticated');
15
- process.exit(0);
16
- return;
17
- }
18
- // Try to fetch user profile for richer output
19
- try {
20
- const client = new GuildAPIClient();
21
- const me = await client.get('/me');
22
- output.success(`Authenticated as ${me.name} (${me.id})`);
23
- }
24
- catch (error) {
25
- if (error instanceof GuildCLIError &&
26
- error.code === ErrorCodes.AUTH_TOKEN_INVALID) {
27
- output.error('Not authenticated (token expired)', 'Run: guild auth login');
28
- }
29
- else {
30
- // Offline or other network error — fall back to simple message
31
- output.success('Authenticated');
32
- }
33
- }
34
- process.exit(0);
35
- });
36
- return cmd;
37
- }
38
- //# sourceMappingURL=status.js.map
@@ -1,19 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import { getAuthToken } from '../../lib/auth.js';
5
- import { createOutputWriter } from '../../lib/output.js';
6
- export function createAuthTokenCommand() {
7
- const cmd = new Command('token');
8
- cmd.description('Print auth token to stdout (for scripting)').action(async () => {
9
- const output = createOutputWriter();
10
- const token = await getAuthToken();
11
- if (!token) {
12
- output.error('Not authenticated. Run: guild auth login');
13
- process.exit(1);
14
- }
15
- console.log(token);
16
- });
17
- return cmd;
18
- }
19
- //# sourceMappingURL=token.js.map