You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add structured output to report and status built-ins
Part of #175. `validate`, `verify`, `doctor`, bare `skills`, `daemon status`,
and `profile list` returned stable data internally but rejected `-f/--format`
and printed hand-written text only. Each now routes through the shared
`resolveOutputFormat` + `render` path introduced in #190.
`adapter status` already gained `-f` in #190, so it needed no change here.
Each command keeps its human-readable report as the `table` rendering, which
remains the default, and returns the underlying result object under any other
format. Following the `convention-audit` precedent, the human text is chosen on
the raw format rather than the TTY-resolved one, so no existing implicit
behavior changes.
`daemon status` gains a machine-readable projection that mirrors the text
rendering, reporting `{ running: false }` when no daemon is reachable.
`profile list` returns one row per profile covering both connected profiles and
saved-but-disconnected aliases, aligning it with the hosted profile-list row
set. Daemon guidance for those two goes to stderr under structured formats so
stdout stays parseable.
Bare `skills` and `skills list` now share one renderer instead of duplicating
the row set with a hardcoded format.
Browser read commands are intentionally left for a follow-up: they go through
the session/bridge layer and need separate care around the streaming and
JSONL-follow exclusions the issue calls out.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CVuD882dJuEwWKWBLaf7bs
Copy file name to clipboardExpand all lines: docs/cli-reference.mdx
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,24 @@ webcmd hackernews top -f csv
160
160
161
161
Agents should use JSON unless they are presenting output to a human.
162
162
163
+
### Reports and status commands
164
+
165
+
`validate`, `verify`, `doctor`, `skills`, `adapter status`, `daemon status`, and `profile list` also accept `-f/--format`:
166
+
167
+
```bash
168
+
webcmd validate -f json
169
+
webcmd verify -f yaml
170
+
webcmd doctor -f json
171
+
webcmd daemon status -f json
172
+
webcmd profile list -f json
173
+
```
174
+
175
+
Each keeps its human-readable report as the `table` rendering, which stays the default. Pass another format to get the underlying result object instead — the validation report for `validate`, the verify report for `verify`, the diagnostic report for `doctor`, and a row set for `profile list`.
176
+
177
+
`daemon status -f json` returns `{ "running": false }` when no daemon is reachable, and otherwise reports `running`, `stale`, `pid`, `version`, `uptimeMs`, `runtimeConnected`, `profiles`, `memoryMB`, and `port`.
178
+
179
+
`profile list` returns one row per profile with `contextId`, `alias`, `default`, `connected`, and `runtimeVersion`, covering both connected profiles and saved aliases that are not currently connected. If the daemon is unreachable or stale, `profile list -f json`/`-f yaml` fails with a `DAEMON_UNAVAILABLE` error (exit 1) and a restart hint instead of returning `[]` — an empty list and an unreadable runtime are different facts.
Copy file name to clipboardExpand all lines: skills/webcmd-usage/SKILL.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,8 @@ Use this fallback order:
134
134
135
135
Command-specific flags such as `--limit` and `--filter` are not universal. Read `<site> <command> --help`.
136
136
137
+
Report and status commands — `validate`, `verify`, `doctor`, `skills`, `adapter status`, `daemon status`, and `profile list` — default to a human-readable `table` rendering and return their underlying result object under any other format. Use `-f json` when parsing them. `profile list -f json` returns rows of `contextId`, `alias`, `default`, `connected`, and `runtimeVersion`, and fails with a `DAEMON_UNAVAILABLE` error (exit 1) instead of `[]` when the daemon is unreachable or stale. `daemon status -f json` returns `{ "running": false }` when no daemon is reachable; that guidance goes to stdout as data, not stderr.
138
+
137
139
## Output Formats
138
140
139
141
-`json`: pretty-printed, 2-space indent. Best default for agents.
0 commit comments