From 33eb0b9eee16622cd4422238acb8efbba4652fce Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 10 May 2026 22:16:55 +0800 Subject: [PATCH] docs(cli): expand docs and tasks-flow CLI references with verified options --- docs/cli/docs.md | 55 +++++++++++++++++++++++++++++++++++++++++------ docs/cli/flows.md | 39 ++++++++++++++++++++++++++++----- 2 files changed, 82 insertions(+), 12 deletions(-) diff --git a/docs/cli/docs.md b/docs/cli/docs.md index fd635f4152d..06234bfaf6c 100644 --- a/docs/cli/docs.md +++ b/docs/cli/docs.md @@ -2,31 +2,72 @@ summary: "CLI reference for `openclaw docs` (search the live docs index)" read_when: - You want to search the live OpenClaw docs from the terminal + - You need to know which helper binaries the docs CLI shells out to title: "Docs" --- # `openclaw docs` -Search the live docs index. +Search the live OpenClaw docs index from the terminal. The command shells out to the public Mintlify-hosted docs MCP search endpoint at `https://docs.openclaw.ai/mcp.SearchOpenClaw` and renders the results in your terminal. + +## Usage + +```bash +openclaw docs # print docs entrypoint and example search +openclaw docs # search the live docs index +``` Arguments: -- `[query...]`: search terms to send to the live docs index +| Argument | Description | +| ------------ | ---------------------------------------------------------------------------------- | +| `[query...]` | Free-form search query. Multi-word queries are joined with spaces and sent as one. | -Examples: +## Examples ```bash -openclaw docs openclaw docs browser existing-session openclaw docs sandbox allowHostControl openclaw docs gateway token secretref ``` -Notes: +With no query, `openclaw docs` prints the docs entrypoint URL plus a sample search command instead of running a search. -- With no query, `openclaw docs` opens the live docs search entrypoint. -- Multi-word queries are passed through as one search request. +## How it works + +`openclaw docs` invokes the `mcporter` CLI to call the docs search MCP tool, then parses the `Title: / Link: / Content:` blocks from the tool output into a list of results. + +To resolve `mcporter`, OpenClaw checks in order: + +1. `mcporter` on `PATH` (used directly if present). +2. `pnpm dlx mcporter ...` if `pnpm` is installed. +3. `npx -y mcporter ...` if `npx` is installed. + +If none are available, the command fails with a hint to install `pnpm` (`npm install -g pnpm`). + +The search call uses a fixed 30 second timeout. Result snippets are truncated to ~220 characters per entry. + +## Output + +In a rich (TTY) terminal, results render as a heading followed by a bullet list. Each bullet shows the page title, the linked docs URL, and a short snippet on the next line. Empty results print "No results.". + +In non-rich output (piped, `--no-color`, scripts), the same data renders as Markdown: + +```markdown +# Docs search: + +- [Title](https://docs.openclaw.ai/...) - snippet +- [Title](https://docs.openclaw.ai/...) - snippet +``` + +## Exit codes + +| Code | Meaning | +| ---- | --------------------------------------------------- | +| `0` | Search succeeded (including zero-result responses). | +| `1` | The MCP tool call failed; stderr is printed inline. | ## Related - [CLI reference](/cli) +- [Live docs](https://docs.openclaw.ai) diff --git a/docs/cli/flows.md b/docs/cli/flows.md index e9bc8a201f7..5b5e1a1c7ca 100644 --- a/docs/cli/flows.md +++ b/docs/cli/flows.md @@ -1,23 +1,52 @@ --- summary: "Redirect: flow commands live under `openclaw tasks flow`" read_when: - - You encounter openclaw flows in older docs or release notes + - You encounter `openclaw flows` in older docs or release notes + - You want a quick TaskFlow inspection reference title: "Flows (redirect)" --- # `openclaw tasks flow` -Flow commands are subcommands of `openclaw tasks`, not a standalone `flows` command. +There is no top-level `openclaw flows` command. Durable TaskFlow inspection lives under `openclaw tasks flow`. + +## Subcommands ```bash -openclaw tasks flow list [--json] -openclaw tasks flow show +openclaw tasks flow list [--json] [--status ] +openclaw tasks flow show [--json] openclaw tasks flow cancel ``` -For full documentation see [Task Flow](/automation/taskflow) and the [tasks CLI reference](/cli/tasks). +| Subcommand | Description | Arguments / options | +| ---------- | -------------------------- | ------------------------------------------------------------------------------------- | +| `list` | List tracked TaskFlows. | `--json` machine-readable output; `--status ` filter (see status values below). | +| `show` | Show one TaskFlow. | `` flow id or owner key; `--json` machine-readable output. | +| `cancel` | Cancel a running TaskFlow. | `` flow id or owner key. | + +`` accepts either a flow id (returned by `list` / `show`) or the flow's owner key (the stable identifier the owning subsystem uses to track the flow). + +### Status filter values + +`--status` on `list` accepts one of: + +`queued`, `running`, `waiting`, `blocked`, `succeeded`, `failed`, `cancelled`, `lost` + +## Examples + +```bash +openclaw tasks flow list +openclaw tasks flow list --status running +openclaw tasks flow list --json +openclaw tasks flow show flow_abc123 +openclaw tasks flow show flow_abc123 --json +openclaw tasks flow cancel flow_abc123 +``` + +For full TaskFlow concepts and authoring see [TaskFlow](/automation/taskflow). For the parent `tasks` command see [tasks CLI reference](/cli/tasks). ## Related - [CLI reference](/cli) - [Automation](/automation) +- [TaskFlow](/automation/taskflow)