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:
Benjamin Jesuiter
2026-02-16 22:06:25 +01:00
committed by GitHub
parent 05a83b9e97
commit b25f334fa2
15 changed files with 288 additions and 69 deletions

View File

@@ -8,6 +8,7 @@ import { defaultRuntime } from "../runtime.js";
import { formatDocsLink } from "../terminal/links.js";
import { renderTable } from "../terminal/table.js";
import { theme } from "../terminal/theme.js";
import { formatHelpExamples } from "./help-format.js";
function parseLimit(value: unknown): number | null {
if (typeof value === "number" && Number.isFinite(value)) {
@@ -64,11 +65,22 @@ function printDirectoryList(params: {
export function registerDirectoryCli(program: Command) {
const directory = program
.command("directory")
.description("Directory lookups (self, peers, groups) for channels that support it")
.description("Lookup contact and group IDs (self, peers, groups) for supported chat channels")
.addHelpText(
"after",
() =>
`\n${theme.muted("Docs:")} ${formatDocsLink(
`\n${theme.heading("Examples:")}\n${formatHelpExamples([
["openclaw directory self --channel slack", "Show the connected account identity."],
[
'openclaw directory peers list --channel slack --query "alice"',
"Search contact/user IDs by name.",
],
["openclaw directory groups list --channel discord", "List available groups/channels."],
[
"openclaw directory groups members --channel discord --group-id <id>",
"List members for a specific group.",
],
])}\n\n${theme.muted("Docs:")} ${formatDocsLink(
"/cli/directory",
"docs.openclaw.ai/cli/directory",
)}\n`,