Skip to content

feat(cli): add --visibility and --comments to share and watch - #99

Merged
scott merged 1 commit into
mainfrom
feat/98-share-visibility-comments
Sep 5, 2026
Merged

feat(cli): add --visibility and --comments to share and watch#99
scott merged 1 commit into
mainfrom
feat/98-share-visibility-comments

Conversation

@scott

@scott scott commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds --visibility=anyone|private|hidden, --private, --comments=anyone|private|disabled, and --no-comments to gander share and gander watch.
  • Each policy JSON key is omitted unless that flag is set (flag.Visit), so a content refresh does not clobber stored ACL. --private sends "doc_visibility":"private". --no-comments sends "comment_access":"disabled" (not private).
  • Invalid combos (--comments anyone with private/hidden, --no-comments with --comments anyone|private, conflicting --private/--visibility) fail before HTTP.
  • If the server accepts the POST but omits the echoed field, the CLI errors (gandermd does not support --comments|--visibility; upgrade the server) instead of printing a URL.
  • --visibility=hidden still prints the share URL but does not open the browser (viewer is 404 for everyone).
  • gander list gains COMMENTING and VISIBILITY columns. Watch PUTs stay {content} only.

Related Issue

Closes #98

Supersedes #96 (and closed PR #97). Do not merge feat/96-share-comment-access; that branch encoded --comments team and --comment-visibility.

Pairing

gandermd wave 2 is on main (PRs 79–86). readJSON + DisallowUnknownFields 400s these keys against an older server — ship this CLI after that stack is on :latest.

Testing

go test ./...
go vet ./...
go build ./...

All green. Coverage includes omit vs send, --no-comments--comments disabled, --private body, --visibility=hidden (no browser open), watch PUT content-only, invalid combos before HTTP, old-server echo check, and list columns.

Notes

No invite subcommand in v1. Token-only authors change policy by re-sharing with flags. No Bearer PATCH client in this PR.

Omit each JSON key unless the flag is set. --private aliases
--visibility private; --no-comments sends comment_access=disabled.
gander list shows COMMENTING and VISIBILITY.

Closes #98
@scott
scott merged commit 29789cd into main Sep 5, 2026
1 check passed
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: --visibility anyone|private|hidden and --comments anyone|private|disabled

1 participant