Skip to Content

Workspaces

TL;DR

Workspaces provide logical multi-tenant isolation in CMDOP. Each workspace is a completely separate environment containing its own machines, sessions, users, and API keys. Team members are assigned roles (Owner, Admin, Member, Guest) that control access. API keys are scoped per workspace, so switching workspaces means using a different key. Hostnames are unique within a workspace.

Workspaces provide multi-tenant isolation in CMDOP. Each workspace is a completely separate environment with its own machines, sessions, users, and API keys.

How does workspace isolation work?

What resources are isolated per workspace?

ResourceIsolation
MachinesHostname unique per workspace
SessionsOnly accessible within workspace
API KeysScoped to workspace
UsersMembership per workspace
Audit LogsSeparated by workspace
BillingPer workspace

What is the workspace structure?

# Hierarchical breakdown of a workspace and its resources Workspace β”œβ”€β”€ Settings β”‚ β”œβ”€β”€ Name β”‚ β”œβ”€β”€ Slug (URL-safe identifier) β”‚ └── Billing info β”‚ β”œβ”€β”€ Members β”‚ β”œβ”€β”€ Owners (full control) β”‚ β”œβ”€β”€ Admins (manage machines, users) β”‚ β”œβ”€β”€ Members (access sessions) β”‚ └── Guests (read-only, optional) β”‚ β”œβ”€β”€ Machines β”‚ β”œβ”€β”€ web-1 (hostname) β”‚ β”œβ”€β”€ web-2 β”‚ └── db-1 β”‚ β”œβ”€β”€ Sessions β”‚ β”œβ”€β”€ Active sessions β”‚ └── Session history β”‚ └── API Keys β”œβ”€β”€ Personal keys (per user) └── Workspace keys (shared)

What are the member roles and permissions?

What can an Owner do?

Full control over workspace:

PermissionAllowed
Manage billingYes
Delete workspaceYes
Manage membersYes
Manage machinesYes
Access sessionsYes
Create API keysYes

What can an Admin do?

Manage resources (no billing):

PermissionAllowed
Manage billingNo
Delete workspaceNo
Manage membersYes
Manage machinesYes
Access sessionsYes
Create API keysYes

What can a Member do?

Day-to-day usage:

PermissionAllowed
Manage billingNo
Delete workspaceNo
Manage membersNo
Manage machinesNo
Access sessionsYes
Create API keysYes (personal)

What can a Guest do?

Read-only access:

PermissionAllowed
Access sessionsObserver only
View machinesYes
Execute commandsNo
Create API keysNo

How do you create a workspace?

Via Dashboard

  1. Go to Settings -> Workspaces
  2. Click Create Workspace
  3. Enter name and slug
  4. Invite team members

Via CLI

# Create a new workspace with a URL-safe slug cmdop workspace create "My Workspace" --slug my-workspace # Set the active workspace for subsequent CLI commands cmdop workspace use my-workspace # Show all workspaces you belong to cmdop workspace list

How do you invite members?

Via Dashboard

  1. Go to Settings -> Team
  2. Click Invite Member
  3. Enter email and select role
  4. Send invitation

Via API

# Send an invitation email with assigned role to a new team member await client.workspace.invite( email="[email protected]", role="member" )

How does machine registration work?

When an agent connects, it registers to the workspace from its OAuth token:

How is hostname uniqueness enforced?

Hostnames are unique within a workspace:

# Hostnames must be unique per workspace; duplicates are rejected Workspace: "acme-corp" β”œβ”€β”€ web-1 βœ… (unique) β”œβ”€β”€ web-2 βœ… (unique) └── web-1 ❌ (duplicate, rejected) # Different workspaces can reuse the same hostname Workspace: "globex" β”œβ”€β”€ web-1 βœ… (unique in this workspace)

How do API keys work?

What are personal API keys?

Tied to a user, scoped to workspace:

# Generate a personal API key named "my-laptop" for the current workspace cmdop auth create-key --name "my-laptop" # Key format: cmd_<workspace>_<random> # Example: cmd_acme_a1b2c3d4e5f6...

What are workspace API keys?

Shared across team (admin creates):

# Generate a shared workspace-level key (requires admin role) cmdop auth create-key --workspace --name "ci-cd"

How do you use API keys?

# The API key determines which workspace the client can access client = AsyncCMDOPClient.remote(api_key="cmd_acme_xxx") # Success: web-1 exists in the acme workspace session = await client.terminal.get_active_session("web-1") # Error: globex-server is not in the acme workspace β€” access denied session = await client.terminal.get_active_session("globex-server")

How do you switch workspaces?

CLI

# List all workspaces your account belongs to cmdop workspace list # Change the active workspace for CLI commands cmdop workspace use my-workspace # Display the currently active workspace cmdop workspace current

SDK

# In the SDK, the API key determines the workspace automatically # To switch workspaces, instantiate a client with a different key acme_client = AsyncCMDOPClient.remote(api_key="cmd_acme_xxx") globex_client = AsyncCMDOPClient.remote(api_key="cmd_globex_yyy")

What are the best practices for workspaces?

1. One Workspace Per Team/Environment

# Separate workspaces by environment for clear isolation Company Structure: β”œβ”€β”€ acme-production # Prod servers β”œβ”€β”€ acme-staging # Staging environment └── acme-development # Dev machines Each team/environment gets isolated workspace.

2. Use Role-Based Access

# Assign roles matching each person's responsibility level Production Workspace: β”œβ”€β”€ Owners: [email protected] β”œβ”€β”€ Admins: senior-devs β”œβ”€β”€ Members: all developers └── Guests: auditors (read-only)

3. Separate Personal and CI Keys

# Keep personal and automation keys separate for easy revocation Personal keys: cmd_acme_alice_xxx CI/CD keys: cmd_acme_cicd_xxx Revoke personal key if laptop stolen. CI key stays active.

4. Audit Regularly

# Review who has access to the workspace cmdop workspace members # List all API keys (check for unused or stale keys) cmdop auth list-keys # View audit trail for the last 30 days cmdop audit list --days 30

How does multi-workspace access work?

Users can belong to multiple workspaces:

# A single user account can have different roles in different workspaces [email protected] β”œβ”€β”€ Member of: acme-production β”œβ”€β”€ Admin of: acme-staging └── Owner of: alice-personal # Alice can switch between workspaces # Different permissions in each

What are the workspace limits?

ResourceLimit
Machines per workspacePlan-dependent
Members per workspacePlan-dependent
API keys per user10
Sessions per machine1 active

How do you delete a workspace?

Only owners can delete:

# Permanently delete a workspace and all its data (owner only) cmdop workspace delete my-workspace --confirm # This deletes: # - All machines # - All sessions # - All API keys # - All audit logs # - Member associations (not user accounts)

Next

Last updated on