@guildai/cli 0.5.13 → 0.6.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 (54) hide show
  1. package/dist/commands/agent/clone.js +3 -1
  2. package/dist/commands/agent/code.js +3 -2
  3. package/dist/commands/agent/fork.js +40 -14
  4. package/dist/commands/agent/get.js +3 -2
  5. package/dist/commands/agent/grep.js +61 -31
  6. package/dist/commands/agent/publish.js +3 -2
  7. package/dist/commands/agent/revalidate.js +4 -3
  8. package/dist/commands/agent/search.js +3 -3
  9. package/dist/commands/agent/tags/add.js +4 -3
  10. package/dist/commands/agent/tags/list.js +3 -2
  11. package/dist/commands/agent/tags/remove.js +4 -3
  12. package/dist/commands/agent/tags/set.js +3 -2
  13. package/dist/commands/agent/unpublish.js +3 -2
  14. package/dist/commands/agent/update.js +9 -8
  15. package/dist/commands/agent/versions.js +3 -2
  16. package/dist/commands/agent/workspaces.js +3 -2
  17. package/dist/commands/credentials/endpoint-list.d.ts +3 -0
  18. package/dist/commands/credentials/endpoint-list.js +87 -0
  19. package/dist/commands/credentials/list.d.ts +3 -0
  20. package/dist/commands/{container → credentials}/list.js +11 -10
  21. package/dist/commands/credentials/policy-create.d.ts +3 -0
  22. package/dist/commands/credentials/policy-create.js +66 -0
  23. package/dist/commands/credentials/policy-delete.d.ts +3 -0
  24. package/dist/commands/{container/get.js → credentials/policy-delete.js} +9 -9
  25. package/dist/commands/credentials/policy-list.d.ts +3 -0
  26. package/dist/commands/{container-image/list.js → credentials/policy-list.js} +9 -9
  27. package/dist/commands/credentials/policy-update.d.ts +3 -0
  28. package/dist/commands/credentials/policy-update.js +66 -0
  29. package/dist/commands/trigger/create.js +35 -19
  30. package/dist/commands/workspace/select.js +0 -1
  31. package/dist/index.js +22 -27
  32. package/dist/lib/agent-helpers.d.ts +8 -0
  33. package/dist/lib/agent-helpers.js +15 -0
  34. package/dist/lib/api-types.d.ts +52 -78
  35. package/dist/lib/auth.js +7 -4
  36. package/dist/lib/output.d.ts +3 -16
  37. package/dist/lib/output.js +43 -109
  38. package/dist/mcp/tools.js +1 -1
  39. package/docs/CLI_WORKFLOW.md +4 -2
  40. package/docs/skills/agent-dev.md +2 -2
  41. package/package.json +3 -3
  42. package/dist/commands/container/destroy.d.ts +0 -3
  43. package/dist/commands/container/destroy.js +0 -48
  44. package/dist/commands/container/events.d.ts +0 -3
  45. package/dist/commands/container/events.js +0 -44
  46. package/dist/commands/container/exec.d.ts +0 -3
  47. package/dist/commands/container/exec.js +0 -64
  48. package/dist/commands/container/get.d.ts +0 -3
  49. package/dist/commands/container/list.d.ts +0 -3
  50. package/dist/commands/container-image/create.d.ts +0 -3
  51. package/dist/commands/container-image/create.js +0 -41
  52. package/dist/commands/container-image/get.d.ts +0 -3
  53. package/dist/commands/container-image/get.js +0 -33
  54. package/dist/commands/container-image/list.d.ts +0 -3
