share: variadic + --anon + JSON array shape (PR2 of 2) - #2
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… cleanups - extract the display-name selection switch into a pure function so the --as > --anon > basename priority is unit-testable without a live daemon - add 4 tests locking the priority order - --yes flag description now uses shareMaxBatch instead of a string literal - stub TestCmdShare_MultipleFiles_HappyPath as t.Skip (no bootstrap override available; covered by manual smoke in Task 6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update README.md, CLAUDE.md, and skills/ghosthost/SKILL.md to document the variadic `ghosthost share <path>...` form, the `--anon` flag (random 6-char slug, extension preserved), the `--yes` 64-file cap override, and the breaking change that `--json` now always emits a JSON array. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…est --yes - when the first share RPC fails, don't flush an empty [] to stdout before the stderr error; downstream pipelines otherwise see a silent empty array - new TestCmdShare_CapWithYes_BypassesLimit confirms --yes actually bypasses the 64-file cap (previously only the rejection path was tested) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
godspede
added a commit
that referenced
this pull request
Jul 17, 2026
* feat(share): AnonDisplayName (6-char base32 slug + ext) * feat(cli): printShares — slice-first output, JSON always emits array Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(cli): variadic share with --anon, --yes, atomic validation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(cli): extract selectDisplayName; cover --as/--anon priority; cleanups - extract the display-name selection switch into a pure function so the --as > --anon > basename priority is unit-testable without a live daemon - add 4 tests locking the priority order - --yes flag description now uses shareMaxBatch instead of a string literal - stub TestCmdShare_MultipleFiles_HappyPath as t.Skip (no bootstrap override available; covered by manual smoke in Task 6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: variadic share, --anon, and --json array shape (breaking) Update README.md, CLAUDE.md, and skills/ghosthost/SKILL.md to document the variadic `ghosthost share <path>...` form, the `--anon` flag (random 6-char slug, extension preserved), the `--yes` 64-file cap override, and the breaking change that `--json` now always emits a JSON array. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(cli): guard printShares from emitting [] on first-file failure; test --yes - when the first share RPC fails, don't flush an empty [] to stdout before the stderr error; downstream pipelines otherwise see a silent empty array - new TestCmdShare_CapWithYes_BypassesLimit confirms --yes actually bypasses the 64-file cap (previously only the rejection path was tested) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: godspede <jehutheawesome@gmail.com> Co-authored-by: Claude Sonnet 4.6 <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
Second of two sequential PRs for the share UX redesign. Builds on #1.
ghosthost shareis variadic —share a.png b.png c.pngcreates three independent shares in one invocation, avoiding separate permission prompts. Atomic validation: any bad path aborts the whole batch with every error reported, zero shares created. Soft cap of 64 files;--yesoverrides.--asrejected when N > 1 with a clear error.--anonreplaces each share's URL filename with a random 6-char base32 slug, preserving the file extension (secret-tax-return.pdf→k9vm3q.pdf). Original filename is never sent to the recipient. Works for single and multi-file alike;--aswins over--anonwhen both are set with N == 1.Spec:
docs/superpowers/specs/2026-04-21-share-multifile-and-minimal-output-design.mdPlan:
docs/superpowers/plans/2026-04-21-pr2-share-multifile-and-anon.mdBreaking changes
ghosthost share --jsonnow always emits a JSON array — even for a single file. Previously emitted a bareSharePayloadobject. Callers parsing stdout must update (e.g.jq '.[0].url'instead ofjq '.url'). Docs updated.Test plan
go test ./...— all packages green, zero regressionsgo vet ./...— cleango build ./cmd/ghosthost— okshare <path>...with--anonand--yesAnonDisplayNameslug shape, uniqueness, and pass-through ofSanitizeDisplayNameprintSharescovers default-multiple, default-single, verbose, JSON array, JSON-array-for-singlecmdSharevalidation: no args,--as+ multi, cap without--yes, cap with--yes(bypass), atomic bad pathselectDisplayNamepriority:--as>--anon> basename[]to stdout in JSON mode--anonURL has slug, 65 files without--yesrejected, 65 with--yesproceeds, mixed good+bad paths returnsExitSourceBadand creates zero shares🤖 Generated with Claude Code