@autohq/cli 0.1.201 → 0.1.202
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/agent-bridge.js +1 -1
- package/dist/index.js +51 -1
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -26656,7 +26656,7 @@ Object.assign(lookup, {
|
|
|
26656
26656
|
// package.json
|
|
26657
26657
|
var package_default = {
|
|
26658
26658
|
name: "@autohq/cli",
|
|
26659
|
-
version: "0.1.
|
|
26659
|
+
version: "0.1.202",
|
|
26660
26660
|
license: "SEE LICENSE IN README.md",
|
|
26661
26661
|
publishConfig: {
|
|
26662
26662
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -21669,7 +21669,7 @@ var init_package = __esm({
|
|
|
21669
21669
|
"package.json"() {
|
|
21670
21670
|
package_default = {
|
|
21671
21671
|
name: "@autohq/cli",
|
|
21672
|
-
version: "0.1.
|
|
21672
|
+
version: "0.1.202",
|
|
21673
21673
|
license: "SEE LICENSE IN README.md",
|
|
21674
21674
|
publishConfig: {
|
|
21675
21675
|
access: "public"
|
|
@@ -35314,6 +35314,53 @@ function scopeLabel(projectId) {
|
|
|
35314
35314
|
return projectId ? `project:${projectId}` : "organization";
|
|
35315
35315
|
}
|
|
35316
35316
|
|
|
35317
|
+
// src/commands/secrets/view.ts
|
|
35318
|
+
init_base_url();
|
|
35319
|
+
init_browser();
|
|
35320
|
+
init_file();
|
|
35321
|
+
async function viewSecrets(input) {
|
|
35322
|
+
const scope = await resolveSecretsScope(input);
|
|
35323
|
+
const url2 = secretsSettingsUrl({
|
|
35324
|
+
webBaseUrl: resolveSecretsWebBaseUrl(input),
|
|
35325
|
+
...scope
|
|
35326
|
+
});
|
|
35327
|
+
input.context.writeOutput(`Opening ${url2}`);
|
|
35328
|
+
(input.openBrowser ?? openBrowser)(url2);
|
|
35329
|
+
}
|
|
35330
|
+
function secretsSettingsUrl(input) {
|
|
35331
|
+
const path2 = input.projectId ? `/orgs/${input.organizationId}/projects/${input.projectId}/settings/secrets` : `/orgs/${input.organizationId}/settings/secrets`;
|
|
35332
|
+
return new URL(path2, input.webBaseUrl).toString();
|
|
35333
|
+
}
|
|
35334
|
+
async function resolveSecretsScope(input) {
|
|
35335
|
+
const client = createContextApiClient(input.context);
|
|
35336
|
+
if (input.commandOptions.project) {
|
|
35337
|
+
const scope = await requireProjectScope({
|
|
35338
|
+
context: input.context,
|
|
35339
|
+
options: input.commandOptions,
|
|
35340
|
+
identifier: input.commandOptions.project,
|
|
35341
|
+
explicitHint: "--project <project>"
|
|
35342
|
+
});
|
|
35343
|
+
const organizationId2 = scope.organizationId ?? (await client.activeOrganization()).organizationId;
|
|
35344
|
+
return { organizationId: organizationId2, projectId: scope.projectId };
|
|
35345
|
+
}
|
|
35346
|
+
const { organizationId } = await client.activeOrganization();
|
|
35347
|
+
return { organizationId };
|
|
35348
|
+
}
|
|
35349
|
+
function resolveSecretsWebBaseUrl(input) {
|
|
35350
|
+
const explicitWebBaseUrl = normalizeApiBaseUrl(
|
|
35351
|
+
input.context.env.AUTO_WEB_BASE_URL
|
|
35352
|
+
);
|
|
35353
|
+
if (explicitWebBaseUrl) {
|
|
35354
|
+
return explicitWebBaseUrl;
|
|
35355
|
+
}
|
|
35356
|
+
const config2 = readConfig(input.context.configPath);
|
|
35357
|
+
return resolveApiBaseUrl({
|
|
35358
|
+
explicit: apiUrlFromOptions(input.context, input.commandOptions),
|
|
35359
|
+
env: input.context.env,
|
|
35360
|
+
configServerUrl: config2.serverUrl
|
|
35361
|
+
});
|
|
35362
|
+
}
|
|
35363
|
+
|
|
35317
35364
|
// src/commands/secrets/commands.ts
|
|
35318
35365
|
function registerSecretCommands(program, context) {
|
|
35319
35366
|
const secrets = program.command("secrets").description("Manage Auto organization and project secrets.");
|
|
@@ -35359,6 +35406,9 @@ function registerSecretCommands(program, context) {
|
|
|
35359
35406
|
context
|
|
35360
35407
|
});
|
|
35361
35408
|
});
|
|
35409
|
+
secrets.command("view").description("Open the web Secrets settings page in your browser.").option("--project <project>", "project id; defaults to organization scope").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (commandOptions) => {
|
|
35410
|
+
await viewSecrets({ commandOptions, context });
|
|
35411
|
+
});
|
|
35362
35412
|
secrets.command("remove").alias("rm").description("Remove a secret.").argument("<name>", "secret name").option("--project <project>", "project id; defaults to organization scope").option("--json", "print removed secret metadata as JSON").option("-y, --yes", "skip confirmation prompt").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(async (name, commandOptions) => {
|
|
35363
35413
|
await removeSecret({
|
|
35364
35414
|
client: createContextApiClient(context),
|