Skip to content

feat: Manage the team from the CLI - #27

Merged
mrsxl merged 2 commits into
mainfrom
feat/admin-api
Aug 27, 2026
Merged

mrsxl merged 2 commits into
mainfrom
feat/admin-api

Conversation

@mrsxl

@mrsxl mrsxl commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

Exposes the newly unified management-plane API (/admin/v1/*) through the CLI, riding on the same base URL and API key as every existing command — no new configuration, no new credential type.

New command families (14 operations):

Family Commands
team get, rename
api-key (alias key) list, get, create, rotate, revoke
member list, create (virtual), set-role, remove
invitation (alias invite) create, list, revoke
usage period-scoped quota + consumption report

Notes

  • Every write takes --idempotency-key; the core client gained *_with_headers variants to carry it (existing methods delegate, no call-site churn).
  • key create / key rotate print the full key exactly once, matching the server's one-time-secret contract; an idempotent replay omits it, and the key field is Option for exactly that case.
  • Ids placed in paths are percent-encoded via the shared encode_segment, with a hostile-id regression test.
  • Tests: 16 wire tests pin method/path/query/body/Idempotency-Key per subcommand; offline tests pin the login requirement; a client test pins that extra headers reach the wire without displacing auth.

⚠️ Depends on memorylake-apiservice#71 being deployed — until then the production endpoints for /admin/v1/* do not exist.

🤖 Generated with Claude Code

xiuliang and others added 2 commits August 27, 2026 16:06
- team / api-key / member / invitation / usage commands over /admin/v1,
  same base URL and API key as every other command
- write commands take --idempotency-key (client grows *_with_headers)
- wire + offline tests; README section

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- read sweep (team joins its roster) + usage period echo and 92-day cap
- api-key lifecycle asserts SEMANTICS: minted keys authenticate, rotate
  kills the old material, revoke and member-removal kill the rest
- set-role verified on the roster; a vm key carries the member's role and
  403s on owner-only ops; idempotent replay: same id, secret redacted
- pagination walks both pages; expires_at round-trips
- invitation create/revoke is opt-in via MEMORYLAKE_INVITE_EMAIL
  (env/.env, never committed); pending -> revoked transitions, no token
- personal teams (the CI account) pin the 409 refusal of member and
  invitation writes instead of failing; org teams run full lifecycles
- key probes run in throwaway homes: auth login switches active profile

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mrsxl
mrsxl marked this pull request as ready for review August 27, 2026 09:17
@mrsxl
mrsxl merged commit 96dd815 into main Aug 27, 2026
6 checks passed
@mrsxl
mrsxl deleted the feat/admin-api branch August 27, 2026 09:17
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.

1 participant