Skip to content

feat(cli): default to human-readable text with --json opt-in - #13

Merged
ggordonhall merged 4 commits into
mainfrom
feat/cli-human-readable-output
Sep 2, 2026
Merged

feat(cli): default to human-readable text with --json opt-in#13
ggordonhall merged 4 commits into
mainfrom
feat/cli-human-readable-output

Conversation

@ggordonhall

Copy link
Copy Markdown
Collaborator

Summary

  • Closes feat(cli): default to human-readable output with --json and --text options #8. create, connect, list, resolve, publish, read, and verify now print compact human-readable text by default and accept --json to emit the identical schema-version-1 payload (no schema bump).
  • New pure module src/cli/format.ts holds one formatter per text-default result; schemas stay pure.
  • Text-mode failures print a sanitized context-tree: … line to stderr with exit 1; --json and the plumbing commands (sync, prepare-write, finish-write, install) keep the JSON error envelope on stdout.
  • Skills append --json to their invocations, so agent parsing is unchanged. No --text flag (text is the default).

Test plan

  • pnpm typecheck
  • pnpm check
  • pnpm test (builds then runs Vitest, incl. new text-mode and text-error CLI tests)
  • Manual: context-tree verify / read / list show readable output; --json restores schema-1 JSON; context-tree resolve with no connection prints a stderr line and exits 1, while resolve --json emits the JSON envelope on stdout.

🤖 Generated with Claude Code

ggordonhall and others added 4 commits September 2, 2026 09:51
Closes #8. `create`, `connect`, `list`, `resolve`, `publish`, `read`, and
`verify` now print compact human-readable text by default and accept `--json`
to emit the identical schema-version-1 payload. Text-mode failures print a
sanitized line to stderr with a non-zero exit code; `--json` and the plumbing
commands (`sync`, `prepare-write`, `finish-write`, `install`) keep the JSON
error envelope on stdout. Skills pass `--json`, so agent parsing is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The packaged end-to-end check parses JSON from create, resolve, verify, and
read, which now default to human-readable text; request --json so the wire
shape assertions keep working.

Co-Authored-By: Claude <noreply@anthropic.com>
@ggordonhall
ggordonhall merged commit 3e10a2d into main Sep 2, 2026
3 checks passed
@ggordonhall
ggordonhall deleted the feat/cli-human-readable-output branch September 2, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): default to human-readable output with --json and --text options

1 participant