Switch Organization Command

The org switch command changes the active organization context for subsequent commands.

Usage

xpander org switch <org_id> [--force]

Options

OptionDescription
--forceOptional. Skip confirmation and force switch even with active operations

Examples

Basic Organization Switch

xpander org switch org_123

Response:

Switching Organization
=====================
From: Dev Team (org_456)
To: Acme Corp (org_123)

Verifying access... ✓
Loading organization context... ✓

Successfully switched to Acme Corp
- Role: Admin
- Status: Active
- Agents: 12 (8 active)
- Teams: 4

Current context updated:
- Configuration loaded
- Permissions applied
- Resources initialized

Force Switch with Active Operations

xpander org switch org_789 --force

Response:

Warning: Active operations detected in current organization
- 2 running agents
- 1 pending configuration

Force switching to Test Org (org_789)...
✓ Operations gracefully suspended
✓ State saved
✓ Context switched
✓ New configuration loaded

Notes

  • Switching organizations:
    • Changes the context for all subsequent commands
    • Loads organization-specific configuration
    • Applies appropriate permissions
    • Initializes necessary resources
  • The switch command:
    • Verifies access permissions
    • Loads organization settings
    • Updates environment variables
    • Configures API endpoints
  • Use --force to:
    • Skip active operation checks
    • Override pending changes
    • Force immediate switch
  • After switching:
    • Verify access with org details
    • Check resources with agent list
    • Review teams with agent team list
  • Active operations:
    • Are gracefully suspended
    • State is preserved
    • Can be resumed after switching back