> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sfcompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces

> Group resources to isolate teams or environments

A workspace groups resources within an organization. Pools, instances, instance templates,
images, subnets, and tags all belong to a workspace. Every new organization comes with
a workspace named `default`. It's not special: you can rename it through the
[API](https://docs.sfcompute.com/api-reference/workspaces/update-workspace.md) or delete it like any other workspace.

## Create a workspace

Workspace names are unique within your organization.

```bash theme={null}
sf workspaces create --name production
```

## List workspaces

The arrow in the leftmost column marks the active workspace.

```bash theme={null}
sf workspaces list
```

```text theme={null}
-----------------------------
  NAME        CREATED
  default     Mar 1, 12:00am
→ production  Jun 15, 12:00am
  staging     Jun 15, 12:00am
```

## View a workspace

Get a workspace by name, or omit the name to get your active workspace.

```bash theme={null}
sf workspaces get production
```

```text theme={null}
| WORKSPACE      production
| ID             wksp_8fJq2LpXw4RkT7vY3mN5c
| RESOURCE PATH  sfc:workspace:acme:production
| CREATED        Jun 15, 12:00am PDT
```

## Set your active workspace

If you haven't set an active workspace, the CLI falls back to `default`. Set one with
`sf workspaces use <name>`. Override per-command with `--workspace <name>`.

```bash theme={null}
sf workspaces use production
sf instances list --workspace staging   # one-off override
```

## Every request targets a workspace

Every API request that creates, lists, or operates on workspace-scoped resources targets a
workspace. Not all resources are workspace-scoped; see [resource paths](https://docs.sfcompute.com/preview/resource-paths.md) for
which resources live at which scope.

* Creating resources: include `"workspace"` in the request body. Resources created on a pool
  (instances and orders) are the exception. They inherit the pool's workspace, so you
  choose the workspace when you create the pool.
* Listing resources: pass `?workspace=` as a query parameter.
* Getting a single resource: use a [resource path](https://docs.sfcompute.com/preview/resource-paths.md) or an ID.

On the CLI, pass `--workspace`.

```bash theme={null}
# Create a pool in a specific workspace. Instances created on this pool
# inherit its workspace.
sf pools create --name training-cluster --workspace production

# List instances in a workspace
sf instances list --workspace production
```

## Cross-workspace references with resource paths

Every resource has a [resource path](https://docs.sfcompute.com/preview/resource-paths.md) that embeds the workspace. Use a
resource path anywhere you can pass a name or ID. It lets you reference resources in another
workspace without switching context.

```bash theme={null}
# Create an instance on a pool in the `shared` workspace without switching
# your active workspace. The instance is created in `shared`, since an
# instance inherits its pool's workspace.
sf instances create --pool sfc:pool:acme:shared:training-pool \
  --image sfc:image:sfcompute:public:ubuntu-24.04-cuda-13.2 \
  --cloud-init ./startup.sh \
  --sku sku_4UpxzQw7A8N
```

## Delete a workspace

Deletion fails if the workspace still contains pools, instance templates, images, subnets, or custom
firewalls. Move or delete them first.

```bash theme={null}
sf workspaces delete staging
```

## API reference

See the [Workspaces API](https://docs.sfcompute.com/api-reference/workspaces/list-workspaces.md) for programmatic
access.
