viza 1.8.24 → 1.8.26

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.
@@ -61,6 +61,19 @@ export async function createProgram() {
61
61
  sub = new Command(name);
62
62
  sub.description(node.description || "");
63
63
  parent.addCommand(sub);
64
+ // Bind positional arguments from descriptor
65
+ if (node.args?.length) {
66
+ for (const arg of node.args) {
67
+ const syntax = arg.required
68
+ ? `<${arg.name}>`
69
+ : `[${arg.name}]`;
70
+ // avoid duplicate arguments
71
+ const exists = sub._args?.some((a) => a.name === arg.name);
72
+ if (!exists) {
73
+ sub.argument(syntax, arg.description);
74
+ }
75
+ }
76
+ }
64
77
  }
65
78
  // Bind global CLI options to every command (Commander does not inherit options)
66
79
  for (const opt of getGlobalOptions()) {
@@ -104,7 +117,8 @@ export async function createProgram() {
104
117
  return merged;
105
118
  }
106
119
  const opts = collectOptions(cmd);
107
- await node.run(opts);
120
+ const positionalArgs = args.slice(0, -1);
121
+ await node.run(...positionalArgs, opts);
108
122
  });
109
123
  }
110
124
  if (node.children?.length) {
@@ -3,6 +3,12 @@ import { loginBillingAwsCommand } from "./aws.js";
3
3
  const descriptor = {
4
4
  command: "billing login aws",
5
5
  description: "Login to AWS billing account",
6
+ options: [
7
+ {
8
+ flags: "--admin",
9
+ description: "Login as admin user"
10
+ }
11
+ ],
6
12
  run: loginBillingAwsCommand
7
13
  };
8
14
  registerCommand(descriptor);
@@ -3,9 +3,15 @@ import { logsCommand } from "./logs.js";
3
3
  const descriptor = {
4
4
  command: "dispatch logs",
5
5
  description: "View dispatch logs",
6
- run: async (options) => {
7
- const [runId, opts] = Array.isArray(options) ? options : [undefined, options];
8
- return logsCommand(runId, opts ?? {});
6
+ args: [
7
+ {
8
+ name: "runId",
9
+ required: true,
10
+ description: "Run ID to fetch logs"
11
+ }
12
+ ],
13
+ run: async (runId, options) => {
14
+ return logsCommand(runId, options ?? {});
9
15
  }
10
16
  };
11
17
  registerCommand(descriptor);
@@ -16,16 +16,6 @@ export async function logsCommand(runId, options) {
16
16
  const intent = resolveHubIntent();
17
17
  // Resolve allowed teams (same contract as other commands)
18
18
  const allowedTeams = Array.from(policy.byEnv[env]);
19
- // 2️⃣ Handle --app locally (do NOT dispatch)
20
- if (options.app === true) {
21
- const url = env === "prod"
22
- ? "https://github.com/Modo-Infra/publish-app/actions"
23
- : "https://github.com/Modo-Infra/build-app/actions";
24
- console.log("\n📦 App pipeline runs:");
25
- console.log(url);
26
- console.log();
27
- return;
28
- }
29
19
  // 3️⃣ Dispatch intent to hub
30
20
  const result = await dispatchIntentAndWait({
31
21
  intent,
@@ -3,6 +3,12 @@ import { runsCommand } from "./runs.js";
3
3
  const descriptor = {
4
4
  command: "dispatch runs",
5
5
  description: "List and inspect dispatch runs",
6
+ options: [
7
+ {
8
+ flags: "--limit <limit>",
9
+ description: "Limit number of runs returned"
10
+ }
11
+ ],
6
12
  run: runsCommand
7
13
  };
8
14
  registerCommand(descriptor);
@@ -17,16 +17,6 @@ export async function runsCommand(options) {
17
17
  const intent = RUNTIME_HUB_INTENT;
18
18
  // Resolve allowed teams (same contract as other commands)
19
19
  const allowedTeams = Array.from(policy.byEnv[env]);
20
- // 2️⃣ Handle --app locally (do NOT dispatch)
21
- if (options.app === true) {
22
- const url = env === "prod"
23
- ? "https://github.com/Modo-Infra/publish-app/actions"
24
- : "https://github.com/Modo-Infra/build-app/actions";
25
- console.log("\n📦 App pipeline runs:");
26
- console.log(url);
27
- console.log();
28
- return;
29
- }
30
20
  // Parse limit option
31
21
  let limit = undefined;
32
22
  if (options.limit !== undefined) {
@@ -3,6 +3,13 @@ import { restoreGithubSecretsCommand } from "./restore.js";
3
3
  const descriptor = {
4
4
  command: "github secrets restore",
5
5
  description: "Restore GitHub secrets from ssm parameter store",
6
+ options: [
7
+ { flags: "--core", description: "Restore core secrets" },
8
+ { flags: "--infra", description: "Restore infra secrets" },
9
+ { flags: "--builder", description: "Restore builder secrets" },
10
+ { flags: "--deployer", description: "Restore deployer secrets" },
11
+ { flags: "--all", description: "Restore all secrets" }
12
+ ],
6
13
  run: restoreGithubSecretsCommand
7
14
  };
8
15
  registerCommand(descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {