@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.
- package/dist/commands/agent/clone.js +3 -1
- package/dist/commands/agent/code.js +3 -2
- package/dist/commands/agent/fork.js +40 -14
- package/dist/commands/agent/get.js +3 -2
- package/dist/commands/agent/grep.js +61 -31
- package/dist/commands/agent/publish.js +3 -2
- package/dist/commands/agent/revalidate.js +4 -3
- package/dist/commands/agent/search.js +3 -3
- package/dist/commands/agent/tags/add.js +4 -3
- package/dist/commands/agent/tags/list.js +3 -2
- package/dist/commands/agent/tags/remove.js +4 -3
- package/dist/commands/agent/tags/set.js +3 -2
- package/dist/commands/agent/unpublish.js +3 -2
- package/dist/commands/agent/update.js +9 -8
- package/dist/commands/agent/versions.js +3 -2
- package/dist/commands/agent/workspaces.js +3 -2
- package/dist/commands/credentials/endpoint-list.d.ts +3 -0
- package/dist/commands/credentials/endpoint-list.js +87 -0
- package/dist/commands/credentials/list.d.ts +3 -0
- package/dist/commands/{container → credentials}/list.js +11 -10
- package/dist/commands/credentials/policy-create.d.ts +3 -0
- package/dist/commands/credentials/policy-create.js +66 -0
- package/dist/commands/credentials/policy-delete.d.ts +3 -0
- package/dist/commands/{container/get.js → credentials/policy-delete.js} +9 -9
- package/dist/commands/credentials/policy-list.d.ts +3 -0
- package/dist/commands/{container-image/list.js → credentials/policy-list.js} +9 -9
- package/dist/commands/credentials/policy-update.d.ts +3 -0
- package/dist/commands/credentials/policy-update.js +66 -0
- package/dist/commands/trigger/create.js +35 -19
- package/dist/commands/workspace/select.js +0 -1
- package/dist/index.js +22 -27
- package/dist/lib/agent-helpers.d.ts +8 -0
- package/dist/lib/agent-helpers.js +15 -0
- package/dist/lib/api-types.d.ts +52 -78
- package/dist/lib/auth.js +7 -4
- package/dist/lib/output.d.ts +3 -16
- package/dist/lib/output.js +43 -109
- package/dist/mcp/tools.js +1 -1
- package/docs/CLI_WORKFLOW.md +4 -2
- package/docs/skills/agent-dev.md +2 -2
- package/package.json +3 -3
- package/dist/commands/container/destroy.d.ts +0 -3
- package/dist/commands/container/destroy.js +0 -48
- package/dist/commands/container/events.d.ts +0 -3
- package/dist/commands/container/events.js +0 -44
- package/dist/commands/container/exec.d.ts +0 -3
- package/dist/commands/container/exec.js +0 -64
- package/dist/commands/container/get.d.ts +0 -3
- package/dist/commands/container/list.d.ts +0 -3
- package/dist/commands/container-image/create.d.ts +0 -3
- package/dist/commands/container-image/create.js +0 -41
- package/dist/commands/container-image/get.d.ts +0 -3
- package/dist/commands/container-image/get.js +0 -33
- 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,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,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
|