@corvio/admin-cli 0.1.0-beta.5 → 0.1.0-beta.6

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/cli.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  writeResult,
25
25
  } from "./core.js";
26
26
 
27
- const VERSION = "0.1.0-beta.5";
27
+ const VERSION = "0.1.0-beta.6";
28
28
  const DEFAULT_API_BASE = "https://api.corvio.ai/v1";
29
29
  const USER_AGENT = `corvio-admin-cli/${VERSION}`;
30
30
  const GLOBAL_OPTIONS = Object.freeze(["api-base", "json", "no-input", "help", "version"]);
package/dist/core.js CHANGED
@@ -95,6 +95,9 @@ export function parseArgv(argv) {
95
95
  "allow-actions",
96
96
  "private-link",
97
97
  "force",
98
+ "once",
99
+ "include-revoked",
100
+ "start-new-chain",
98
101
  "help",
99
102
  "version",
100
103
  ]);
@@ -585,6 +588,23 @@ export async function readWorkspaceCredential(env = process.env) {
585
588
  return { key, source: "device_link", profile: profileName, metadata };
586
589
  }
587
590
 
591
+ export function readAgentCredential(env = process.env) {
592
+ const key = String(env.CORVIO_AGENT_API_KEY || "").trim();
593
+ if (!key) {
594
+ throw new CliError(
595
+ "No Agent credential found. Set CORVIO_AGENT_API_KEY to the cvg_ secret returned when the Agent was created.",
596
+ { code: "agent_auth_required", exitCode: EXIT.AUTH },
597
+ );
598
+ }
599
+ if (!key.startsWith("cvg_")) {
600
+ throw new CliError("CORVIO_AGENT_API_KEY must be an Agent cvg_ key.", {
601
+ code: "invalid_agent_key",
602
+ exitCode: EXIT.AUTH,
603
+ });
604
+ }
605
+ return { key, source: "environment", profile: null, metadata: null };
606
+ }
607
+
588
608
  export async function storeWorkspaceCredential(payload, env = process.env) {
589
609
  const path = workspaceCredentialPath(env);
590
610
  const root = dirname(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corvio/admin-cli",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "Official read-only Corvio platform administrator CLI.",
5
5
  "type": "module",
6
6
  "bin": {