feat(cli): default to human-readable text with --json opt-in - #13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create,connect,list,resolve,publish,read, andverifynow print compact human-readable text by default and accept--jsonto emit the identical schema-version-1 payload (no schema bump).src/cli/format.tsholds one formatter per text-default result; schemas stay pure.context-tree: …line to stderr with exit 1;--jsonand the plumbing commands (sync,prepare-write,finish-write,install) keep the JSON error envelope on stdout.--jsonto their invocations, so agent parsing is unchanged. No--textflag (text is the default).Test plan
pnpm typecheckpnpm checkpnpm test(builds then runs Vitest, incl. new text-mode and text-error CLI tests)context-tree verify/read/listshow readable output;--jsonrestores schema-1 JSON;context-tree resolvewith no connection prints a stderr line and exits 1, whileresolve --jsonemits the JSON envelope on stdout.🤖 Generated with Claude Code