Address review of ctl --output

Add a wire output format that prints the toJSON format sent over the link. Commands without a result print {"success": true}, or "Command ran successfully" in human mode. The missing URL check throws a StartupError, unexpected command errors are rethrown to the startup handler, and startup errors log as fatal. user list, note list and host plugin list print the objects they received instead of their table rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-11-18 16:48:40 +00:00
1 parent 10beffe167
commit 8550df69eb
13 files changed
+131 -112

No files matched your search

+6 -3
View File
@@ -13,14 +13,17 @@ The easiest way to do this is to run `npx clusteriocontroller bootstrap create-c
ctl> --output json <command>
Print the result of the command as JSON on stdout instead of text meant for reading.
Lists are printed as an array of objects, other results as an object, and commands that have no result print `{}`.
Lists are printed as an array of objects, other results as an object, and commands that have no result print `{"success": true}`.
If the command fails it prints `{"error": "<ClassName>", "message": "<message>"}` and exits with a non-zero exit code.
Log messages are written to stderr in both formats.
Log messages, including the error message, are written to stderr in all formats.
`--output wire` prints the same results in the format they are sent between the controller, hosts and clusterioctl, which uses snake_case names like `is_admin`.
The `json` format uses the property names shown in the tables of the human format.
`log follow` and `debug dump-ws` keep running and print one JSON object per line as entries arrive.
`instance start-all` and `instance stop-all` print an array with an entry per instance, which has an `error` property if that instance failed to start or stop.
The default is `--output human`.
The default is `--output human`, which prints `Command ran successfully` for commands that have no result.
## Hosts