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

# Sandbox

> Test changes in a separate database environment before promoting to your workspace

The sandbox is a separate database environment on your Instance where you can push and test changes without affecting your live workspace. Once you're satisfied, review the changes in the browser and promote them to your workspace manually.

> [!NOTE]
>
> Sandbox commands operate on your personal sandbox environment, which is tied to your profile. You don't need to specify a workspace or tenant — the CLI manages this automatically.

> [!TIP]
>
> Your sandbox is a single, personal environment that persists until you [reset](#reset) or [delete](#delete) it. When you need **several** disposable environments at once, or one that tears itself down automatically, use [ephemeral tenants](https://docs.xano.com/xano-cli/ephemeral.md) instead.

## Get Your Sandbox

Terminal

```bash theme={null}
xano sandbox get
```

This returns your sandbox details. If you don't have one yet, it creates one automatically. Use `-o json` for the full JSON response.

***

## Pull & Push

The sandbox supports the same pull and push workflow as [workspace pull & push](https://docs.xano.com/xano-cli/push-pull.md), using the [multidoc](https://docs.xano.com/xanoscript/multidoc.md) format behind the scenes.

### Pull from Sandbox

Terminal

```bash theme={null}
xano sandbox pull -d ./my-sandbox
```

| Flag | Description |
| - | - |
| `--env` | Include environment variables |
| `--records` | Include database records |
| `--draft` | Include draft versions of resources |

### Push to Sandbox

By default, only changed files are pushed (partial mode). Like [workspace push](https://docs.xano.com/xano-cli/push-pull.md#push), sandbox push runs a [preview](https://docs.xano.com/xano-cli/push-pull.md#push-preview) and prompts for confirmation before applying anything.

Terminal

```bash theme={null}
xano sandbox push -d ./my-sandbox
xano sandbox push -d ./my-sandbox --dry-run    # preview without applying
xano sandbox push -d ./my-sandbox --sync       # full push — send all files
xano sandbox push -d ./my-sandbox --review     # push, then open review in the browser
```

| Flag | Description |
| - | - |
| `--sync` | Full push — send all files, not just changed ones (required for `--delete`) |
| `--delete` | Delete sandbox objects not present locally (requires `--sync`) |
| `--records` | Include database records in import |
| `--env` | Include environment variables in import |
| `--dry-run` | Show the push preview, then exit without applying |
| `--force` | Skip the preview and confirmation prompt |
| `--no-guids` | Skip writing server-assigned GUIDs back to local files |
| `--no-transaction` | Skip wrapping the import in a database transaction |
| `--truncate` | Truncate all table records before importing |
| `--review` | Open the sandbox review in your browser after pushing |

> [!NOTE]
>
> Unlike `xano workspace push`, sandbox push does **not** support the `-i/--include` or `-e/--exclude` filters. Pushing only a subset of files can hide deletions during sandbox review, which risks dropping tables when the review is promoted to your workspace — so the sandbox always pushes the full set of changed files.

> [!NOTE]
>
> Objects bind by the `guid` embedded in each `.xs` file, not by file path or a numeric ID — so pushing updates existing objects in place instead of duplicating them. See [How objects are identified](https://docs.xano.com/xano-cli/push-pull.md#how-objects-are-identified-binding-local-to-remote).

#### Workspace mismatch guard

To catch the case where your local files belong to a *different* workspace than the one currently loaded on your sandbox, the CLI compares the workspace named in your local files against the sandbox's loaded workspace. If they differ and the push contains a significant number of changes (25 or more), it shows a **Workspace Mismatch** warning and asks you to confirm before continuing. Declining cancels the push and suggests running [`xano sandbox reset`](#reset) to clear the sandbox first.

In non-interactive environments (CI/CD, piped output), a mismatch causes the command to error unless you pass `--force`.

> [!TIP]
>
> This is the recommended way to deploy changes to tenants. Instead of pushing directly to a tenant (which is not supported), push to your sandbox first, review the changes, then promote them.

***

## Review & Promote

Open your sandbox in the browser to review changes and promote them to the workspace:

Terminal

```bash theme={null}
xano sandbox review
```

To get the URL without opening the browser (useful for scripting):

Terminal

```bash theme={null}
xano sandbox review --url-only
```

If your instance uses a self-signed TLS certificate, add `--insecure` (`-k`) to skip certificate verification for this command — mirroring `xano auth --insecure`:

Terminal

```bash theme={null}
xano sandbox review --insecure
```

> [!WARNING]
>
> `--insecure` disables TLS certificate verification, which exposes the connection to man-in-the-middle attacks. Use it only for one-off access against self-signed certificates in local development.

***

## Reset

Reset your sandbox to clear all workspace data and drafts, returning it to a clean state:

Terminal

```bash theme={null}
xano sandbox reset
```

Add `-f` to skip the confirmation prompt.

> [!WARNING]
>
> Resetting a sandbox clears all data and drafts. This cannot be undone.

***

## Delete

Delete your sandbox environment entirely. It will be re-created automatically the next time you access it.

Terminal

```bash theme={null}
xano sandbox delete
```

Add `-f` to skip the confirmation prompt.

***

## Environment Variables

Manage environment variables on your sandbox, just like [tenant environment variables](https://docs.xano.com/xano-cli/tenants.md#tenant-environment-variables).

### List Env Var Keys

Terminal

```bash theme={null}
xano sandbox env list
```

### Get a Single Env Var

Terminal

```bash theme={null}
xano sandbox env get --name DATABASE_URL
```

### Set an Env Var

Terminal

```bash theme={null}
xano sandbox env set --name DATABASE_URL --value "postgres://..."
```

### Delete an Env Var

Terminal

```bash theme={null}
xano sandbox env delete --name DATABASE_URL
```

### Export All Env Vars

Export all environment variables to a YAML file:

Terminal

```bash theme={null}
xano sandbox env get_all
xano sandbox env get_all --file ./env.yaml
xano sandbox env get_all --view
```

### Import All Env Vars

Import environment variables from a YAML file (replaces existing):

Terminal

```bash theme={null}
xano sandbox env set_all
xano sandbox env set_all --file ./env.yaml --clean
```

***

## Sandbox License

Terminal

```bash theme={null}
# Get sandbox license (saves to file by default)
xano sandbox license get
xano sandbox license get --view

# Set sandbox license from file
xano sandbox license set --file ./license.yaml
xano sandbox license set --value "inline-license-content"
```

***

## Sandbox Tests

Run unit tests and workflow tests against your sandbox environment.

### Unit Tests

Terminal

```bash theme={null}
# List unit tests
xano sandbox unit_test list

# Run a single unit test
xano sandbox unit_test run UNIT_TEST_ID

# Run all unit tests
xano sandbox unit_test run_all
```

Filter by branch or object type:

Terminal

```bash theme={null}
xano sandbox unit_test list --branch dev --obj-type function
xano sandbox unit_test run_all --branch dev --obj-type function
```

### Workflow Tests

Terminal

```bash theme={null}
# List workflow tests
xano sandbox workflow_test list

# Run a single workflow test
xano sandbox workflow_test run TEST_ID

# Run all workflow tests
xano sandbox workflow_test run_all
```

Filter by branch with `-b`:

Terminal

```bash theme={null}
xano sandbox workflow_test list -b dev
xano sandbox workflow_test run_all -b dev
```

***

## Typical Workflow

A common pattern for deploying changes through the sandbox:

**1. Pull your workspace**

Terminal

```bash theme={null}
xano workspace pull -d ./my-workspace
```

**2. Make changes locally**

Edit `.xs` files in your editor or with AI tools.

**3. Push to your sandbox**

Terminal

```bash theme={null}
xano sandbox push -d ./my-workspace
```

**4. Test in the sandbox**

Review and test your changes in the sandbox environment.

**5. Promote to your workspace**

Open the sandbox in the browser to review and promote:

Terminal

```bash theme={null}
xano sandbox review
```


## Related topics

- [Sandbox Testing](https://docs.xano.com/testing-debugging/sandbox.md)
- [Cheat Sheet](https://docs.xano.com/xano-cli/cheatsheet.md)
- [Command Reference](https://docs.xano.com/xano-cli/command-reference.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.