@@ -1,64 +0,0 @@
1
- // Copyright 2026 Guild.ai
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { Command } from 'commander';
4
- import chalk from 'chalk';
5
- import { GuildAPIClient } from '../../lib/api-client.js';
6
- import { getAuthToken } from '../../lib/auth.js';
7
- import { handleAxiosError } from '../../lib/errors.js';
8
- import { getOutputMode } from '../../lib/output-mode.js';
9
- import { createOutputWriter } from '../../lib/output.js';
10
- export function createContainerExecCommand() {
11
- const cmd = new Command('exec');
12
- cmd
13
- .description('Execute a command in a running container')
14
- .argument('<container-id>', 'Container ID')
15
- .argument('<command>', 'Command to execute')
16
- .action(async (containerId, command) => {
17
- const output = createOutputWriter();
18
- try {
19
- const token = await getAuthToken();
20
- if (!token) {
21
- output.error('Not authenticated. Run: guild auth login');
22
- process.exit(1);
23
- }
24
- const client = new GuildAPIClient();
25
- const response = await client.post(`/containers/${containerId}/command`, { command });
26
- if (getOutputMode() === 'json') {
27
- console.log(JSON.stringify(response, null, 2));
28
- }
29
- else {
30
- // Display return code
31
- if (response.return_code !== null) {
32
- const codeColor = response.return_code === 0 ? chalk.green : chalk.red;
33
- console.error(chalk.dim('Return code:'), codeColor(String(response.return_code)));
34
- }
35
- // Display stdout
36
- if (response.stdout) {
37
- console.log(response.stdout);
38
- }
39
- // Display stderr
40
- if (response.stderr) {
41
- console.error(chalk.red(response.stderr));
42
- }
43
- // Display error from event
44
- if (response.status === 'ERROR' && response.error) {
45
- console.error(chalk.red(`Error: ${response.error}`));
46
- }
47
- }
48
- // Exit with the command's return code if available
49
- if (response.return_code !== null && response.return_code !== 0) {
50
- process.exit(response.return_code);
51
- }
52
- if (response.status === 'ERROR') {
53
- process.exit(1);
54
- }
55
- }
56
- catch (error) {
57
- const formattedError = handleAxiosError(error);
58
- output.error(`Failed to execute command: ${formattedError.details}`);
59
- process.exit(1);
60
- }
61
- });
62
- return cmd;
63
- }
64
- //# sourceMappingURL=exec.js.map
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createContainerGetCommand(): Command;
3
- //# sourceMappingURL=get.d.ts.map
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createContainerListCommand(): Command;
3
- //# sourceMappingURL=list.d.ts.map
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createContainerImageCreateCommand(): Command;
3
- //# sourceMappingURL=create.d.ts.map
@@ -1,41 +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 { getAuthToken } from '../../lib/auth.js';
6
- import { handleAxiosError } from '../../lib/errors.js';
7
- import { createOutputWriter } from '../../lib/output.js';
8
- export function createContainerImageCreateCommand() {
9
- const cmd = new Command('create');
10
- cmd
11
- .description('Create a container image')
12
- .requiredOption('--account <id-or-name>', 'Account or organization ID or name')
13
- .requiredOption('--name <name>', 'Image name (1-100 characters)')
14
- .requiredOption('--image <image>', 'Container image path (e.g. registry.example.com/org/image)')
15
- .requiredOption('--tag <tag>', 'Image tag (e.g. latest)')
16
- .action(async (opts) => {
17
- const output = createOutputWriter();
18
- try {
19
- const token = await getAuthToken();
20
- if (!token) {
21
- output.error('Not authenticated. Run: guild auth login');
22
- process.exit(1);
23
- }
24
- const client = new GuildAPIClient();
25
- const response = await client.post('/container-images', {
26
- name: opts.name,
27
- image_name: opts.image,
28
- tag: opts.tag,
29
- owner_id_or_name: opts.account,
30
- });
31
- output.data(response);
32
- }
33
- catch (error) {
34
- const formattedError = handleAxiosError(error);
35
- output.error(`Failed to create container image: ${formattedError.details}`);
36
- process.exit(1);
37
- }
38
- });
39
- return cmd;
40
- }
41
- //# sourceMappingURL=create.js.map
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createContainerImageGetCommand(): Command;
3
- //# sourceMappingURL=get.d.ts.map
@@ -1,33 +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 { getAuthToken } from '../../lib/auth.js';
6
- import { handleAxiosError } from '../../lib/errors.js';
7
- import { createOutputWriter } from '../../lib/output.js';
8
- export function createContainerImageGetCommand() {
9
- const cmd = new Command('get');
10
- cmd
11
- .description('Get container image details')
12
- .argument('<image-id-or-name>', 'Container image ID or name (owner~name)')
13
- .action(async (imageIdOrName) => {
14
- const output = createOutputWriter();
15
- try {
16
- const token = await getAuthToken();
17
- if (!token) {
18
- output.error('Not authenticated. Run: guild auth login');
19
- process.exit(1);
20
- }
21
- const client = new GuildAPIClient();
22
- const response = await client.get(`/container-images/${imageIdOrName}`);
23
- output.data(response);
24
- }
25
- catch (error) {
26
- const formattedError = handleAxiosError(error);
27
- output.error(`Failed to get container image: ${formattedError.details}`);
28
- process.exit(1);
29
- }
30
- });
31
- return cmd;
32
- }
33
- //# sourceMappingURL=get.js.map
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createContainerImageListCommand(): Command;
3
- //# sourceMappingURL=list.d.ts.map