@guildai/cli 0.10.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.
- package/dist/auth-CRMO5O3N.js +29 -0
- package/dist/auth-CRMO5O3N.js.map +7 -0
- package/dist/chat-5VX2WJH2.js +303 -0
- package/dist/chat-5VX2WJH2.js.map +7 -0
- package/dist/chat-SIKDYZQK.js +31 -0
- package/dist/chat-SIKDYZQK.js.map +7 -0
- package/dist/chunk-56YCMGL3.js +522 -0
- package/dist/chunk-56YCMGL3.js.map +7 -0
- package/dist/chunk-6EX6E7WP.js +7042 -0
- package/dist/chunk-6EX6E7WP.js.map +7 -0
- package/dist/chunk-B7VAF5UG.js +532 -0
- package/dist/chunk-B7VAF5UG.js.map +7 -0
- package/dist/chunk-DOIYVBNY.js +3057 -0
- package/dist/chunk-DOIYVBNY.js.map +7 -0
- package/dist/chunk-ENKEEJ45.js +17 -0
- package/dist/chunk-ENKEEJ45.js.map +7 -0
- package/dist/chunk-IBRKVGMZ.js +97041 -0
- package/dist/chunk-IBRKVGMZ.js.map +7 -0
- package/dist/chunk-LFMQJOKC.js +19778 -0
- package/dist/chunk-LFMQJOKC.js.map +7 -0
- package/dist/chunk-M347HP6M.js +22896 -0
- package/dist/chunk-M347HP6M.js.map +7 -0
- package/dist/chunk-OYQ476FQ.js +44 -0
- package/dist/chunk-OYQ476FQ.js.map +7 -0
- package/dist/chunk-PNCUR4OB.js +257 -0
- package/dist/chunk-PNCUR4OB.js.map +7 -0
- package/dist/chunk-RIG2HZWM.js +317 -0
- package/dist/chunk-RIG2HZWM.js.map +7 -0
- package/dist/chunk-SPZPZXUN.js +826 -0
- package/dist/chunk-SPZPZXUN.js.map +7 -0
- package/dist/chunk-VVSOU6ON.js +53 -0
- package/dist/chunk-VVSOU6ON.js.map +7 -0
- package/dist/chunk-X3ADGWOF.js +3643 -0
- package/dist/chunk-X3ADGWOF.js.map +7 -0
- package/dist/commands/agent/logs.d.ts +3 -0
- package/dist/commands/setup.d.ts +16 -0
- package/dist/commands/skill/create.d.ts +3 -0
- package/dist/commands/skill/get.d.ts +3 -0
- package/dist/commands/skill/list.d.ts +3 -0
- package/dist/commands/skill/update.d.ts +3 -0
- package/dist/commands/skill/version/create.d.ts +3 -0
- package/dist/commands/skill/version/get.d.ts +3 -0
- package/dist/commands/skill/version/list.d.ts +3 -0
- package/dist/devtools-AO7YSDOD.js +67 -0
- package/dist/devtools-AO7YSDOD.js.map +7 -0
- package/dist/dist-4CBK6X5H.js +1566 -0
- package/dist/dist-4CBK6X5H.js.map +7 -0
- package/dist/esm-FRAVZP4J.js +13 -0
- package/dist/esm-FRAVZP4J.js.map +7 -0
- package/dist/execa-XQMWSABC.js +35 -0
- package/dist/execa-XQMWSABC.js.map +7 -0
- package/dist/index.js +8231 -253
- package/dist/index.js.map +7 -0
- package/dist/lib/api-types.d.ts +44 -0
- package/dist/lib/auth.d.ts +1 -1
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/output-mode.d.ts +9 -2
- package/dist/lib/output.d.ts +17 -1
- package/dist/lib/session-events.d.ts +14 -3
- package/dist/lib/session-polling.d.ts +24 -1
- package/dist/lib/session-resume.d.ts +15 -1
- package/dist/lib/stdin.d.ts +5 -1
- package/dist/lib/websocket-client.d.ts +46 -0
- package/dist/open-RF4X5MOP.js +13 -0
- package/dist/open-RF4X5MOP.js.map +7 -0
- package/dist/server-JYVH64FD.js +27659 -0
- package/dist/server-JYVH64FD.js.map +7 -0
- package/dist/test-SNIYRJ32.js +692 -0
- package/dist/test-SNIYRJ32.js.map +7 -0
- package/docs/skills/codex-agent-dev.md +2 -2
- package/package.json +8 -12
- package/dist/commands/agent/chat.js +0 -278
- package/dist/commands/agent/clone.js +0 -116
- package/dist/commands/agent/code.js +0 -87
- package/dist/commands/agent/fork.js +0 -218
- package/dist/commands/agent/get.js +0 -37
- package/dist/commands/agent/grep.js +0 -107
- package/dist/commands/agent/init.js +0 -390
- package/dist/commands/agent/list.js +0 -110
- package/dist/commands/agent/owners.js +0 -74
- package/dist/commands/agent/publish.js +0 -91
- package/dist/commands/agent/pull.js +0 -198
- package/dist/commands/agent/revalidate.js +0 -56
- package/dist/commands/agent/save.js +0 -346
- package/dist/commands/agent/search.js +0 -61
- package/dist/commands/agent/tags/add.js +0 -73
- package/dist/commands/agent/tags/list.js +0 -43
- package/dist/commands/agent/tags/remove.js +0 -84
- package/dist/commands/agent/tags/set.js +0 -71
- package/dist/commands/agent/test.js +0 -486
- package/dist/commands/agent/unpublish.js +0 -64
- package/dist/commands/agent/update.js +0 -110
- package/dist/commands/agent/versions.js +0 -55
- package/dist/commands/agent/workspaces.js +0 -54
- package/dist/commands/auth/login.js +0 -33
- package/dist/commands/auth/logout.js +0 -24
- package/dist/commands/auth/status.js +0 -38
- package/dist/commands/auth/token.js +0 -19
- package/dist/commands/chat.js +0 -1345
- package/dist/commands/config/get.js +0 -64
- package/dist/commands/config/list.js +0 -47
- package/dist/commands/config/path.js +0 -38
- package/dist/commands/config/set.js +0 -132
- package/dist/commands/credentials/endpoint-list.js +0 -88
- package/dist/commands/credentials/list.js +0 -50
- package/dist/commands/credentials/policy-create.js +0 -66
- package/dist/commands/credentials/policy-delete.js +0 -33
- package/dist/commands/credentials/policy-list.js +0 -45
- package/dist/commands/credentials/policy-update.js +0 -66
- package/dist/commands/doctor.js +0 -233
- package/dist/commands/integration/connect.js +0 -76
- package/dist/commands/integration/create.js +0 -298
- package/dist/commands/integration/get.js +0 -95
- package/dist/commands/integration/list.js +0 -62
- package/dist/commands/integration/operation/create.js +0 -164
- package/dist/commands/integration/operation/list.js +0 -92
- package/dist/commands/integration/update.js +0 -139
- package/dist/commands/integration/version/build.js +0 -86
- package/dist/commands/integration/version/create.js +0 -45
- package/dist/commands/integration/version/get.js +0 -72
- package/dist/commands/integration/version/list.js +0 -45
- package/dist/commands/integration/version/publish.js +0 -79
- package/dist/commands/integration/version/test.js +0 -104
- package/dist/commands/job/get-step.js +0 -40
- package/dist/commands/job/get.js +0 -44
- package/dist/commands/mcp.js +0 -34
- package/dist/commands/session/create.js +0 -59
- package/dist/commands/session/events.js +0 -56
- package/dist/commands/session/get.js +0 -33
- package/dist/commands/session/interrupt.js +0 -33
- package/dist/commands/session/list.js +0 -59
- package/dist/commands/session/send.js +0 -54
- package/dist/commands/session/tasks.js +0 -45
- package/dist/commands/setup.js +0 -230
- package/dist/commands/trigger/activate.js +0 -41
- package/dist/commands/trigger/create.js +0 -197
- package/dist/commands/trigger/deactivate.js +0 -41
- package/dist/commands/trigger/get.js +0 -33
- package/dist/commands/trigger/list.js +0 -57
- package/dist/commands/trigger/sessions.js +0 -48
- package/dist/commands/trigger/update.js +0 -128
- package/dist/commands/version.js +0 -24
- package/dist/commands/workspace/agent/add.js +0 -114
- package/dist/commands/workspace/agent/list.js +0 -78
- package/dist/commands/workspace/agent/remove.js +0 -78
- package/dist/commands/workspace/clear.js +0 -45
- package/dist/commands/workspace/context/edit.js +0 -107
- package/dist/commands/workspace/context/get.js +0 -47
- package/dist/commands/workspace/context/list.js +0 -51
- package/dist/commands/workspace/context/publish.js +0 -42
- package/dist/commands/workspace/create.js +0 -51
- package/dist/commands/workspace/current.js +0 -63
- package/dist/commands/workspace/get.js +0 -39
- package/dist/commands/workspace/list.js +0 -70
- package/dist/commands/workspace/select.js +0 -184
- package/dist/components/AgentInstallPrompt.js +0 -97
- package/dist/components/SplashAnimation.js +0 -321
- package/dist/components/TaskView.js +0 -268
- package/dist/lib/agent-helpers.js +0 -306
- package/dist/lib/alternate-screen.js +0 -59
- package/dist/lib/api-client.js +0 -154
- package/dist/lib/api-types.js +0 -10
- package/dist/lib/auth.js +0 -284
- package/dist/lib/braille-canvas.js +0 -321
- package/dist/lib/colors.js +0 -46
- package/dist/lib/config-cache.js +0 -45
- package/dist/lib/config.js +0 -153
- package/dist/lib/did-you-mean.js +0 -144
- package/dist/lib/errors.js +0 -375
- package/dist/lib/event-filter.js +0 -91
- package/dist/lib/generated-types.js +0 -56
- package/dist/lib/git.js +0 -176
- package/dist/lib/gk.js +0 -91
- package/dist/lib/guild-config.js +0 -178
- package/dist/lib/iap.js +0 -117
- package/dist/lib/integration-helpers.js +0 -38
- package/dist/lib/loading-messages.js +0 -72
- package/dist/lib/logo.js +0 -141
- package/dist/lib/lottie-serverside.js +0 -181
- package/dist/lib/markdown.js +0 -38
- package/dist/lib/npmrc.js +0 -59
- package/dist/lib/output-mode.js +0 -33
- package/dist/lib/output.js +0 -591
- package/dist/lib/owner-helpers.js +0 -112
- package/dist/lib/polling.js +0 -76
- package/dist/lib/progress.js +0 -324
- package/dist/lib/session-events-fetch.js +0 -25
- package/dist/lib/session-events.js +0 -112
- package/dist/lib/session-polling.js +0 -160
- package/dist/lib/session-resume.js +0 -96
- package/dist/lib/spinners.js +0 -770
- package/dist/lib/splash.js +0 -41
- package/dist/lib/stdin.js +0 -84
- package/dist/lib/svg-to-braille.js +0 -76
- package/dist/lib/table.js +0 -59
- package/dist/lib/update-check.js +0 -65
- package/dist/lib/validate-input-schema.js +0 -208
- package/dist/lib/version-helpers.js +0 -121
- package/dist/lib/workspace-helpers.js +0 -49
- package/dist/mcp/resources.js +0 -67
- package/dist/mcp/server.js +0 -64
- package/dist/mcp/tools.js +0 -753
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Guild.ai
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import { loadConfig, } from '../../lib/guild-config.js';
|
|
5
|
-
import { getOutputMode } from '../../lib/output-mode.js';
|
|
6
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
7
|
-
/**
|
|
8
|
-
* All valid config keys across global and local configs.
|
|
9
|
-
* Note: default_workspace_name is internal (auto-resolved from API).
|
|
10
|
-
*/
|
|
11
|
-
const VALID_GLOBAL_KEYS = [
|
|
12
|
-
'default_workspace',
|
|
13
|
-
'default_owner',
|
|
14
|
-
'debug',
|
|
15
|
-
'json',
|
|
16
|
-
'quiet',
|
|
17
|
-
];
|
|
18
|
-
const VALID_LOCAL_KEYS = ['agent_id', 'name', 'workspace_id'];
|
|
19
|
-
const ALL_VALID_KEYS = [...VALID_GLOBAL_KEYS, ...VALID_LOCAL_KEYS];
|
|
20
|
-
export function createConfigGetCommand() {
|
|
21
|
-
const cmd = new Command('get');
|
|
22
|
-
cmd
|
|
23
|
-
.description('Get a configuration value')
|
|
24
|
-
.argument('<key>', `Config key (${ALL_VALID_KEYS.join(', ')})`)
|
|
25
|
-
.action(async (key) => {
|
|
26
|
-
const output = createOutputWriter();
|
|
27
|
-
const config = await loadConfig();
|
|
28
|
-
const mode = getOutputMode();
|
|
29
|
-
if (!ALL_VALID_KEYS.includes(key)) {
|
|
30
|
-
output.error(`Unknown config key: ${key}\n\nValid keys:\n Global: ${VALID_GLOBAL_KEYS.join(', ')}\n Local: ${VALID_LOCAL_KEYS.join(', ')}`);
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
// Look up in global first, then local
|
|
34
|
-
let value;
|
|
35
|
-
let source;
|
|
36
|
-
const globalRecord = config.global;
|
|
37
|
-
const localRecord = config.local;
|
|
38
|
-
if (globalRecord && key in globalRecord) {
|
|
39
|
-
value = String(globalRecord[key]);
|
|
40
|
-
source = 'global';
|
|
41
|
-
}
|
|
42
|
-
else if (localRecord && key in localRecord) {
|
|
43
|
-
value = String(localRecord[key]);
|
|
44
|
-
source = 'local';
|
|
45
|
-
}
|
|
46
|
-
if (value === undefined) {
|
|
47
|
-
if (mode === 'json') {
|
|
48
|
-
output.data({ key, value: null, source: null });
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
output.error(`Key not found: ${key}`);
|
|
52
|
-
}
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
if (mode === 'json') {
|
|
56
|
-
output.data({ key, value, source });
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
output.data(value);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return cmd;
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1,47 +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 { loadConfig } from '../../lib/guild-config.js';
|
|
6
|
-
import { getOutputMode } from '../../lib/output-mode.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
export function createConfigListCommand() {
|
|
9
|
-
const cmd = new Command('list');
|
|
10
|
-
cmd.description('Show all configuration values').action(async () => {
|
|
11
|
-
const output = createOutputWriter();
|
|
12
|
-
const config = await loadConfig();
|
|
13
|
-
const mode = getOutputMode();
|
|
14
|
-
if (mode === 'json') {
|
|
15
|
-
output.data({
|
|
16
|
-
global: config.global || null,
|
|
17
|
-
local: config.local || null,
|
|
18
|
-
});
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const hasGlobal = config.global && Object.keys(config.global).length > 0;
|
|
22
|
-
const hasLocal = config.local && Object.keys(config.local).length > 0;
|
|
23
|
-
if (!hasGlobal && !hasLocal) {
|
|
24
|
-
output.progress('No configuration found.');
|
|
25
|
-
output.progress('');
|
|
26
|
-
output.progress('Set a default workspace:');
|
|
27
|
-
output.progress(chalk.dim(' guild workspace select'));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (config.global && hasGlobal) {
|
|
31
|
-
output.progress(chalk.bold('Global config') + chalk.dim(' (~/.guild/config.json):'));
|
|
32
|
-
for (const [key, value] of Object.entries(config.global)) {
|
|
33
|
-
output.progress(` ${key}: ${chalk.cyan(String(value))}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
if (config.local && hasLocal) {
|
|
37
|
-
if (hasGlobal)
|
|
38
|
-
output.progress('');
|
|
39
|
-
output.progress(chalk.bold('Local config') + chalk.dim(' (guild.json):'));
|
|
40
|
-
for (const [key, value] of Object.entries(config.local)) {
|
|
41
|
-
output.progress(` ${key}: ${chalk.cyan(String(value))}`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
return cmd;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=list.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 chalk from 'chalk';
|
|
5
|
-
import * as fs from 'fs/promises';
|
|
6
|
-
import { getGlobalConfigPath, getLocalConfigPath } from '../../lib/guild-config.js';
|
|
7
|
-
import { getOutputMode } from '../../lib/output-mode.js';
|
|
8
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
9
|
-
async function fileExists(filePath) {
|
|
10
|
-
return fs
|
|
11
|
-
.access(filePath)
|
|
12
|
-
.then(() => true)
|
|
13
|
-
.catch(() => false);
|
|
14
|
-
}
|
|
15
|
-
export function createConfigPathCommand() {
|
|
16
|
-
const cmd = new Command('path');
|
|
17
|
-
cmd.description('Show configuration file paths').action(async () => {
|
|
18
|
-
const output = createOutputWriter();
|
|
19
|
-
const globalPath = getGlobalConfigPath();
|
|
20
|
-
const localPath = getLocalConfigPath();
|
|
21
|
-
const mode = getOutputMode();
|
|
22
|
-
const globalExists = await fileExists(globalPath);
|
|
23
|
-
const localExists = await fileExists(localPath);
|
|
24
|
-
if (mode === 'json') {
|
|
25
|
-
output.data({
|
|
26
|
-
global: { path: globalPath, exists: globalExists },
|
|
27
|
-
local: { path: localPath, exists: localExists },
|
|
28
|
-
});
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const globalStatus = globalExists ? chalk.green('exists') : chalk.dim('not found');
|
|
32
|
-
const localStatus = localExists ? chalk.green('exists') : chalk.dim('not found');
|
|
33
|
-
output.progress(`Global: ${globalPath} (${globalStatus})`);
|
|
34
|
-
output.progress(`Local: ${localPath} (${localStatus})`);
|
|
35
|
-
});
|
|
36
|
-
return cmd;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=path.js.map
|
|
@@ -1,132 +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 { saveGlobalConfig } from '../../lib/guild-config.js';
|
|
6
|
-
import { getOutputMode } from '../../lib/output-mode.js';
|
|
7
|
-
import { createOutputWriter } from '../../lib/output.js';
|
|
8
|
-
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
9
|
-
import { debug } from '../../lib/errors.js';
|
|
10
|
-
import { lookupOwner } from '../../lib/owner-helpers.js';
|
|
11
|
-
/**
|
|
12
|
-
* Valid keys for global config (~/.guild/config.json).
|
|
13
|
-
* Note: default_workspace_name is internal (auto-resolved from API).
|
|
14
|
-
*/
|
|
15
|
-
const VALID_GLOBAL_KEYS = [
|
|
16
|
-
'default_workspace',
|
|
17
|
-
'default_owner',
|
|
18
|
-
'debug',
|
|
19
|
-
'json',
|
|
20
|
-
'quiet',
|
|
21
|
-
];
|
|
22
|
-
const BOOLEAN_KEYS = new Set(['debug', 'json', 'quiet']);
|
|
23
|
-
const TRUTHY = new Set(['true', 'yes', 'on', '1']);
|
|
24
|
-
const FALSY = new Set(['false', 'no', 'off', '0']);
|
|
25
|
-
function parseBoolean(value, key, output) {
|
|
26
|
-
const lower = value.toLowerCase();
|
|
27
|
-
if (TRUTHY.has(lower))
|
|
28
|
-
return true;
|
|
29
|
-
if (FALSY.has(lower))
|
|
30
|
-
return false;
|
|
31
|
-
output.error(`Invalid boolean value for "${key}": "${value}"\n\nAccepted values: true/false, yes/no, on/off, 1/0`);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Fetch workspace name by ID from the API.
|
|
36
|
-
* Returns undefined if the lookup fails (not authenticated, not found, etc.).
|
|
37
|
-
*/
|
|
38
|
-
async function resolveWorkspaceName(workspaceId) {
|
|
39
|
-
try {
|
|
40
|
-
const client = new GuildAPIClient();
|
|
41
|
-
const workspace = await client.get(`/workspaces/${workspaceId}`);
|
|
42
|
-
return workspace.name;
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
debug('Could not resolve workspace name for %s: %s', workspaceId, error);
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function printResult(key, value, mode, output) {
|
|
50
|
-
if (mode === 'json') {
|
|
51
|
-
output.data({ key, value });
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
output.success(`Set ${chalk.bold(key)} = ${chalk.cyan(String(value))}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export function createConfigSetCommand() {
|
|
58
|
-
const cmd = new Command('set');
|
|
59
|
-
cmd
|
|
60
|
-
.description('Set a global configuration value')
|
|
61
|
-
.argument('<key>', `Config key (${VALID_GLOBAL_KEYS.join(', ')})`)
|
|
62
|
-
.argument('<value>', 'Value to set')
|
|
63
|
-
.action(async (key, value) => {
|
|
64
|
-
const output = createOutputWriter();
|
|
65
|
-
const mode = getOutputMode();
|
|
66
|
-
if (!VALID_GLOBAL_KEYS.includes(key)) {
|
|
67
|
-
output.error(`Unknown config key: ${key}\n\nValid keys:\n${VALID_GLOBAL_KEYS.map((k) => ` ${k}`).join('\n')}`);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
const typedKey = key;
|
|
71
|
-
if (BOOLEAN_KEYS.has(typedKey)) {
|
|
72
|
-
const boolValue = parseBoolean(value, key, output);
|
|
73
|
-
await saveGlobalConfig({ [typedKey]: boolValue });
|
|
74
|
-
printResult(key, boolValue, mode, output);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (typedKey === 'default_workspace') {
|
|
78
|
-
const name = await resolveWorkspaceName(value);
|
|
79
|
-
await saveGlobalConfig({
|
|
80
|
-
default_workspace: value,
|
|
81
|
-
default_workspace_name: name,
|
|
82
|
-
});
|
|
83
|
-
printResult(key, value, mode, output);
|
|
84
|
-
if (name) {
|
|
85
|
-
if (mode !== 'json') {
|
|
86
|
-
output.progress(` Workspace name: ${name}`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
if (mode !== 'json') {
|
|
91
|
-
output.error('Could not resolve workspace name (not authenticated?)');
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (typedKey === 'default_owner') {
|
|
97
|
-
let ownerId = value;
|
|
98
|
-
let ownerName;
|
|
99
|
-
try {
|
|
100
|
-
const client = new GuildAPIClient();
|
|
101
|
-
const resolved = await lookupOwner(client, value);
|
|
102
|
-
if (resolved) {
|
|
103
|
-
ownerId = resolved.id;
|
|
104
|
-
ownerName = resolved.name;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
debug('Could not resolve owner for %s: %s', value, error);
|
|
109
|
-
}
|
|
110
|
-
await saveGlobalConfig({
|
|
111
|
-
default_owner: ownerId,
|
|
112
|
-
default_owner_name: ownerName,
|
|
113
|
-
});
|
|
114
|
-
printResult(key, ownerId, mode, output);
|
|
115
|
-
if (ownerName) {
|
|
116
|
-
if (mode !== 'json') {
|
|
117
|
-
output.progress(` Owner name: ${ownerName}`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
if (mode !== 'json') {
|
|
122
|
-
output.error('Could not resolve owner name (not authenticated?)');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
await saveGlobalConfig({ [typedKey]: value });
|
|
128
|
-
printResult(key, value, mode, output);
|
|
129
|
-
});
|
|
130
|
-
return cmd;
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=set.js.map
|
|
@@ -1,88 +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
|
-
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
11
|
-
import { Table } from '../../lib/table.js';
|
|
12
|
-
export function createCredentialsEndpointListCommand() {
|
|
13
|
-
const cmd = new Command('list');
|
|
14
|
-
cmd
|
|
15
|
-
.description('List endpoints for a credential')
|
|
16
|
-
.argument('<credential-id>', 'Credential ID')
|
|
17
|
-
.option('--include-previous-versions', 'Include endpoints from previous versions')
|
|
18
|
-
.option('--search <query>', 'Search by operation name')
|
|
19
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
20
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
21
|
-
.action(async (credentialId, options) => {
|
|
22
|
-
const output = createOutputWriter();
|
|
23
|
-
try {
|
|
24
|
-
const token = await getAuthToken();
|
|
25
|
-
if (!token) {
|
|
26
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
const client = new GuildAPIClient();
|
|
30
|
-
const params = new URLSearchParams();
|
|
31
|
-
params.append('limit', options.limit);
|
|
32
|
-
params.append('offset', options.offset);
|
|
33
|
-
if (options.includePreviousVersions) {
|
|
34
|
-
params.append('include_previous_versions', 'true');
|
|
35
|
-
}
|
|
36
|
-
if (options.search) {
|
|
37
|
-
params.append('search', options.search);
|
|
38
|
-
}
|
|
39
|
-
const response = await client.get(`/credentials/${credentialId}/endpoints?${params.toString()}`);
|
|
40
|
-
if (getOutputMode() === 'json') {
|
|
41
|
-
console.log(JSON.stringify(response, null, 2));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
formatEndpointsTable(response.items, response.pagination);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
const formattedError = handleAxiosError(error);
|
|
49
|
-
output.error(formattedError.details);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return cmd;
|
|
54
|
-
}
|
|
55
|
-
function formatEndpointsTable(endpoints, pagination) {
|
|
56
|
-
if (endpoints.length === 0) {
|
|
57
|
-
console.log(chalk.dim('No endpoints found'));
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const table = new Table({
|
|
61
|
-
columns: [
|
|
62
|
-
{ name: 'operation', title: 'OPERATION', alignment: 'left' },
|
|
63
|
-
{ name: 'method', title: 'METHOD', alignment: 'left' },
|
|
64
|
-
{ name: 'path', title: 'PATH', alignment: 'left' },
|
|
65
|
-
{ name: 'tags', title: 'TAGS', alignment: 'left' },
|
|
66
|
-
],
|
|
67
|
-
});
|
|
68
|
-
endpoints.forEach((ep) => {
|
|
69
|
-
const methodColor = ep.method === 'DELETE' ? chalk.red : chalk.green;
|
|
70
|
-
table.addRow({
|
|
71
|
-
operation: ep.operation,
|
|
72
|
-
method: methodColor(ep.method),
|
|
73
|
-
path: ep.path,
|
|
74
|
-
tags: ep.tags?.join(', ') || '',
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
table.printTable();
|
|
78
|
-
const showing = Math.min(pagination.limit, endpoints.length);
|
|
79
|
-
if (pagination.has_more) {
|
|
80
|
-
const nextOffset = pagination.offset + pagination.limit;
|
|
81
|
-
console.log(`\nShowing ${showing} of ${pagination.total_count} endpoints. ` +
|
|
82
|
-
chalk.dim(`Use --offset ${nextOffset} to see more.`));
|
|
83
|
-
}
|
|
84
|
-
else if (pagination.total_count > showing) {
|
|
85
|
-
console.log(chalk.dim(`\nShowing ${showing} of ${pagination.total_count} endpoints`));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=endpoint-list.js.map
|
|
@@ -1,50 +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 { getOutputMode } from '../../lib/output-mode.js';
|
|
8
|
-
import { createOutputWriter, formatCredentialsTable } from '../../lib/output.js';
|
|
9
|
-
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
10
|
-
export function createCredentialsListCommand() {
|
|
11
|
-
const cmd = new Command('list');
|
|
12
|
-
cmd
|
|
13
|
-
.description('List credentials for an account')
|
|
14
|
-
.requiredOption('--owner <account>', 'Account name or ID')
|
|
15
|
-
.option('--search <query>', 'Filter by integration name')
|
|
16
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
17
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
18
|
-
.action(async (options) => {
|
|
19
|
-
const output = createOutputWriter();
|
|
20
|
-
try {
|
|
21
|
-
const token = await getAuthToken();
|
|
22
|
-
if (!token) {
|
|
23
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
const client = new GuildAPIClient();
|
|
27
|
-
const accountId = options.owner;
|
|
28
|
-
const params = new URLSearchParams();
|
|
29
|
-
params.append('limit', options.limit);
|
|
30
|
-
params.append('offset', options.offset);
|
|
31
|
-
if (options.search) {
|
|
32
|
-
params.append('search', options.search);
|
|
33
|
-
}
|
|
34
|
-
const response = await client.get(`/accounts/${accountId}/credentials?${params.toString()}`);
|
|
35
|
-
if (getOutputMode() === 'json') {
|
|
36
|
-
console.log(JSON.stringify(response, null, 2));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
formatCredentialsTable(response.items, response.pagination);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
const formattedError = handleAxiosError(error);
|
|
44
|
-
output.error(formattedError.details);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return cmd;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,66 +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 createCredentialsPolicyCreateCommand() {
|
|
9
|
-
const cmd = new Command('create');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Create a policy for a credential')
|
|
12
|
-
.argument('<credential-id>', 'Credential ID')
|
|
13
|
-
.requiredOption('--decision <decision>', 'ALLOW or DENY')
|
|
14
|
-
.option('--operations <ops>', 'Comma-separated operation names')
|
|
15
|
-
.option('--workspaces <ids-or-names>', 'Comma-separated workspace IDs or names')
|
|
16
|
-
.option('--agents <ids-or-names>', 'Comma-separated agent IDs or names')
|
|
17
|
-
.option('--resources <json>', 'Resource restrictions as JSON')
|
|
18
|
-
.action(async (credentialId, options) => {
|
|
19
|
-
const output = createOutputWriter();
|
|
20
|
-
try {
|
|
21
|
-
const token = await getAuthToken();
|
|
22
|
-
if (!token) {
|
|
23
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
const decision = options.decision.toUpperCase();
|
|
27
|
-
if (decision !== 'ALLOW' && decision !== 'DENY') {
|
|
28
|
-
output.error('--decision must be ALLOW or DENY');
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const body = {
|
|
32
|
-
decision,
|
|
33
|
-
};
|
|
34
|
-
if (options.operations) {
|
|
35
|
-
body.operations = options.operations.split(',').map((s) => s.trim());
|
|
36
|
-
}
|
|
37
|
-
if (options.workspaces) {
|
|
38
|
-
body.workspace_ids_or_names = options.workspaces
|
|
39
|
-
.split(',')
|
|
40
|
-
.map((s) => s.trim());
|
|
41
|
-
}
|
|
42
|
-
if (options.agents) {
|
|
43
|
-
body.agent_ids_or_names = options.agents.split(',').map((s) => s.trim());
|
|
44
|
-
}
|
|
45
|
-
if (options.resources) {
|
|
46
|
-
try {
|
|
47
|
-
body.resources = JSON.parse(options.resources);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
output.error('--resources must be valid JSON');
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const client = new GuildAPIClient();
|
|
55
|
-
const response = await client.post(`/credentials/${credentialId}/policies`, body);
|
|
56
|
-
output.data(response);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
const formattedError = handleAxiosError(error);
|
|
60
|
-
output.error(formattedError.details);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return cmd;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=policy-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 createCredentialsPolicyDeleteCommand() {
|
|
9
|
-
const cmd = new Command('delete');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Delete a credential policy')
|
|
12
|
-
.argument('<policy-id>', 'Policy ID')
|
|
13
|
-
.action(async (policyId) => {
|
|
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
|
-
await client.delete(`/credentials/policies/${policyId}`);
|
|
23
|
-
output.success(`Policy ${policyId} deleted`);
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
const formattedError = handleAxiosError(error);
|
|
27
|
-
output.error(formattedError.details);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return cmd;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=policy-delete.js.map
|
|
@@ -1,45 +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 { getOutputMode } from '../../lib/output-mode.js';
|
|
8
|
-
import { createOutputWriter, formatPoliciesTable } from '../../lib/output.js';
|
|
9
|
-
import { DEFAULT_PAGE_LIMIT } from '../../lib/api-types.js';
|
|
10
|
-
export function createCredentialsPolicyListCommand() {
|
|
11
|
-
const cmd = new Command('list');
|
|
12
|
-
cmd
|
|
13
|
-
.description('List policies for a credential')
|
|
14
|
-
.argument('<credential-id>', 'Credential ID')
|
|
15
|
-
.option('--limit <number>', `Number of results to return (default: ${DEFAULT_PAGE_LIMIT})`, String(DEFAULT_PAGE_LIMIT))
|
|
16
|
-
.option('--offset <number>', 'Offset for pagination (default: 0)', '0')
|
|
17
|
-
.action(async (credentialId, options) => {
|
|
18
|
-
const output = createOutputWriter();
|
|
19
|
-
try {
|
|
20
|
-
const token = await getAuthToken();
|
|
21
|
-
if (!token) {
|
|
22
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
23
|
-
process.exit(1);
|
|
24
|
-
}
|
|
25
|
-
const client = new GuildAPIClient();
|
|
26
|
-
const params = new URLSearchParams();
|
|
27
|
-
params.append('limit', options.limit);
|
|
28
|
-
params.append('offset', options.offset);
|
|
29
|
-
const response = await client.get(`/credentials/${credentialId}/policies?${params.toString()}`);
|
|
30
|
-
if (getOutputMode() === 'json') {
|
|
31
|
-
console.log(JSON.stringify(response, null, 2));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
formatPoliciesTable(response.items, response.pagination);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
const formattedError = handleAxiosError(error);
|
|
39
|
-
output.error(formattedError.details);
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return cmd;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=policy-list.js.map
|
|
@@ -1,66 +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 createCredentialsPolicyUpdateCommand() {
|
|
9
|
-
const cmd = new Command('update');
|
|
10
|
-
cmd
|
|
11
|
-
.description('Update a credential policy')
|
|
12
|
-
.argument('<policy-id>', 'Policy ID')
|
|
13
|
-
.requiredOption('--decision <decision>', 'ALLOW or DENY')
|
|
14
|
-
.option('--operations <ops>', 'Comma-separated operation names')
|
|
15
|
-
.option('--workspaces <ids-or-names>', 'Comma-separated workspace IDs or names')
|
|
16
|
-
.option('--agents <ids-or-names>', 'Comma-separated agent IDs or names')
|
|
17
|
-
.option('--resources <json>', 'Resource restrictions as JSON')
|
|
18
|
-
.action(async (policyId, options) => {
|
|
19
|
-
const output = createOutputWriter();
|
|
20
|
-
try {
|
|
21
|
-
const token = await getAuthToken();
|
|
22
|
-
if (!token) {
|
|
23
|
-
output.error('Not authenticated. Run: guild auth login');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
const decision = options.decision.toUpperCase();
|
|
27
|
-
if (decision !== 'ALLOW' && decision !== 'DENY') {
|
|
28
|
-
output.error('--decision must be ALLOW or DENY');
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
const body = {
|
|
32
|
-
decision,
|
|
33
|
-
};
|
|
34
|
-
if (options.operations) {
|
|
35
|
-
body.operations = options.operations.split(',').map((s) => s.trim());
|
|
36
|
-
}
|
|
37
|
-
if (options.workspaces) {
|
|
38
|
-
body.workspace_ids_or_names = options.workspaces
|
|
39
|
-
.split(',')
|
|
40
|
-
.map((s) => s.trim());
|
|
41
|
-
}
|
|
42
|
-
if (options.agents) {
|
|
43
|
-
body.agent_ids_or_names = options.agents.split(',').map((s) => s.trim());
|
|
44
|
-
}
|
|
45
|
-
if (options.resources) {
|
|
46
|
-
try {
|
|
47
|
-
body.resources = JSON.parse(options.resources);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
output.error('--resources must be valid JSON');
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const client = new GuildAPIClient();
|
|
55
|
-
const response = await client.put(`/credentials/policies/${policyId}`, body);
|
|
56
|
-
output.data(response);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
const formattedError = handleAxiosError(error);
|
|
60
|
-
output.error(formattedError.details);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return cmd;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=policy-update.js.map
|