# Cloud environment

> Install tools, add API keys, and clone repos into every cloud sandbox with a setup script.

Source: https://www.cloudroom.dev/docs/cloud-environment

Settings → Cloud environment sets up every cloud sandbox you start: API keys, GitHub repos, MCP servers, and a setup script that installs your tools.

## Already installed

Every sandbox is Linux with `apt` and `sudo`. It comes with Node.js, Python 3, Git, the GitHub CLI, and every supported agent. Install anything else with the setup script.

## Setup script

The setup script is a Bash script that runs once in each new cloud sandbox, in the background, as the agent. `sudo` works.

- Saving it sends it to awake sandboxes right away. Sleeping sandboxes run it when they wake.
- If it fails, it runs again on the next wake, up to 3 times. Print `setup-failed: NAME` to mark a step as failed.
- Its output is in `/var/log/cloudroom/setup.log`.
- It can be up to 20,000 characters.
- Click a CLI above the script, like `stripe` or `uv`, to add tested install lines for it. Only CLIs found on your Mac are shown.

Write each step so it skips work that's already done:

```sh
command -v mise >/dev/null || curl -fsSL https://mise.run | sh
command -v mise >/dev/null || echo "setup-failed: mise"
```

> **Note:** The script starts when the sandbox does. On a brand-new sandbox, an agent can start before a slow install finishes. Fast installs like the one above finish first.

## Where tools must go

Agents only find commands in these folders:

- `/usr/local/bin`, `/usr/bin`, and `/bin`
- `~/.local/bin`, `~/.cargo/bin`, and `~/go/bin`

Agents don't read `~/.bashrc`, and an API key named `PATH` is ignored. So install tools into one of these folders, or link them there:

```sh
sudo ln -sf /opt/mytool/bin/mytool /usr/local/bin/mytool
```

Version managers like `mise` install into `~/.local/bin`, so agents find `mise` itself. The tools it manages aren't on that list, so agents run them through it, like `mise exec -- bundle exec rspec`.

## API keys

Every cloud agent gets your API keys as environment variables. They are stored encrypted and written fresh each time a sandbox wakes.

## Repos and MCP servers

- GitHub repos you add are cloned into `/repos` in every sandbox, next to the project.
- MCP servers you pick from your Mac are added to Claude Code and Codex in every sandbox.

## Ask your agent

You don't have to edit this by hand. Ask any agent something like "install mise in my cloud sandboxes". It reads your setup with `room-cli cloud env list` and saves a new script with `room-cli cloud setup set`. Cloud agents do this through Mac access, so it must be on.
