CLI: improve command descriptions in help output (#18486)
* CLI: clarify config vs configure descriptions * CLI: improve top-level command descriptions * CLI: make direct command help more descriptive * CLI: add commands hint to root help * CLI: show root help hint in implicit help output * CLI: add help example for command-specific help * CLI: tweak root subcommand marker spacing * CLI: mark clawbot as subcommand root in help * CLI: derive subcommand markers from registry metadata * CLI: escape help regex CLI name
This commit is contained in:
committed by
GitHub
parent
05a83b9e97
commit
b25f334fa2
@@ -1,6 +1,7 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatHelpExamples } from "../help-format.js";
|
||||
import { registerNodesCameraCommands } from "./register.camera.js";
|
||||
import { registerNodesCanvasCommands } from "./register.canvas.js";
|
||||
import { registerNodesInvokeCommands } from "./register.invoke.js";
|
||||
@@ -13,11 +14,16 @@ import { registerNodesStatusCommands } from "./register.status.js";
|
||||
export function registerNodesCli(program: Command) {
|
||||
const nodes = program
|
||||
.command("nodes")
|
||||
.description("Manage gateway-owned node pairing")
|
||||
.description("Manage gateway-owned nodes (pairing, status, invoke, and media)")
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/nodes", "docs.openclaw.ai/cli/nodes")}\n`,
|
||||
`\n${theme.heading("Examples:")}\n${formatHelpExamples([
|
||||
["openclaw nodes status", "List known nodes with live status."],
|
||||
["openclaw nodes pairing pending", "Show pending node pairing requests."],
|
||||
['openclaw nodes run --node <id> --raw "uname -a"', "Run a shell command on a node."],
|
||||
["openclaw nodes camera snap --node <id>", "Capture a photo from a node camera."],
|
||||
])}\n\n${theme.muted("Docs:")} ${formatDocsLink("/cli/nodes", "docs.openclaw.ai/cli/nodes")}\n`,
|
||||
);
|
||||
|
||||
registerNodesStatusCommands(nodes);
|
||||
|
||||
Reference in New Issue
Block a user