# Spaces

import Screenshot from "@docs/Screenshot.astro"
import Video from "@docs/Video.astro"
import SurfaceTabs from "@docs/SurfaceTabs.astro"
import AskRen from "@docs/AskRen.astro"

A space is a group of projects for a team or client. It controls access to their work and credentials, and all its projects run on one machine.

The app lists spaces under **Teams** in the sidebar. In the API and CLI, a space is a `pod`.

## Your default spaces

You start with two spaces:

- **Personal:** your private space. Only you can see its projects, chats, and tasks. It comes with a project named **Default**, and Slack DMs to Ren run there.
- **General:** one shared space per organization. Every member is added to it when they join, so use it for work the whole company shares.

<Screenshot shot="spaces/scope-picker" alt="The space picker listing Personal, General, and one team space" />

## Space or project?

Create a space when work needs different members, tool accounts, or a machine. For example, separate client spaces keep each client's work and accounts accessible only to that client's team.

Create a [project](/docs/concepts/projects/) when the members and machine stay the same but the work needs different instructions or tools. For example, Code review and Incident triage can share an Engineering space while using different instructions and apps.

## Create a space

You need a name. Everything else is optional or has a default.

<SurfaceTabs>
<Fragment slot="app">

1. Select **Teams** in the sidebar, then select **New team**. Organization admins and owners select **Create or join a team** (**+**), then **Create team**.
2. Enter a **Name**. You can also pick an icon and add a **Description**.
3. Under **Visibility**, choose **Organization** for a shared space, or **Private** for a space only you can use. Select **Continue**.
4. Pick the machine the space runs on. **Medium** (2 vCPUs, 2 GB) is selected by default. Choose a larger size for heavy work, or a custom [environment](/docs/concepts/environments/).
5. For a shared space, add members and choose each one's role. You join as owner.
6. Review the details and select **Create team**.

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Create a space called Acme for our Acme client work, and add Priya and Jordan as members." />

</Fragment>
<Fragment slot="cli">

```sh
ren pods create --name "Acme" --description "Acme client work"
```

</Fragment>
</SurfaceTabs>

Ren creates the space with a project named after it, like **Acme project**, and starts its machine.

<Video
  clip="spaces/create-space"
  title="Creating a team from New team through the Environment step's machine sizes to Create team"
/>

To archive a space, open it, select **Team actions** (**⋯**), and select **Archive team**. The space and its projects leave your organization, and only the API can restore them. You can't archive General or Personal spaces.

## Members

**Owner** and **Member** have the same access within a space. Both can use its resources, manage members, and change settings. Personal spaces have no **Members** tab.

Only people in your organization can join a space. Removing someone from a space doesn't remove them from the organization.

You can also add someone you've [invited to the organization](/docs/concepts/organizations/#invite-a-teammate) before they accept. They get no access until they accept. When they do, they join the space with the role you chose. The assignment stays if the invitation expires or you resend it.

<SurfaceTabs>
<Fragment slot="app">

1. Open the space from **Teams**, then open the **Members** tab.
2. Select **Add member**, pick a person, choose a role, and select **Add member**.
3. To remove someone, select **Remove** on their row.

Invited people appear in the members list by email, marked **Pending**, **Invite expired**, or **No active invite**. Removing one means they won't join the space when they accept.

<Screenshot
  shot="spaces/add-member"
  frame="detail"
  alt="The Add member dialog with a person selected and the Member role"
/>

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Add Alex Rivera to the Engineering space." />

</Fragment>
<Fragment slot="cli">

```sh
ren pods members add <space-id> --user-id <user-id>
ren pods members remove <space-id> <user-id>
```

</Fragment>
</SurfaceTabs>

### Join a shared space

Organization admins and owners can add themselves to any shared space in the organization. Being an admin doesn't show you a space's work until you join it. You join with the **Member** role. Private spaces can't be joined.

<SurfaceTabs>
<Fragment slot="app">

1. Select **Teams** in the sidebar, then select **Create or join a team** (**+**).
2. Select **Join team**. The list shows the shared spaces you aren't in yet.
3. Search for the space, select it, then select **Join team**.

Ren opens the space once you've joined.

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Add me to the Finance space." />

</Fragment>
</SurfaceTabs>

## Instructions and default model

Space instructions apply to every chat in the space. Ren reads them after organization instructions and before project instructions. See [how instructions combine](/docs/concepts/projects/#instructions).

The space's default model applies to every project in the space that doesn't set its own, and overrides the organization's default model.

<SurfaceTabs>
<Fragment slot="app">

- Open the space's **Instructions** tab to edit its instructions.
- Open the **Overview** tab and choose a **Default model**. You can also edit the icon, name, and description there.

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Add an instruction to the Engineering space: every pull request description needs a testing section." />

</Fragment>
<Fragment slot="cli">

```sh
ren pods update <space-id> --instructions "Every pull request description needs a testing section."
```

</Fragment>
</SurfaceTabs>

## Environment

Every space has one machine, and all of its projects and chats share it. The machine pauses when nobody is using it and resumes when the next chat starts.

To change the machine, open the space's **Environment** tab and select **Change**. Choose another size or a custom environment. See [Environments](/docs/concepts/environments/) for what a custom environment can install and when a change takes effect.

## Usage

The space's **Usage** tab shows what the space's chats have cost. Switch between **Spend** and **LLM calls**, choose the last 7, 30, or 90 days, and open **Per session** to see the cost of each chat.

## Credentials

A shared space has its own credentials, like a client's ad account or a team's GitHub token. Only members of the space can use them, and every project in the space can use them. Manage them in **Settings → Credentials**.

Your personal space has no separate credentials. It uses your personal credentials first, then credentials from your shared spaces, then organization credentials. See [Which credential Ren uses](/docs/concepts/credentials/#which-credential-ren-uses) for the full lookup order.