fix(share): honor --json on arc share list - #44
Merged
Conversation
`arc share list --json` was silently emitting the tab-separated text
output, ignoring the global flag. The handler called `fmt.Printf` directly
instead of branching on `outputJSON`.
Output is now a JSON array of `{id, kind, url, key_b64url, plan_file,
created_at}` entries. Edit tokens are deliberately omitted — they're
bearer secrets and don't belong in machine-readable output. Decryption
keys (`key_b64url`) are included to preserve parity with the text
output, where the same key already travels inside the printed Share URL.
Tests: TestRunShareListJSON (multi-row, JSON shape, no edit_token leak)
+ TestRunShareListJSONEmpty (empty keyring → `[]`, not `(no shares)`).
bfirestone
added a commit
to SentioLabs/claude-marketplace
that referenced
this pull request
May 1, 2026
Now that PR SentioLabs/arc#44 makes `--json` actually work, surface the output schema in the two skills that use it: - skills/plan: pull the jq lookup onto its own code block and document the per-entry fields ({id, kind, url, key_b64url, plan_file, created_at}, edit_token redacted). - skills/arc: expand the `arc share list` row in the CLI table to call out --json and the schema, so agents can discover the file_path lookup without reading the plan skill first.
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
arc share list --jsonwas silently emitting the tab-separated text output, ignoring the global--jsonflag. The handler incmd/arc/share.gocalledfmt.Printfdirectly instead of branching on the package-leveloutputJSON, the wayarc plan,arc label, and friends already do.After this fix:
Why this matters
The marketplace plugin's
/arc:planskill now relies onarc share list --json | jqto look up the local file path for a given share ID (sincearc share showreturns the decrypted plan content, not metadata). Until this fix, that lookup silently failed.Surface choices
edit_tokenis omitted from JSON. It's a bearer secret gated behind the Author URL — it doesn't belong in machine-readable output that might get teed to logs or CI artifacts.key_b64urlis included. This preserves parity with the text output, where the same key already travels inside the printed Share URL fragment (#k=<key>). Excluding it from--jsonwould create inconsistent surface area without improving security posture.[]. Not the human(no shares)string, so JSON consumers can[].lengthwithout parsing.Test plan
TestRunShareListJSON— seeds two shares, asserts JSON parses to a 2-element array containing both IDs, asserts edit_tokens don't leakTestRunShareListJSONEmpty— empty keyring returns valid[]make build-quick+./bin/arc share list --jsonagainst my local keyring → matches expected schemago test ./...— full suite greenmake lint— clean