feat: pin publish / unpublish for public share links#2
Merged
Conversation
Add `pin publish <id-or-url> [--ttl <dur>]` to mint a login-free public capability link for an existing share, and `pin unpublish <token-or-url>` to revoke one. Publish POSTs the explicit confirm sentinel the server requires, so this is the deliberate "safety off" action. Default TTL 7d (server caps at 30d). The public URL is the only thing on stdout (safe to pipe); a loud warning + expiry go to stderr. unpublish accepts a raw token or the full public URL (lifts ?token=). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Two new subcommands for the public-sharing feature (pin server #16):
pin publish <id-or-url> [--ttl <dur>]— mint a login-free public capability link for an existing share. Default TTL 7d, server caps at 30d. The public URL is the only thing on stdout (safe to pipe); a loud⚠ public…warning + expiry go to stderr.pin unpublish <token-or-url>— revoke a public link early. Accepts a raw token or the full public URL (lifts?token=).Safety
pin publishis the deliberate "safety off" action — it sends the explicit"confirm":"publish-public"sentinel the server requires, so nothing publishes by accident. Both commands reuse the human's stored credentials likeshare/get.Tests
TestParsePublicRefcovers bare-token, full-URL token extraction, and the no-token case. Existing suite green.Release
Needs a
v0.4.0tag after merge to ship via goreleaser → Homebrew tap.🤖 Generated with Claude Code