@agentuity/cli 0.0.46 → 0.0.48
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/cmd/auth/ssh/list.d.ts.map +1 -1
- package/dist/cmd/cloud/deploy.d.ts.map +1 -1
- package/dist/cmd/cloud/deployment/index.d.ts +2 -0
- package/dist/cmd/cloud/deployment/index.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/list.d.ts +2 -0
- package/dist/cmd/cloud/deployment/list.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/remove.d.ts +2 -0
- package/dist/cmd/cloud/deployment/remove.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/rollback.d.ts +2 -0
- package/dist/cmd/cloud/deployment/rollback.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/show.d.ts +2 -0
- package/dist/cmd/cloud/deployment/show.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/undeploy.d.ts +2 -0
- package/dist/cmd/cloud/deployment/undeploy.d.ts.map +1 -0
- package/dist/cmd/cloud/deployment/utils.d.ts +5 -0
- package/dist/cmd/cloud/deployment/utils.d.ts.map +1 -0
- package/dist/cmd/cloud/index.d.ts.map +1 -1
- package/dist/cmd/cloud/scp/upload.d.ts.map +1 -1
- package/dist/cmd/profile/create.d.ts.map +1 -1
- package/dist/cmd/profile/delete.d.ts.map +1 -1
- package/dist/cmd/profile/show.d.ts.map +1 -1
- package/dist/cmd/profile/use.d.ts.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/tui.d.ts +9 -0
- package/dist/tui.d.ts.map +1 -1
- package/dist/utils/zip.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/cmd/auth/ssh/list.ts +16 -21
- package/src/cmd/cloud/deploy.ts +6 -0
- package/src/cmd/cloud/deployment/index.ts +19 -0
- package/src/cmd/cloud/deployment/list.ts +58 -0
- package/src/cmd/cloud/deployment/remove.ts +41 -0
- package/src/cmd/cloud/deployment/rollback.ts +56 -0
- package/src/cmd/cloud/deployment/show.ts +72 -0
- package/src/cmd/cloud/deployment/undeploy.ts +37 -0
- package/src/cmd/cloud/deployment/utils.ts +11 -0
- package/src/cmd/cloud/index.ts +2 -1
- package/src/cmd/cloud/scp/download.ts +1 -1
- package/src/cmd/cloud/scp/upload.ts +2 -4
- package/src/cmd/profile/create.ts +33 -4
- package/src/cmd/profile/delete.ts +8 -3
- package/src/cmd/profile/show.ts +14 -15
- package/src/cmd/profile/use.ts +9 -4
- package/src/cmd/project/template-flow.ts +3 -3
- package/src/config.ts +4 -4
- package/src/tui.ts +52 -0
- package/src/utils/zip.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cmd/auth/ssh/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cmd/auth/ssh/list.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,yCA8DtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/deploy.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/deploy.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,gBAAgB,sCAuT3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,sCAW5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/list.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,yCAkDzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/remove.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,yCAkC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/rollback.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,yCAiD7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/show.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,yCAiEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"undeploy.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/undeploy.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,yCA8B7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/deployment/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAQvG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmd/cloud/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,mCAIlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/scp/upload.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/cmd/cloud/scp/upload.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,yCA0CxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/create.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa,sCAoExB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/delete.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/delete.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,sCAkDxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/show.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/show.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,sCAuDtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/use.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../src/cmd/profile/use.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,sCA6BrB,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function generateYAMLTemplate(name: string): string;
|
|
|
22
22
|
type ProjectConfig = z.infer<typeof ProjectSchema>;
|
|
23
23
|
export declare function loadProjectConfig(dir: string, config?: Config | null): Promise<ProjectConfig>;
|
|
24
24
|
type InitialProjectConfig = ProjectConfig & {
|
|
25
|
-
|
|
25
|
+
sdkKey: string;
|
|
26
26
|
};
|
|
27
27
|
export declare function createProjectConfig(dir: string, config: InitialProjectConfig): Promise<void>;
|
|
28
28
|
export declare function loadBuildMetadata(dir: string): Promise<BuildMetadata>;
|
package/dist/tui.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type OrganizationList } from '@agentuity/server';
|
|
2
2
|
import type { ColorScheme } from './terminal';
|
|
3
|
+
import type { Profile } from './types';
|
|
3
4
|
import { type APIClient as APIClientType } from './api';
|
|
4
5
|
export declare function shouldUseColors(): boolean;
|
|
5
6
|
export declare function setColorScheme(scheme: ColorScheme): void;
|
|
@@ -218,5 +219,13 @@ export declare function selectOrganization(orgs: OrganizationList, initial?: str
|
|
|
218
219
|
* @returns
|
|
219
220
|
*/
|
|
220
221
|
export declare function showProjectList(apiClient: APIClientType, showDeploymentId?: boolean): Promise<string>;
|
|
222
|
+
/**
|
|
223
|
+
* Show a profile list picker
|
|
224
|
+
*
|
|
225
|
+
* @param profiles List of profiles to choose from
|
|
226
|
+
* @param message Prompt message
|
|
227
|
+
* @returns The name of the selected profile
|
|
228
|
+
*/
|
|
229
|
+
export declare function showProfileList(profiles: Profile[], message?: string): Promise<string>;
|
|
221
230
|
export {};
|
|
222
231
|
//# sourceMappingURL=tui.d.ts.map
|
package/dist/tui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","sourceRoot":"","sources":["../src/tui.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAAe,MAAM,mBAAmB,CAAC;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OAAO,CAAC,MAAM,CAAC,CAuCjB"}
|
package/dist/utils/zip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IAChB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACzD;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"zip.d.ts","sourceRoot":"","sources":["../../src/utils/zip.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IAChB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACzD;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,iBA8B1E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"prepublishOnly": "bun run clean && bun run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@agentuity/core": "0.0.
|
|
34
|
-
"@agentuity/server": "0.0.
|
|
33
|
+
"@agentuity/core": "0.0.48",
|
|
34
|
+
"@agentuity/server": "0.0.48",
|
|
35
35
|
"@terascope/fetch-github-release": "^2.2.1",
|
|
36
36
|
"acorn-loose": "^8.5.2",
|
|
37
37
|
"adm-zip": "^0.5.16",
|
|
38
38
|
"astring": "^1.9.0",
|
|
39
39
|
"commander": "^14.0.2",
|
|
40
|
+
"console-table-printer": "^2.15.0",
|
|
40
41
|
"enquirer": "^2.4.1",
|
|
41
42
|
"git-url-parse": "^16.1.0",
|
|
42
43
|
"json5": "^2.2.3",
|
package/src/cmd/auth/ssh/list.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { createSubcommand } from '../../../types';
|
|
|
2
2
|
import { listSSHKeys } from './api';
|
|
3
3
|
import * as tui from '../../../tui';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
+
import { Table } from 'console-table-printer';
|
|
5
6
|
|
|
6
7
|
export const listCommand = createSubcommand({
|
|
7
8
|
name: 'list',
|
|
@@ -39,29 +40,23 @@ export const listCommand = createSubcommand({
|
|
|
39
40
|
console.log(tui.bold('SSH Keys:'));
|
|
40
41
|
tui.newline();
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
const table = new Table({
|
|
44
|
+
columns: [
|
|
45
|
+
{ name: 'TYPE', alignment: 'left' },
|
|
46
|
+
{ name: 'FINGERPRINT', alignment: 'left' },
|
|
47
|
+
{ name: 'COMMENT', alignment: 'left' },
|
|
48
|
+
],
|
|
49
|
+
});
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
// Print header
|
|
57
|
-
console.log(
|
|
58
|
-
`${tui.bold('TYPE'.padEnd(widths[0]))} ${tui.bold('FINGERPRINT'.padEnd(widths[1]))} ${tui.bold('COMMENT')}`
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
// Print rows
|
|
62
|
-
for (const row of rows) {
|
|
63
|
-
console.log(`${row[0].padEnd(widths[0])} ${row[1].padEnd(widths[1])} ${row[2]}`);
|
|
51
|
+
for (const key of keys) {
|
|
52
|
+
table.addRow({
|
|
53
|
+
TYPE: key.keyType,
|
|
54
|
+
FINGERPRINT: key.fingerprint,
|
|
55
|
+
COMMENT: key.comment || tui.muted('(no comment)'),
|
|
56
|
+
});
|
|
64
57
|
}
|
|
58
|
+
table.printTable();
|
|
59
|
+
|
|
65
60
|
} catch (error) {
|
|
66
61
|
logger.trace(error);
|
|
67
62
|
if (error instanceof Error) {
|
package/src/cmd/cloud/deploy.ts
CHANGED
|
@@ -183,6 +183,12 @@ export const deploySubcommand = createSubcommand({
|
|
|
183
183
|
if (relative.endsWith('.map')) {
|
|
184
184
|
return false;
|
|
185
185
|
}
|
|
186
|
+
// ignore common stuff we never want to include in the zip
|
|
187
|
+
if (relative.startsWith('.env')) return false;
|
|
188
|
+
if (relative.startsWith('.git/')) return false;
|
|
189
|
+
if (relative.startsWith('.ssh/')) return false;
|
|
190
|
+
if (relative.startsWith('node_modules/')) return false;
|
|
191
|
+
if (relative === '.DS_Store') return false;
|
|
186
192
|
return true;
|
|
187
193
|
},
|
|
188
194
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createCommand } from '../../../types';
|
|
2
|
+
import { listSubcommand } from './list';
|
|
3
|
+
import { showSubcommand } from './show';
|
|
4
|
+
import { removeSubcommand } from './remove';
|
|
5
|
+
import { rollbackSubcommand } from './rollback';
|
|
6
|
+
import { undeploySubcommand } from './undeploy';
|
|
7
|
+
|
|
8
|
+
export const deploymentCommand = createCommand({
|
|
9
|
+
name: 'deployment',
|
|
10
|
+
description: 'Manage deployments',
|
|
11
|
+
aliases: ['deployments', 'dep'],
|
|
12
|
+
subcommands: [
|
|
13
|
+
listSubcommand,
|
|
14
|
+
showSubcommand,
|
|
15
|
+
removeSubcommand,
|
|
16
|
+
rollbackSubcommand,
|
|
17
|
+
undeploySubcommand,
|
|
18
|
+
],
|
|
19
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSubcommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { projectDeploymentList } from '@agentuity/server';
|
|
5
|
+
import { resolveProjectId } from './utils';
|
|
6
|
+
import { Table } from 'console-table-printer';
|
|
7
|
+
|
|
8
|
+
export const listSubcommand = createSubcommand({
|
|
9
|
+
name: 'list',
|
|
10
|
+
description: 'List deployments',
|
|
11
|
+
aliases: ['ls'],
|
|
12
|
+
requires: { auth: true, apiClient: true },
|
|
13
|
+
optional: { project: true },
|
|
14
|
+
schema: {
|
|
15
|
+
options: z.object({
|
|
16
|
+
'project-id': z.string().optional().describe('Project ID'),
|
|
17
|
+
count: z.coerce.number().default(10).describe('Number of deployments to list'),
|
|
18
|
+
}),
|
|
19
|
+
},
|
|
20
|
+
async handler(ctx) {
|
|
21
|
+
const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
|
|
22
|
+
const { apiClient, opts } = ctx;
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const deployments = await projectDeploymentList(apiClient, projectId, opts.count);
|
|
26
|
+
|
|
27
|
+
if (deployments.length === 0) {
|
|
28
|
+
tui.info('No deployments found.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const table = new Table({
|
|
33
|
+
columns: [
|
|
34
|
+
{ name: 'ID', alignment: 'left' },
|
|
35
|
+
{ name: 'State', alignment: 'left' },
|
|
36
|
+
{ name: 'Active', alignment: 'center' },
|
|
37
|
+
{ name: 'Created', alignment: 'left' },
|
|
38
|
+
{ name: 'Message', alignment: 'left' },
|
|
39
|
+
{ name: 'Tags', alignment: 'left' },
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
for (const d of deployments) {
|
|
44
|
+
table.addRow({
|
|
45
|
+
ID: d.id,
|
|
46
|
+
State: d.state || 'unknown',
|
|
47
|
+
Active: d.active ? 'Yes' : '',
|
|
48
|
+
Created: new Date(d.createdAt).toLocaleString(),
|
|
49
|
+
Message: d.message || '',
|
|
50
|
+
Tags: d.tags.join(', '),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
table.printTable();
|
|
54
|
+
} catch (ex) {
|
|
55
|
+
tui.fatal(`Failed to list deployments: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSubcommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { projectDeploymentDelete } from '@agentuity/server';
|
|
5
|
+
import { resolveProjectId } from './utils';
|
|
6
|
+
|
|
7
|
+
export const removeSubcommand = createSubcommand({
|
|
8
|
+
name: 'remove',
|
|
9
|
+
description: 'Remove a specific deployment',
|
|
10
|
+
aliases: ['rm', 'delete'],
|
|
11
|
+
requires: { auth: true, apiClient: true },
|
|
12
|
+
optional: { project: true },
|
|
13
|
+
schema: {
|
|
14
|
+
args: z.object({
|
|
15
|
+
deployment_id: z.string().describe('Deployment ID'),
|
|
16
|
+
}),
|
|
17
|
+
options: z.object({
|
|
18
|
+
'project-id': z.string().optional().describe('Project ID'),
|
|
19
|
+
force: z.boolean().default(false).describe('Force removal without confirmation'),
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
async handler(ctx) {
|
|
23
|
+
const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
|
|
24
|
+
const { apiClient, args, opts } = ctx;
|
|
25
|
+
|
|
26
|
+
if (!opts.force) {
|
|
27
|
+
const confirmed = await tui.confirm(`Are you sure you want to remove deployment ${args.deployment_id}?`);
|
|
28
|
+
if (!confirmed) {
|
|
29
|
+
tui.info('Operation cancelled');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
await projectDeploymentDelete(apiClient, projectId, args.deployment_id);
|
|
36
|
+
tui.success(`Deployment ${args.deployment_id} removed successfully.`);
|
|
37
|
+
} catch (ex) {
|
|
38
|
+
tui.fatal(`Failed to remove deployment: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSubcommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { projectDeploymentRollback, projectDeploymentList } from '@agentuity/server';
|
|
5
|
+
import { resolveProjectId } from './utils';
|
|
6
|
+
|
|
7
|
+
export const rollbackSubcommand = createSubcommand({
|
|
8
|
+
name: 'rollback',
|
|
9
|
+
description: 'Rollback the latest to the previous deployment',
|
|
10
|
+
requires: { auth: true, apiClient: true },
|
|
11
|
+
optional: { project: true },
|
|
12
|
+
schema: {
|
|
13
|
+
options: z.object({
|
|
14
|
+
'project-id': z.string().optional().describe('Project ID'),
|
|
15
|
+
}),
|
|
16
|
+
},
|
|
17
|
+
async handler(ctx) {
|
|
18
|
+
const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
|
|
19
|
+
const { apiClient } = ctx;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
// Fetch deployments to find the previous one
|
|
23
|
+
const deployments = await projectDeploymentList(apiClient, projectId, 5);
|
|
24
|
+
|
|
25
|
+
// Find currently active
|
|
26
|
+
const activeIndex = deployments.findIndex(d => d.active);
|
|
27
|
+
|
|
28
|
+
let targetDeploymentId: string | undefined;
|
|
29
|
+
|
|
30
|
+
if (activeIndex === -1) {
|
|
31
|
+
// No active deployment.
|
|
32
|
+
const candidate = deployments.find(d => d.state === 'completed');
|
|
33
|
+
targetDeploymentId = candidate?.id;
|
|
34
|
+
} else {
|
|
35
|
+
// Has active deployment. Find the next completed one.
|
|
36
|
+
const candidate = deployments.slice(activeIndex + 1).find(d => d.state === 'completed');
|
|
37
|
+
targetDeploymentId = candidate?.id;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!targetDeploymentId) {
|
|
41
|
+
tui.fatal('No previous completed deployment found to rollback to.');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const confirmed = await tui.confirm(`Rollback to deployment ${targetDeploymentId}?`);
|
|
45
|
+
if (!confirmed) {
|
|
46
|
+
tui.info('Operation cancelled');
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
await projectDeploymentRollback(apiClient, projectId, targetDeploymentId!);
|
|
51
|
+
tui.success(`Rolled back to deployment ${targetDeploymentId}.`);
|
|
52
|
+
} catch (ex) {
|
|
53
|
+
tui.fatal(`Failed to rollback: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSubcommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { projectDeploymentGet } from '@agentuity/server';
|
|
5
|
+
import { resolveProjectId } from './utils';
|
|
6
|
+
|
|
7
|
+
export const showSubcommand = createSubcommand({
|
|
8
|
+
name: 'show',
|
|
9
|
+
description: 'Show details about a specific deployment',
|
|
10
|
+
aliases: ['get'],
|
|
11
|
+
requires: { auth: true, apiClient: true },
|
|
12
|
+
optional: { project: true },
|
|
13
|
+
schema: {
|
|
14
|
+
args: z.object({
|
|
15
|
+
deployment_id: z.string().describe('Deployment ID'),
|
|
16
|
+
}),
|
|
17
|
+
options: z.object({
|
|
18
|
+
'project-id': z.string().optional().describe('Project ID'),
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
async handler(ctx) {
|
|
22
|
+
const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
|
|
23
|
+
const { apiClient, args } = ctx;
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const deployment = await projectDeploymentGet(apiClient, projectId, args.deployment_id);
|
|
27
|
+
|
|
28
|
+
tui.banner(`Deployment ${deployment.id}`, `State: ${deployment.state || 'unknown'}`);
|
|
29
|
+
|
|
30
|
+
console.log(tui.bold('ID: ') + deployment.id);
|
|
31
|
+
console.log(tui.bold('Project: ') + projectId);
|
|
32
|
+
console.log(tui.bold('State: ') + (deployment.state || 'unknown'));
|
|
33
|
+
console.log(tui.bold('Active: ') + (deployment.active ? 'Yes' : 'No'));
|
|
34
|
+
console.log(tui.bold('Created: ') + new Date(deployment.createdAt).toLocaleString());
|
|
35
|
+
if (deployment.updatedAt) {
|
|
36
|
+
console.log(tui.bold('Updated: ') + new Date(deployment.updatedAt).toLocaleString());
|
|
37
|
+
}
|
|
38
|
+
if (deployment.message) {
|
|
39
|
+
console.log(tui.bold('Message: ') + deployment.message);
|
|
40
|
+
}
|
|
41
|
+
if (deployment.tags.length > 0) {
|
|
42
|
+
console.log(tui.bold('Tags: ') + deployment.tags.join(', '));
|
|
43
|
+
}
|
|
44
|
+
if (deployment.customDomains && deployment.customDomains.length > 0) {
|
|
45
|
+
console.log(tui.bold('Domains: ') + deployment.customDomains.join(', '));
|
|
46
|
+
}
|
|
47
|
+
if (deployment.cloudRegion) {
|
|
48
|
+
console.log(tui.bold('Region: ') + deployment.cloudRegion);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Metadata
|
|
52
|
+
if (deployment.metadata?.origin?.commit) {
|
|
53
|
+
tui.newline();
|
|
54
|
+
tui.info('Origin Information');
|
|
55
|
+
const origin = deployment.metadata.origin;
|
|
56
|
+
if (origin.trigger) console.log(` Trigger: ${origin.trigger}`);
|
|
57
|
+
if (origin.provider) console.log(` Provider: ${origin.provider}`);
|
|
58
|
+
if (origin.event) console.log(` Event: ${origin.event}`);
|
|
59
|
+
if (origin.branch) console.log(` Branch: ${origin.branch}`);
|
|
60
|
+
|
|
61
|
+
if (origin.commit) {
|
|
62
|
+
console.log(` Commit: ${origin.commit.hash}`);
|
|
63
|
+
if (origin.commit.message) console.log(` Message: ${origin.commit.message}`);
|
|
64
|
+
if (origin.commit.author?.name)
|
|
65
|
+
console.log(` Author: ${origin.commit.author.name}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
} catch (ex) {
|
|
69
|
+
tui.fatal(`Failed to show deployment: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createSubcommand } from '../../../types';
|
|
3
|
+
import * as tui from '../../../tui';
|
|
4
|
+
import { projectDeploymentUndeploy } from '@agentuity/server';
|
|
5
|
+
import { resolveProjectId } from './utils';
|
|
6
|
+
|
|
7
|
+
export const undeploySubcommand = createSubcommand({
|
|
8
|
+
name: 'undeploy',
|
|
9
|
+
description: 'Undeploy the latest deployment',
|
|
10
|
+
requires: { auth: true, apiClient: true },
|
|
11
|
+
optional: { project: true },
|
|
12
|
+
schema: {
|
|
13
|
+
options: z.object({
|
|
14
|
+
'project-id': z.string().optional().describe('Project ID'),
|
|
15
|
+
force: z.boolean().default(false).describe('Force undeploy without confirmation'),
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
async handler(ctx) {
|
|
19
|
+
const projectId = resolveProjectId(ctx, { projectId: ctx.opts['project-id'] });
|
|
20
|
+
const { apiClient, opts } = ctx;
|
|
21
|
+
|
|
22
|
+
if (!opts.force) {
|
|
23
|
+
const confirmed = await tui.confirm('Are you sure you want to undeploy? This will stop the active deployment.');
|
|
24
|
+
if (!confirmed) {
|
|
25
|
+
tui.info('Operation cancelled');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
await projectDeploymentUndeploy(apiClient, projectId);
|
|
32
|
+
tui.success('Undeployed successfully.');
|
|
33
|
+
} catch (ex) {
|
|
34
|
+
tui.fatal(`Failed to undeploy: ${ex instanceof Error ? ex.message : String(ex)}`);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandContext } from '../../../types';
|
|
2
|
+
|
|
3
|
+
export function resolveProjectId(ctx: CommandContext<any, any>, options: { projectId?: string }): string {
|
|
4
|
+
if (options.projectId) {
|
|
5
|
+
return options.projectId;
|
|
6
|
+
}
|
|
7
|
+
if (ctx.project?.projectId) {
|
|
8
|
+
return ctx.project.projectId;
|
|
9
|
+
}
|
|
10
|
+
throw new Error('Project ID is required. Use --project-id or run from a project directory.');
|
|
11
|
+
}
|
package/src/cmd/cloud/index.ts
CHANGED
|
@@ -3,9 +3,10 @@ import { deploySubcommand } from './deploy';
|
|
|
3
3
|
import { resourceSubcommand } from './resource';
|
|
4
4
|
import { sshSubcommand } from './ssh';
|
|
5
5
|
import { scpSubcommand } from './scp';
|
|
6
|
+
import { deploymentCommand } from './deployment';
|
|
6
7
|
|
|
7
8
|
export const command = createCommand({
|
|
8
9
|
name: 'cloud',
|
|
9
10
|
description: 'Cloud related commands',
|
|
10
|
-
subcommands: [deploySubcommand, resourceSubcommand, sshSubcommand, scpSubcommand],
|
|
11
|
+
subcommands: [deploySubcommand, resourceSubcommand, sshSubcommand, scpSubcommand, deploymentCommand],
|
|
11
12
|
});
|
|
@@ -53,10 +53,8 @@ export const uploadCommand = createSubcommand({
|
|
|
53
53
|
process.exit(spawn.exitCode ?? 1);
|
|
54
54
|
}
|
|
55
55
|
} catch (error) {
|
|
56
|
-
tui.error(
|
|
57
|
-
`SCP upload error: ${error instanceof Error ? error.message : 'Unknown error'}`
|
|
58
|
-
);
|
|
56
|
+
tui.error(`SCP upload error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
59
57
|
process.exit(1);
|
|
60
58
|
}
|
|
61
|
-
|
|
59
|
+
},
|
|
62
60
|
});
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { writeFile, readdir } from 'node:fs/promises';
|
|
3
|
+
import { Config, createSubcommand } from '../../types';
|
|
2
4
|
import { z } from 'zod';
|
|
3
5
|
import {
|
|
4
6
|
fetchProfiles,
|
|
5
7
|
getDefaultConfigDir,
|
|
6
8
|
ensureConfigDir,
|
|
7
9
|
generateYAMLTemplate,
|
|
10
|
+
loadConfig,
|
|
11
|
+
saveConfig,
|
|
12
|
+
saveProfile,
|
|
8
13
|
} from '../../config';
|
|
9
|
-
import { join } from 'node:path';
|
|
10
|
-
import { writeFile } from 'node:fs/promises';
|
|
11
14
|
import * as tui from '../../tui';
|
|
12
15
|
|
|
13
16
|
const PROFILE_NAME_REGEX = /^[\w_-]{3,}$/;
|
|
@@ -26,10 +29,13 @@ export const createCommand = createSubcommand({
|
|
|
26
29
|
.describe('The name of the profile to create'),
|
|
27
30
|
})
|
|
28
31
|
.describe('Profile creation arguments'),
|
|
32
|
+
options: z.object({
|
|
33
|
+
switch: z.boolean().optional().describe('switch to this profile (if more than one)'),
|
|
34
|
+
}),
|
|
29
35
|
},
|
|
30
36
|
|
|
31
37
|
async handler(ctx) {
|
|
32
|
-
const { logger, args } = ctx;
|
|
38
|
+
const { logger, args, opts } = ctx;
|
|
33
39
|
const { name } = args;
|
|
34
40
|
|
|
35
41
|
const profiles = await fetchProfiles();
|
|
@@ -47,6 +53,29 @@ export const createCommand = createSubcommand({
|
|
|
47
53
|
|
|
48
54
|
try {
|
|
49
55
|
await writeFile(filename, template, { flag: 'wx', mode: 0o600 });
|
|
56
|
+
if (name === 'local') {
|
|
57
|
+
// if we're creating a local profile, go ahead and fill it out for the dev to make it easier to get started
|
|
58
|
+
const localConfig = (await loadConfig(filename)) as Config;
|
|
59
|
+
localConfig.overrides = {
|
|
60
|
+
api_url: 'https://api.agentuity.io',
|
|
61
|
+
app_url: 'https://app.agentuity.io',
|
|
62
|
+
transport_url: 'https://catalyst.agentuity.io',
|
|
63
|
+
stream_url: 'https://streams.agentuity.io',
|
|
64
|
+
kv_url: 'https://catalyst.agentuity.io',
|
|
65
|
+
object_url: 'https://catalyst.agentuity.io',
|
|
66
|
+
vector_url: 'https://catalyst.agentuity.io',
|
|
67
|
+
catalyst_url: 'https://catalyst.agentuity.io',
|
|
68
|
+
ion_url: 'https://ion.agentuity.io',
|
|
69
|
+
gravity_url: 'grpc://gravity.agentuity.io:8443',
|
|
70
|
+
};
|
|
71
|
+
await saveConfig(localConfig, filename);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const files = await readdir(configDir);
|
|
75
|
+
if (opts?.switch || files.length === 1) {
|
|
76
|
+
await saveProfile(filename);
|
|
77
|
+
}
|
|
78
|
+
|
|
50
79
|
tui.success(`Created profile "${name}" at ${filename}`);
|
|
51
80
|
} catch (error) {
|
|
52
81
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -7,10 +7,10 @@ import * as tui from '../../tui';
|
|
|
7
7
|
export const deleteCommand = createSubcommand({
|
|
8
8
|
name: 'delete',
|
|
9
9
|
description: 'Delete a configuration profile',
|
|
10
|
-
aliases: ['remove', 'rm'],
|
|
10
|
+
aliases: ['remove', 'rm', 'del'],
|
|
11
11
|
schema: {
|
|
12
12
|
args: z.object({
|
|
13
|
-
name: z.string().describe('The name of the profile to delete'),
|
|
13
|
+
name: z.string().optional().describe('The name of the profile to delete'),
|
|
14
14
|
}),
|
|
15
15
|
options: z.object({
|
|
16
16
|
confirm: z.boolean().optional().describe('Skip confirmation prompt'),
|
|
@@ -19,9 +19,14 @@ export const deleteCommand = createSubcommand({
|
|
|
19
19
|
|
|
20
20
|
async handler(ctx) {
|
|
21
21
|
const { logger, args, opts } = ctx;
|
|
22
|
-
|
|
22
|
+
let { name } = args;
|
|
23
23
|
|
|
24
24
|
const profiles = await fetchProfiles();
|
|
25
|
+
|
|
26
|
+
if (!name) {
|
|
27
|
+
name = await tui.showProfileList(profiles, 'Select profile to delete:');
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
const profile = profiles.find((p) => p.name === name);
|
|
26
31
|
|
|
27
32
|
if (!profile) {
|
package/src/cmd/profile/show.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createSubcommand } from '../../types';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
3
|
+
import { fetchProfiles, loadConfig } from '../../config';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import * as tui from '../../tui';
|
|
6
6
|
|
|
7
7
|
export const showCommand = createSubcommand({
|
|
8
8
|
name: 'show',
|
|
9
|
-
description: 'Show the configuration of a profile
|
|
9
|
+
description: 'Show the configuration of a profile',
|
|
10
10
|
aliases: ['current'],
|
|
11
11
|
schema: {
|
|
12
12
|
options: z.object({
|
|
@@ -23,25 +23,24 @@ export const showCommand = createSubcommand({
|
|
|
23
23
|
const { logger, args, opts } = ctx;
|
|
24
24
|
|
|
25
25
|
try {
|
|
26
|
-
let profilePath: string;
|
|
27
26
|
let current = false;
|
|
27
|
+
let name = args.name;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
// Find profile by name
|
|
31
|
-
const profiles = await fetchProfiles();
|
|
32
|
-
const profile = profiles.find((p) => p.name === args.name);
|
|
29
|
+
const profiles = await fetchProfiles();
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
if (!name) {
|
|
32
|
+
name = await tui.showProfileList(profiles, 'Select profile to show:');
|
|
33
|
+
}
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
profilePath = await getProfile();
|
|
35
|
+
const profile = profiles.find((p) => p.name === name);
|
|
36
|
+
|
|
37
|
+
if (!profile) {
|
|
38
|
+
return logger.fatal(`Profile "${name}" not found`);
|
|
43
39
|
}
|
|
44
40
|
|
|
41
|
+
const profilePath = profile.filename;
|
|
42
|
+
current = profile.selected;
|
|
43
|
+
|
|
45
44
|
tui.info(`Profile: ${profilePath}`);
|
|
46
45
|
|
|
47
46
|
if (opts?.json) {
|
package/src/cmd/profile/use.ts
CHANGED
|
@@ -9,19 +9,24 @@ export const useCommand = createSubcommand({
|
|
|
9
9
|
aliases: ['switch'],
|
|
10
10
|
schema: {
|
|
11
11
|
args: z.object({
|
|
12
|
-
name: z.string().describe('The name of the profile to use'),
|
|
12
|
+
name: z.string().optional().describe('The name of the profile to use'),
|
|
13
13
|
}),
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
async handler(ctx) {
|
|
17
|
-
const {
|
|
18
|
-
|
|
17
|
+
const { args } = ctx;
|
|
18
|
+
let { name } = args;
|
|
19
19
|
|
|
20
20
|
const profiles = await fetchProfiles();
|
|
21
|
+
|
|
22
|
+
if (!name) {
|
|
23
|
+
name = await tui.showProfileList(profiles, 'Select profile to use:');
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
const profile = profiles.find((p) => p.name === name);
|
|
22
27
|
|
|
23
28
|
if (!profile) {
|
|
24
|
-
|
|
29
|
+
tui.fatal(`Profile "${name}" not found`);
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
await saveProfile(profile!.filename);
|
|
@@ -310,14 +310,14 @@ export async function runCreateFlow(options: CreateFlowOptions): Promise<void> {
|
|
|
310
310
|
callback: async () => {
|
|
311
311
|
const project = await projectCreate(apiClient, {
|
|
312
312
|
name: projectName,
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
orgId,
|
|
314
|
+
cloudRegion: region ?? 'usc',
|
|
315
315
|
});
|
|
316
316
|
projectId = project.id;
|
|
317
317
|
return createProjectConfig(dest, {
|
|
318
318
|
projectId: project.id,
|
|
319
319
|
orgId,
|
|
320
|
-
|
|
320
|
+
sdkKey: project.sdkKey,
|
|
321
321
|
deployment: {
|
|
322
322
|
resources: resourceConfig,
|
|
323
323
|
},
|
package/src/config.ts
CHANGED
|
@@ -41,7 +41,7 @@ export async function ensureConfigDir(): Promise<void> {
|
|
|
41
41
|
|
|
42
42
|
export async function saveProfile(path: string): Promise<void> {
|
|
43
43
|
await ensureConfigDir();
|
|
44
|
-
await writeFile(getProfilePath(), path, { mode:
|
|
44
|
+
await writeFile(getProfilePath(), path, { mode: 0o600 });
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export async function getProfile(): Promise<string> {
|
|
@@ -544,11 +544,11 @@ export async function loadProjectConfig(
|
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
type InitialProjectConfig = ProjectConfig & {
|
|
547
|
-
|
|
547
|
+
sdkKey: string;
|
|
548
548
|
};
|
|
549
549
|
|
|
550
550
|
export async function createProjectConfig(dir: string, config: InitialProjectConfig) {
|
|
551
|
-
const {
|
|
551
|
+
const { sdkKey, ...sanitizedConfig } = config;
|
|
552
552
|
|
|
553
553
|
const configPath = join(dir, 'agentuity.json');
|
|
554
554
|
const json5Content = generateJSON5WithComments(ProjectSchema, sanitizedConfig);
|
|
@@ -557,7 +557,7 @@ export async function createProjectConfig(dir: string, config: InitialProjectCon
|
|
|
557
557
|
const envPath = join(dir, '.env');
|
|
558
558
|
const comment =
|
|
559
559
|
'# AGENTUITY_SDK_KEY is a sensitive value and should not be committed to version control.';
|
|
560
|
-
const content = `${comment}\nAGENTUITY_SDK_KEY=${
|
|
560
|
+
const content = `${comment}\nAGENTUITY_SDK_KEY=${sdkKey}\n`;
|
|
561
561
|
await Bun.write(envPath, content);
|
|
562
562
|
await chmod(envPath, 0o600);
|
|
563
563
|
}
|
package/src/tui.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { stringWidth } from 'bun';
|
|
|
8
8
|
import enquirer from 'enquirer';
|
|
9
9
|
import { type OrganizationList, projectList } from '@agentuity/server';
|
|
10
10
|
import type { ColorScheme } from './terminal';
|
|
11
|
+
import type { Profile } from './types';
|
|
11
12
|
import { type APIClient as APIClientType } from './api';
|
|
12
13
|
import * as readline from 'readline';
|
|
13
14
|
|
|
@@ -1241,3 +1242,54 @@ export async function showProjectList(
|
|
|
1241
1242
|
|
|
1242
1243
|
return response.id;
|
|
1243
1244
|
}
|
|
1245
|
+
|
|
1246
|
+
/**
|
|
1247
|
+
* Show a profile list picker
|
|
1248
|
+
*
|
|
1249
|
+
* @param profiles List of profiles to choose from
|
|
1250
|
+
* @param message Prompt message
|
|
1251
|
+
* @returns The name of the selected profile
|
|
1252
|
+
*/
|
|
1253
|
+
export async function showProfileList(
|
|
1254
|
+
profiles: Profile[],
|
|
1255
|
+
message = 'Select a profile:'
|
|
1256
|
+
): Promise<string> {
|
|
1257
|
+
if (profiles.length === 0) {
|
|
1258
|
+
warning('No profiles found');
|
|
1259
|
+
process.exit(0);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
// If only one profile, just return it? No, let them confirm/see it if they asked to pick?
|
|
1263
|
+
// But for "use" it implies switching. If only one, you are already on it or it's the only choice.
|
|
1264
|
+
// But for delete, you might want to delete the only one.
|
|
1265
|
+
// So always show list.
|
|
1266
|
+
|
|
1267
|
+
// Find currently selected profile for initial selection
|
|
1268
|
+
const selectedProfile = profiles.find((p) => p.selected);
|
|
1269
|
+
const initial = selectedProfile ? selectedProfile.name : undefined;
|
|
1270
|
+
|
|
1271
|
+
// If non-interactive, return initial or first
|
|
1272
|
+
if (!process.stdin.isTTY) {
|
|
1273
|
+
if (initial) return initial;
|
|
1274
|
+
if (profiles.length === 1) {
|
|
1275
|
+
return profiles[0].name;
|
|
1276
|
+
}
|
|
1277
|
+
fatal(
|
|
1278
|
+
'Profile selection required but cannot prompt in non-interactive environment. ' +
|
|
1279
|
+
'Pass a profile name explicitly when running non-interactively.'
|
|
1280
|
+
);
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
const response = await enquirer.prompt<{ name: string }>({
|
|
1284
|
+
type: 'select',
|
|
1285
|
+
name: 'name',
|
|
1286
|
+
message: message,
|
|
1287
|
+
initial: initial,
|
|
1288
|
+
choices: profiles.map((p) => ({
|
|
1289
|
+
name: p.name,
|
|
1290
|
+
message: p.selected ? `${p.name.padEnd(15, ' ')} ${muted('(current)')}` : p.name,
|
|
1291
|
+
})),
|
|
1292
|
+
});
|
|
1293
|
+
|
|
1294
|
+
return response.name;
|
|
1295
|
+
}
|
package/src/utils/zip.ts
CHANGED
|
@@ -9,7 +9,9 @@ interface Options {
|
|
|
9
9
|
|
|
10
10
|
export async function zipDir(dir: string, outdir: string, options?: Options) {
|
|
11
11
|
const zip = new AdmZip();
|
|
12
|
-
const files = await Array.fromAsync(
|
|
12
|
+
const files = await Array.fromAsync(
|
|
13
|
+
new Glob('**/*').scan({ cwd: dir, absolute: true, dot: true })
|
|
14
|
+
);
|
|
13
15
|
const total = files.length;
|
|
14
16
|
let count = 0;
|
|
15
17
|
for (const file of files) {
|