|
1 | | -import { Command } from "commander"; |
| 1 | +import { Command, Option } from "commander"; |
2 | 2 | import { VERSION } from "../version.js"; |
3 | 3 | import { createDevbox } from "../commands/devbox/create.js"; |
4 | 4 | import { listDevboxes } from "../commands/devbox/list.js"; |
5 | 5 | import { deleteDevbox } from "../commands/devbox/delete.js"; |
6 | 6 | import { execCommand } from "../commands/devbox/exec.js"; |
7 | 7 | import { uploadFile } from "../commands/devbox/upload.js"; |
| 8 | +import { runloopBaseDomain } from "./config.js"; |
| 9 | + |
| 10 | +function publicOption(description: string): Option { |
| 11 | + const opt = new Option("--public", description); |
| 12 | + if (runloopBaseDomain() === "runloop.ai") { |
| 13 | + opt.hideHelp(); |
| 14 | + } |
| 15 | + return opt; |
| 16 | +} |
8 | 17 |
|
9 | 18 | /** |
10 | 19 | * Creates and configures the Commander program with all commands. |
@@ -657,7 +666,7 @@ export function createProgram(): Command { |
657 | 666 | "--content-type <type>", |
658 | 667 | "Content type: unspecified|text|binary|gzip|tar|tgz", |
659 | 668 | ) |
660 | | - .option("--public", "Make object publicly accessible") |
| 669 | + .addOption(publicOption("Make object publicly accessible")) |
661 | 670 | .option( |
662 | 671 | "-o, --output [format]", |
663 | 672 | "Output format: text|json|yaml (default: text)", |
@@ -1210,6 +1219,7 @@ export function createProgram(): Command { |
1210 | 1219 | "--setup-commands <commands...>", |
1211 | 1220 | "Setup commands to run after installation", |
1212 | 1221 | ) |
| 1222 | + .addOption(publicOption("Make agent publicly accessible")) |
1213 | 1223 | .option( |
1214 | 1224 | "-o, --output [format]", |
1215 | 1225 | "Output format: text|json|yaml (default: text)", |
|
0 commit comments