Skip to content

feat(cli): workspace members namespace + post-login workspace prompt#28

Merged
George-iam merged 1 commit intomainfrom
feat/plan-completion-workspace-members-20260309
Mar 9, 2026
Merged

feat(cli): workspace members namespace + post-login workspace prompt#28
George-iam merged 1 commit intomainfrom
feat/plan-completion-workspace-members-20260309

Conversation

@George-iam
Copy link
Contributor

Summary

Closes three remaining gaps from TRACK_H_ACCOUNT_IDENTITY_AND_ACCESS_MODEL_PLAN.md:

1. axme workspace members list/include/exclude

New subcommand group under axme workspace implementing the plan's required namespace:

  • axme workspace members list — list workspace members
  • axme workspace members include <actor-id> [--role member] [--org-id] [--workspace-id] — include an existing org member into the workspace (calls POST /v1/workspaces/{id}/members/include)
  • axme workspace members exclude <member-id> [--workspace-id] — remove from workspace without removing from org (calls DELETE /v1/workspaces/{id}/members/{mid}/exclude)

This complements the existing axme member org-level commands.

2. Post-login interactive workspace prompt

After email OTP login, if the server has not auto-selected a workspace:

  • 0 workspaces → guidance message printed
  • 1 workspace → auto-selected and confirmed to user
  • N>1 workspaces → numbered list shown, user prompted to pick one (or skip). Selection calls POST /v1/portal/personal/workspace-selection.

Bypassed in --json mode so scripted/CI usage is unaffected.

3. Workspace command refactor

newWorkspaceListCmd and newWorkspaceUseCmd extracted as named functions for readability.

Test plan

  • All existing CLI tests pass (go test ./cmd/axme/)
  • axme workspace members --help shows list/include/exclude
  • axme login with a fresh account auto-selects single workspace
  • axme login with multiple workspaces shows numbered prompt

Made with Cursor

…28)

Track H plan completion — three missing items:

1. axme workspace members list/include/exclude
   - New subcommand group under `axme workspace` that mirrors the plan's
     required `axme workspace members` namespace.
   - `include <actor-id>` — calls POST /v1/workspaces/{id}/members/include
     (add existing org member to a workspace without changing org role).
   - `exclude <member-id>` — calls DELETE /v1/workspaces/{id}/members/{mid}/exclude
     (remove from workspace only; org membership retained).
   - `list` — scoped to active workspace.

2. Post-login interactive workspace prompt
   After email OTP verification, if the server has not auto-selected a workspace:
   - 0 workspaces → prints guidance message.
   - 1 workspace → auto-selects it and tells the user.
   - N>1 workspaces → shows a numbered list, prompts the user to pick one,
     calls POST /v1/portal/personal/workspace-selection with the choice.
   Prompt is bypassed in --json mode and in non-interactive/piped environments.

3. Refactored workspace command into named functions
   newWorkspaceListCmd, newWorkspaceUseCmd extracted for readability.

Made-with: Cursor
@George-iam George-iam merged commit 2dc39da into main Mar 9, 2026
1 check passed
@George-iam George-iam deleted the feat/plan-completion-workspace-members-20260309 branch March 9, 2026 20:55
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