diff --git a/src/lib/credentials-cli-command.ts b/src/lib/credentials-cli-command.ts index 887ec5f5de1..a9349d463fe 100644 --- a/src/lib/credentials-cli-command.ts +++ b/src/lib/credentials-cli-command.ts @@ -56,6 +56,10 @@ export class CredentialsCommand extends Command { static description = "List or reset provider credentials registered with the OpenShell gateway."; static usage = ["credentials "]; + static examples = [ + "<%= config.bin %> credentials list", + "<%= config.bin %> credentials reset nvidia-prod --yes", + ]; static flags = { help: Flags.help({ char: "h" }), }; @@ -72,6 +76,7 @@ export class CredentialsListCommand extends Command { static summary = "List stored credential providers"; static description = "List provider credentials registered with the OpenShell gateway."; static usage = ["credentials list"]; + static examples = ["<%= config.bin %> credentials list"]; static flags = { help: Flags.help({ char: "h" }), }; @@ -120,6 +125,10 @@ export class CredentialsResetCommand extends Command { static summary = "Remove a provider credential"; static description = "Remove a provider credential so onboard re-prompts for it."; static usage = ["credentials reset [--yes]"]; + static examples = [ + "<%= config.bin %> credentials reset nvidia-prod", + "<%= config.bin %> credentials reset nvidia-prod --yes", + ]; static args = { provider: Args.string({ name: "PROVIDER", diff --git a/src/lib/gateway-token-cli-command.ts b/src/lib/gateway-token-cli-command.ts index e20115edeb6..36d3ae960ca 100644 --- a/src/lib/gateway-token-cli-command.ts +++ b/src/lib/gateway-token-cli-command.ts @@ -17,6 +17,10 @@ export default class GatewayTokenCliCommand extends Command { static summary = "Print the OpenClaw gateway auth token to stdout"; static description = "Print the OpenClaw gateway auth token for a running sandbox to stdout."; static usage = [" gateway-token [--quiet|-q]"]; + static examples = [ + "<%= config.bin %> alpha gateway-token", + "<%= config.bin %> alpha gateway-token --quiet", + ]; static args = { sandboxName: Args.string({ name: "sandbox", diff --git a/src/lib/list-command.ts b/src/lib/list-command.ts index 0e0bc856698..c7be5f7fbee 100644 --- a/src/lib/list-command.ts +++ b/src/lib/list-command.ts @@ -16,6 +16,7 @@ export default class ListCommand extends Command { static description = "List all registered sandboxes with their model, provider, and policy presets."; static usage = ["list [--json]"]; + static examples = ["<%= config.bin %> list", "<%= config.bin %> list --json"]; static flags = { help: Flags.help({ char: "h" }), }; diff --git a/src/lib/maintenance-cli-commands.ts b/src/lib/maintenance-cli-commands.ts index eb03289e090..c40e95e4eeb 100644 --- a/src/lib/maintenance-cli-commands.ts +++ b/src/lib/maintenance-cli-commands.ts @@ -17,6 +17,7 @@ export class BackupAllCommand extends Command { static summary = "Back up all sandbox state before upgrade"; static description = "Back up registered, running sandbox state before upgrading."; static usage = ["backup-all"]; + static examples = ["<%= config.bin %> backup-all"]; static flags = { help: Flags.help({ char: "h" }), }; @@ -33,6 +34,10 @@ export class UpgradeSandboxesCommand extends Command { static summary = "Detect and rebuild stale sandboxes"; static description = "Detect stale sandboxes and optionally rebuild them."; static usage = ["upgrade-sandboxes [--check] [--auto] [--yes]"]; + static examples = [ + "<%= config.bin %> upgrade-sandboxes --check", + "<%= config.bin %> upgrade-sandboxes --auto --yes", + ]; static flags = { help: Flags.help({ char: "h" }), check: Flags.boolean({ description: "Only check whether sandboxes need upgrading" }), @@ -56,6 +61,7 @@ export class GarbageCollectImagesCommand extends Command { static summary = "Remove orphaned sandbox Docker images"; static description = "Remove sandbox Docker images that are not referenced by registered sandboxes."; static usage = ["gc [--dry-run] [--yes|--force]"]; + static examples = ["<%= config.bin %> gc --dry-run", "<%= config.bin %> gc --yes"]; static flags = { help: Flags.help({ char: "h" }), "dry-run": Flags.boolean({ description: "Show images that would be removed without deleting" }), diff --git a/src/lib/status-command.ts b/src/lib/status-command.ts index 49a612e693d..956c4647a85 100644 --- a/src/lib/status-command.ts +++ b/src/lib/status-command.ts @@ -15,6 +15,7 @@ export default class StatusCommand extends Command { static summary = "Show sandbox list and service status"; static description = "Show registered sandboxes, live inference, services, and messaging health."; static usage = ["status [--json]"]; + static examples = ["<%= config.bin %> status", "<%= config.bin %> status --json"]; static flags = { help: Flags.help({ char: "h" }), }; diff --git a/src/lib/tunnel-commands.ts b/src/lib/tunnel-commands.ts index 84062ef266e..69aca9bff92 100644 --- a/src/lib/tunnel-commands.ts +++ b/src/lib/tunnel-commands.ts @@ -22,6 +22,7 @@ export class TunnelStartCommand extends Command { static summary = "Start the cloudflared public-URL tunnel"; static description = "Start the cloudflared public-URL tunnel for the default sandbox dashboard."; static usage = ["tunnel start"]; + static examples = ["<%= config.bin %> tunnel start"]; static flags = { help: Flags.help({ char: "h" }), }; @@ -38,6 +39,7 @@ export class TunnelStopCommand extends Command { static summary = "Stop the cloudflared public-URL tunnel"; static description = "Stop the cloudflared public-URL tunnel for the default sandbox dashboard."; static usage = ["tunnel stop"]; + static examples = ["<%= config.bin %> tunnel stop"]; static flags = { help: Flags.help({ char: "h" }), }; @@ -54,6 +56,7 @@ export class DeprecatedStartCommand extends Command { static summary = "Deprecated alias for 'tunnel start'"; static description = "Deprecated alias for tunnel start."; static usage = ["start"]; + static examples = ["<%= config.bin %> start"]; static flags = { help: Flags.help({ char: "h" }), }; @@ -73,6 +76,7 @@ export class DeprecatedStopCommand extends Command { static summary = "Deprecated alias for 'tunnel stop'"; static description = "Deprecated alias for tunnel stop."; static usage = ["stop"]; + static examples = ["<%= config.bin %> stop"]; static flags = { help: Flags.help({ char: "h" }), }; diff --git a/src/lib/uninstall-cli-command.ts b/src/lib/uninstall-cli-command.ts index 1283a7b52c8..a52abc37da6 100644 --- a/src/lib/uninstall-cli-command.ts +++ b/src/lib/uninstall-cli-command.ts @@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process"; -import { Command } from "@oclif/core"; +import { Command, Flags } from "@oclif/core"; import { getVersion } from "./version"; import { buildVersionedUninstallUrl, runUninstallCommand } from "./uninstall-command"; @@ -16,6 +16,10 @@ export default class UninstallCliCommand extends Command { static summary = "Run uninstall.sh"; static description = "Run the local uninstall.sh script; remote fallback is disabled."; static usage = ["uninstall [flags]"]; + static examples = ["<%= config.bin %> uninstall --yes"]; + static flags = { + help: Flags.help({ char: "h" }), + }; public async run(): Promise { this.parsed = true;