Skip to content

Workspace Commands - Discover Bitbucket Workspaces

Discover and inspect Bitbucket Cloud workspaces. Use these commands to find the workspace slugs you need for -w, --workspace, for bb config set defaultWorkspace, and for bb repo create.

Workspace commands operate at account scope: bb workspace list needs no workspace context at all (it lists your own workspaces), while bb workspace view falls back to the resolved workspace context when no slug is passed.

Global options available on all workspace commands: --json [fields], --jq <expression>, --no-color, -w, --workspace.


List the workspaces the authenticated user has access to.

Terminal window
bb workspace list [options]
OptionDescription
--role <role>Filter by your role: owner, collaborator, or member
--limit <number>Maximum number of workspaces (default: 25)
--allList all workspaces (overrides --limit)
--jsonOutput as JSON
Terminal window
bb workspace list
bb workspace list --role owner
bb workspace list --all
# Project to specific fields (returns a flat array)
bb workspace list --json slug,name
# Grab slugs for scripting with built-in --jq
bb workspace list --json --jq '.workspaces[].slug'

The --json envelope is { filters, count, workspaces }, where workspaces is the array of workspace objects and filters echoes the active --role filter (empty object when unfiltered).

  • Requires no workspace context — this is the discovery entry point when you do not know your slugs yet.
  • After listing, use a slug with -w <slug> on any command, or set a default once: bb config set defaultWorkspace <slug>.
  • Role semantics: owner = admin access, collaborator = write access to at least one repository, member = member of at least one group or repository.
  • When the result is capped by --limit, a hint shows how many were listed; use a higher --limit or --all to see the rest (suppressed with --json).

View workspace details.

Terminal window
bb workspace view [slug] [options]
ArgumentDescription
slugWorkspace slug (optional; defaults to the resolved workspace context)
OptionDescription
-w, --workspace <workspace>Workspace (used when no slug argument is passed)
--jsonOutput as JSON
Terminal window
# View the current workspace (from -w, the current repo's remote,
# BB_WORKSPACE, or defaultWorkspace)
bb workspace view
bb workspace view my-workspace
# Stable JSON envelope: { workspace: { ... } }
bb workspace view my-workspace --json --jq '.workspace.uuid'
  • Without a slug, the workspace is resolved like any other command: -w flag, then the current repository’s Bitbucket remote, then the BB_WORKSPACE environment variable, then the configured defaultWorkspace.
  • A missing or inaccessible workspace returns a clear not-found error (exit code 1, --json gives a structured error envelope).