Repository navigation
feat: manage members and invitations (member, invitation) - #57
Merged
Merged
Conversation
|
Claude finished @alukach's task in 20s —— View job ✅ No blocking issues — safe to merge. I read the diff for
Simplify (ponytail)
💰 Estimated review cost: $0.19 · 0m20s · 8 turns |
alukach
added a commit
that referenced
this pull request
Oct 17, 2026
alukach
added a commit
that referenced
this pull request
Oct 17, 2026
`source-coop member list|view|invite|edit|revoke|leave` manages who belongs to an organization or product; `source-coop invitation list|accept|reject` answers your own invitations. `member invite` takes several account IDs and `--accounts-file` (one per line) and sends one invitation each, carrying on past refusals. `-i` pickers, `--json`, prompts with back/review, and drafts follow the product commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vitations by where Accepting, rejecting and leaving printed "Accepted dana of geo-commons"; the invitation screen was titled with your own account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebased on main, whose convention test now wants every resource positional to complete: SCOPE offers your accounts and their products, a member the named scope's members, invite a product's org members not on it, and accept/reject/leave your own invitations and memberships. From the review on #57: - a resumed invite draft is shown for review before sending - a non-string account_id in -F is an error instead of being dropped - a rejected role is re-asked from the roles you can grant - member list -i honours --state - one helper picks the member for edit -i and revoke -i, and a plain loop replaces the VecDeque in invite Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alukach
force-pushed
the
feat/memberships
branch
from
October 19, 2026 19:45
27b7263 to
7969834
Compare
…ad without copying the request From the second review on #57. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alukach
marked this pull request as ready for review
October 19, 2026 19:49
This was referenced Oct 19, 2026
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.
Adds membership management to the CLI, modelled on
product.Commands
ACCOUNT(an org) orACCOUNT/PRODUCT. Members are named by account ID. The CLI finds the membership ID by listing, because the API has no GET for a single membership.invitesends one per account and carries on past refusals, reporting each. It exits with the last failure's code (e.g. 3 for "already a member").--jsonprints the memberships it created as an array. When prompted, the accounts not yet invited are saved as a draft for the next run.read_data, andownersis offered only to people who can grant it (mirrorsgrantorsin the web app's authz). A 400 onroleoraccount_idre-asks just that field.revokeasks y/n.leave, asks you to type the name.--yes.-i:e(change role) andd(revoke) only from a member's screen. An invitation's screen offers onlyd, because the API won't change an invitation's role.invitation list -ioffersato accept andrto reject./memberships(source.coop#679):GETwithmembership_account_id/product_idfor a scope's members andaccount_id/statefor your own,POSTto invite, andPATCH /memberships/{id}for a role or a state (memberaccepts,revokedrejects, revokes or leaves). Production doesn't serve it yet; staging does.inviteandrevokekeepcreateanddeleteas hidden aliases. AGENTS.md and the convention test now say so.main.rsputs the--api-url/--proxy-urlflags into a sharedSitestruct with aconnect()helper used by all three API commands. A fewproduct.rshelpers are nowpub(crate).Demos
Each GIF links to the same session on asciinema.org, where it can be paused, rewound and its text copied. Recorded (GIFs with VHS, sessions with asciinema) against a stateful stub API with made-up accounts (signed in as
dana, an owner ofacme-lab). The tapes and stub are on thedemos/pr-57branch, which exists only to host these images.`member list` — An org's members (its products' members are left out), a product's own, only invitations, and `--json`.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member view` — One member, and the whole record with `--json`.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member invite` — Bulk: account IDs from the command line plus `-A people.txt` (`#` comments skipped). It carries on past an existing member (409) and an unknown account (404), then exits with the last failure's code. After that, the prompted flow: who, then role, then review.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member edit` — With `--role`, then prompted, starting from the current role.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member revoke` — Withdrawing an invitation, removing a member, and revoking yourself, which needs the name typed back (typed wrong here, so nothing changes).
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member leave` — Typed confirmation, then leaving again: not a member, exit 5.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`member list -i` — Open bob, `e` to change his role, back; open carol's invitation, `d` to withdraw it; `/` to filter.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`invitation list` / `accept` / `reject`
▶ Pausable recording on asciinema.org: pause, scrub and copy text
`invitation list -i` — Open one and `a` to accept, open the next and `r` to reject.
▶ Pausable recording on asciinema.org: pause, scrub and copy text
Not in this PR
auth status: that command only reads the local cache, and the hint would mean a network call.nkey to invite frommember list -i: it would break the "changes only from a record's screen" rule. Easy to add if we want it.Server-side follow-ups (source.coop)
Testing
cargo fmt,cargo clippy --all-targets -- -D warnings,cargo testandcargo test --features stagingpass: 140 tests, 29 of them new.askedlists.GET /memberships?membership_account_id=…on staging, which returns the page the CLI reads. Not yet run end to end against staging while signed in: invites, role changes and accepting are covered by mocked tests only.🤖 Generated with Claude Code