---
description: Use a durable Cloudflare Workspace with code-oriented agent operations.
---

# Cloudflare Shell

AI-generated, awaiting review [ View as Markdown](https://flueframework.com/docs/ecosystem/sandboxes/cloudflare-shell/index.md) 

The Cloudflare Shell connector adapts an application-owned `@cloudflare/shell` `Workspace` into a Flue sandbox on the Cloudflare target. Unlike a Linux shell sandbox, it provides a durable workspace and a model-facing `code` tool that executes JavaScript against workspace state through a Worker Loader binding.

## Add the connector

```
pnpm exec flue add cloudflare-shell
```

Import the generated helpers from your project connector file, not from `@flue/runtime/cloudflare`:

```
import { getDefaultWorkspace, getShellSandbox } from '../connectors/cloudflare-shell';
```

## Requirements

| Requirement             | Value                                      |
| ----------------------- | ------------------------------------------ |
| Target                  | Cloudflare                                 |
| Provider packages       | @cloudflare/shell and @cloudflare/codemode |
| Platform configuration  | A worker\_loaders binding such as LOADER   |
| Model-facing capability | code tool operating on Workspace state     |
| Ordinary shell          | Not provided by this connector             |

## Choose this connector when

Use Cloudflare Shell when files must be stored in a durable Workspace and agent work can be expressed through Workspace operations. It is not interchangeable with a container: `harness.shell(...)` and `session.shell(...)` do not provide Linux command execution through this connector.

If the workspace should survive later user interactions, associate it with a stable addressable agent instance. A workspace created inside one workflow invocation belongs to that invocation’s owner rather than forming a shared cross-run workspace.

You can hydrate content from R2 through the generated connector helper before initializing the consuming harness. Hydration is a copy into Workspace, not a live-mounted bucket.

See [Sandboxes](https://flueframework.com/docs/guide/sandboxes/) and [Deploy on Cloudflare](https://flueframework.com/docs/ecosystem/deploy/cloudflare/).

## Docs Navigation

Current page: [Cloudflare Shell](https://flueframework.com/docs/ecosystem/sandboxes/cloudflare-shell/)

### Sections

* [Guide](https://flueframework.com/docs/getting-started/quickstart/)
* [Reference](https://flueframework.com/docs/api/agent-api/)
* [CLI](https://flueframework.com/docs/cli/overview/)
* [SDK](https://flueframework.com/docs/sdk/overview/)
* [Ecosystem](https://flueframework.com/docs/ecosystem/overview/)

### Ecosystem

* [ Overview ](https://flueframework.com/docs/ecosystem/overview/)

### Deployment

* [ Cloudflare ](https://flueframework.com/docs/ecosystem/deploy/cloudflare/)
* [ GitHub Actions ](https://flueframework.com/docs/ecosystem/deploy/github-actions/)
* [ GitLab CI/CD ](https://flueframework.com/docs/ecosystem/deploy/gitlab-ci/)
* [ Node.js ](https://flueframework.com/docs/ecosystem/deploy/node/)
* [ Render ](https://flueframework.com/docs/ecosystem/deploy/render/)

### Sandboxes

* [ boxd ](https://flueframework.com/docs/ecosystem/sandboxes/boxd/)
* [ Cloudflare Shell ](https://flueframework.com/docs/ecosystem/sandboxes/cloudflare-shell/)
* [ Cloudflare Sandbox ](https://flueframework.com/docs/ecosystem/sandboxes/cloudflare/)
* [ Daytona ](https://flueframework.com/docs/ecosystem/sandboxes/daytona/)
* [ E2B ](https://flueframework.com/docs/ecosystem/sandboxes/e2b/)
* [ exe.dev ](https://flueframework.com/docs/ecosystem/sandboxes/exedev/)
* [ islo ](https://flueframework.com/docs/ecosystem/sandboxes/islo/)
* [ Mirage ](https://flueframework.com/docs/ecosystem/sandboxes/mirage/)
* [ Modal ](https://flueframework.com/docs/ecosystem/sandboxes/modal/)
* [ smolvm ](https://flueframework.com/docs/ecosystem/sandboxes/smolvm/)
* [ Superserve ](https://flueframework.com/docs/ecosystem/sandboxes/superserve/)
* [ Vercel Sandbox ](https://flueframework.com/docs/ecosystem/sandboxes/vercel/)