> ## 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.

# Command Reference

> Complete reference of all Xano CLI commands and flags

export const BrowserFrame = props => {
  const {url = "xano.run", maxWidth = 820, className = "", lightSrc, darkSrc, alt = "", children} = props || ({});
  const style = typeof maxWidth === "number" ? {
    maxWidth: `${maxWidth}px`,
    margin: "16px 0"
  } : {
    maxWidth,
    margin: "16px 0"
  };
  const hasSwapImages = Boolean(lightSrc && darkSrc);
  return <div className={`browser-frame ${className}`.trim()} style={style}>
      <div className="browser-frame__top">
        <div className="browser-frame__controls" aria-hidden="true">
          <span className="browser-frame__dot browser-frame__dot--red" />
          <span className="browser-frame__dot browser-frame__dot--yellow" />
          <span className="browser-frame__dot browser-frame__dot--green" />
        </div>
        <div className="browser-frame__address">{url}</div>
      </div>

      <div className="browser-frame__body">
        {hasSwapImages ? <>
            <img className="browser-frame__img--light" src={lightSrc} alt={alt} />
            <img className="browser-frame__img--dark" src={darkSrc} alt={alt} />
          </> : children}
      </div>
    </div>;
};

This page lists every Xano CLI command with its flags and usage. For detailed guides on each topic, see the linked pages.

## Global Flags

These flags are available on **all** commands:

| Flag            | Env Variable   | Description                                                        |
| --------------- | -------------- | ------------------------------------------------------------------ |
| `-p, --profile` | `XANO_PROFILE` | Use a specific profile instead of the default                      |
| `-c, --config`  | `XANO_CONFIG`  | Path to the credentials file (default: `~/.xano/credentials.yaml`) |
| `-v, --verbose` | `XANO_VERBOSE` | Show HTTP request/response details for troubleshooting             |

<Note>
  Profile selection follows this precedence: `-p/--profile` > `XANO_PROFILE` > a project-local [`profile.yaml`](/xano-cli/profiles#project-local-profile) > the default profile in the credentials file.
</Note>

***

## `xano auth`

Browser-based authentication. Opens your browser to log in and creates a profile.

```bash theme={null}
xano auth
xano auth -o https://my-xano.my-domain.com
xano auth -o https://my-xano.my-domain.com --insecure
```

| Flag             | Description                                                 |
| ---------------- | ----------------------------------------------------------- |
| `-o, --origin`   | Account/environment URL (for self-hosted or non-production) |
| `-k, --insecure` | Skip TLS certificate verification                           |

See [Get Started — Authentication](/xano-cli/get-started#authentication).

***

## `xano update`

Update the CLI to the latest version.

```bash theme={null}
xano update
xano update --check
xano update --beta
```

| Flag      | Description                          |
| --------- | ------------------------------------ |
| `--check` | Check for updates without installing |
| `--beta`  | Update to the latest beta version    |

***

## `xano profile`

Manage CLI profiles. See [Profiles](/xano-cli/profiles) for full documentation.

| Command                      | Description                                                                                            |
| ---------------------------- | ------------------------------------------------------------------------------------------------------ |
| `xano profile wizard`        | Interactive token-based profile setup                                                                  |
| `xano profile create <name>` | Create a profile non-interactively                                                                     |
| `xano profile edit <name>`   | Update fields on an existing profile                                                                   |
| `xano profile use <name>`    | Pin a profile for the current project via a [`profile.yaml`](/xano-cli/profiles#project-local-profile) |
| `xano profile list`          | List all profiles (`-d` for details)                                                                   |
| `xano profile get`           | Print the default profile name                                                                         |
| `xano profile set <name>`    | Set the default profile                                                                                |
| `xano profile me`            | Verify the current profile against the Xano API                                                        |
| `xano profile token`         | Print the access token for the default profile                                                         |
| `xano profile workspace`     | Print the workspace ID for the default profile                                                         |
| `xano profile workspace set` | Interactively change the workspace on a profile                                                        |
| `xano profile delete <name>` | Delete a profile (`-f` to skip confirmation)                                                           |

### `xano profile wizard`

```bash theme={null}
xano profile wizard
xano profile wizard -n production -o https://my-xano.my-domain.com
```

| Flag             | Description                       |
| ---------------- | --------------------------------- |
| `-n`             | Profile name                      |
| `-o`             | Account/environment origin URL    |
| `-k, --insecure` | Skip TLS certificate verification |

### `xano profile create`

```bash theme={null}
xano profile create my-profile -t TOKEN -i https://instance.xano.io -w WORKSPACE_ID -b BRANCH --default
```

| Flag             | Description                          |
| ---------------- | ------------------------------------ |
| `-t`             | Access token (required)              |
| `-i`             | Instance origin URL (required)       |
| `-a`             | Account origin URL (for self-hosted) |
| `-w`             | Workspace ID                         |
| `-b`             | Branch label                         |
| `-k, --insecure` | Skip TLS certificate verification    |
| `--default`      | Set as the default profile           |

### `xano profile edit`

```bash theme={null}
xano profile edit my-profile -w NEW_WORKSPACE_ID
xano profile edit my-profile --remove-branch
xano profile edit my-profile --insecure
```

| Flag                 | Description           |
| -------------------- | --------------------- |
| `-t`                 | Access token          |
| `-i`                 | Instance origin URL   |
| `-a`                 | Account origin URL    |
| `-w`                 | Workspace ID          |
| `-b`                 | Branch label          |
| `--insecure`         | Enable insecure mode  |
| `--remove-branch`    | Clear the branch      |
| `--remove-insecure`  | Disable insecure mode |
| `--remove-workspace` | Clear the workspace   |
| `--default`          | Set as default        |

### `xano profile use`

Pin the current project to a profile by writing a [project-local `profile.yaml`](/xano-cli/profiles#project-local-profile). The file holds no secrets — it references a profile by name. Precedence: `-p/--profile` > `XANO_PROFILE` > `profile.yaml` > default profile.

```bash theme={null}
xano profile use staging
xano profile use staging -w 110 --gitignore
```

| Flag                             | Description                                                           |
| -------------------------------- | --------------------------------------------------------------------- |
| `-w, --workspace`                | Override the workspace for this project                               |
| `-b, --branch`                   | Override the branch for this project                                  |
| `-i, --instance_origin`          | Override the instance origin URL                                      |
| `-a, --account_origin`           | Override the account origin URL                                       |
| `--gitignore` / `--no-gitignore` | Add (or skip adding) `profile.yaml` to `.gitignore` without prompting |

***

## `xano workspace`

Manage workspaces. See [Workspaces & Branches](/xano-cli/workspaces-and-branches) for full documentation.

| Command                         | Description                                                                            |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| `xano workspace list`           | List all workspaces (`--latest` to sort newest first)                                  |
| `xano workspace get`            | Get workspace details (use `-w` to override profile workspace)                         |
| `xano workspace create <name>`  | Create a workspace                                                                     |
| `xano workspace edit`           | Edit a workspace (use `-w` to override profile workspace)                              |
| `xano workspace delete`         | Delete a workspace (use `-w` to override profile workspace; `-f` to skip confirmation) |
| `xano workspace pull <dir>`     | Pull workspace [multidoc](/xanoscript/multidoc) to local files                         |
| `xano workspace push <dir>`     | Push local files as [multidoc](/xanoscript/multidoc) to workspace                      |
| `xano workspace git pull <dir>` | Pull XanoScript from a Git repo                                                        |

### `xano workspace pull`

```bash theme={null}
xano workspace pull -d ./my-workspace
xano workspace pull -d ./my-workspace -b v2-feature --env --records --draft
```

| Flag        | Description                         |
| ----------- | ----------------------------------- |
| `-b`        | Branch name (overrides profile)     |
| `-w`        | Workspace ID (overrides profile)    |
| `--env`     | Include environment variables       |
| `--records` | Include database records            |
| `--draft`   | Include draft versions of resources |

See [Push & Pull — Pull](/xano-cli/push-pull#pull).

### `xano workspace push`

```bash theme={null}
xano workspace push -d ./my-workspace
xano workspace push -d ./my-workspace --dry-run
xano workspace push -d ./my-workspace --sync --delete --force
xano workspace push -d ./my-workspace -i "function/*"
xano workspace push -d ./my-workspace -i "function/*" -e "**/test*"
```

| Flag               | Description                                                                 |
| ------------------ | --------------------------------------------------------------------------- |
| `-b`               | Branch name (overrides profile)                                             |
| `-w`               | Workspace ID (overrides profile)                                            |
| `-i, --include`    | Glob pattern to include files (supports multiple `-i` flags)                |
| `-e, --exclude`    | Glob pattern to exclude files (supports multiple `-e` flags)                |
| `--sync`           | Full push — send all files, not just changed ones (required for `--delete`) |
| `--delete`         | Delete remote objects not present locally (requires `--sync`)               |
| `--records`        | Include table records                                                       |
| `--env`            | Include environment variables                                               |
| `--dry-run`        | Show preview then exit without applying                                     |
| `--force`          | Skip preview and confirmation prompt; override critical error blocking      |
| `--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                                 |

Objects bind by the embedded `guid`, not file path — see [How objects are identified](/xano-cli/push-pull#how-objects-are-identified-binding-local-to-remote). See also [Push & Pull — Push](/xano-cli/push-pull#push).

### `xano workspace git pull`

```bash theme={null}
xano workspace git pull -d ./output -r https://github.com/owner/repo
xano workspace git pull -d ./output -r https://github.com/owner/repo -b main --path src/
```

| Flag     | Description                             |
| -------- | --------------------------------------- |
| `-r`     | Git repository URL (required)           |
| `-b`     | Branch, tag, or ref                     |
| `-t`     | Personal access token for private repos |
| `--path` | Subdirectory within the repo            |

See [Push & Pull — Pull from Git](/xano-cli/push-pull#pull-from-git).

### `xano workspace create`

```bash theme={null}
xano workspace create "My Workspace" -d "Description"
```

| Flag | Description                        |
| ---- | ---------------------------------- |
| `-d` | Description                        |
| `-o` | Output format: `summary` or `json` |

### `xano workspace edit`

```bash theme={null}
xano workspace edit -n "New Name" -d "New description"
xano workspace edit -w WORKSPACE_ID -n "New Name" -d "New description"
xano workspace edit -w WORKSPACE_ID --swagger --require-token
```

Workspace ID falls back to your profile workspace when `-w` is omitted.

| Flag                                     | Description                                      |
| ---------------------------------------- | ------------------------------------------------ |
| `-w`                                     | Workspace ID (overrides profile)                 |
| `-n`                                     | Workspace name                                   |
| `-d`                                     | Description                                      |
| `--swagger` / `--no-swagger`             | Enable/disable Swagger                           |
| `--require-token` / `--no-require-token` | Enable/disable token requirement                 |
| `--allow-push` / `--no-allow-push`       | Enable/disable direct CLI push to this workspace |
| `-o`                                     | Output format: `summary` or `json`               |

***

## `xano branch`

Manage workspace branches. See [Workspaces & Branches](/xano-cli/workspaces-and-branches#branches) for full documentation.

| Command                        | Description                                                                                                     |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `xano branch list`             | List branches — backups hidden by default; `--backups` to include them (use `-w` to override profile workspace) |
| `xano branch get <label>`      | Get branch details                                                                                              |
| `xano branch create`           | Create a new branch                                                                                             |
| `xano branch edit <label>`     | Edit a branch                                                                                                   |
| `xano branch set_live <label>` | Promote a branch to live                                                                                        |
| `xano branch delete <label>`   | Delete a branch (`-f` to skip confirmation)                                                                     |

### `xano branch create`

```bash theme={null}
xano branch create v2-feature
xano branch create v3-hotfix -s v2-feature -d "Hotfix branch" -c "#FF5733"
```

| Argument / Flag | Description                                 |
| --------------- | ------------------------------------------- |
| `label`         | Branch label (required, positional)         |
| `-s`            | Source branch to clone from (default: `v1`) |
| `-d`            | Description                                 |
| `-c`            | Color hex code                              |
| `-w`            | Workspace ID                                |
| `-o`            | Output format: `summary` or `json`          |

### `xano branch edit`

```bash theme={null}
xano branch edit v2-feature -l v2-ready -d "Ready for review" -c "#00FF00"
```

| Flag | Description      |
| ---- | ---------------- |
| `-l` | New branch label |
| `-d` | Description      |
| `-c` | Color hex code   |

***

## `xano release`

Manage versioned releases. See [Releases](/xano-cli/releases) for full documentation.

| Command                      | Description                                                  |
| ---------------------------- | ------------------------------------------------------------ |
| `xano release list`          | List all releases                                            |
| `xano release get <name>`    | Get release details                                          |
| `xano release create <name>` | Create a release                                             |
| `xano release edit <name>`   | Edit a release                                               |
| `xano release delete <name>` | Delete a release (`-f` to skip confirmation)                 |
| `xano release export <name>` | Export release as `.tar.gz`                                  |
| `xano release import`        | Import a release file                                        |
| `xano release pull <dir>`    | Pull release as local XanoScript                             |
| `xano release push <dir>`    | Push local files as a new release                            |
| `xano release deploy <name>` | Deploy a release to a new branch (`-f` to skip confirmation) |

### `xano release create`

```bash theme={null}
xano release create "v1.0" -b v1 -d "Initial release"
xano release create "v1.1-hotfix" -b v1 --hotfix -d "Critical fix"
```

| Argument / Flag | Description                          |
| --------------- | ------------------------------------ |
| `name`          | Release name (required, positional)  |
| `-b`            | Branch to create from (required)     |
| `-d`            | Description                          |
| `--hotfix`      | Mark as a hotfix release             |
| `--table-ids`   | Comma-separated table IDs to include |
| `-w`            | Workspace ID                         |

### `xano release pull`

```bash theme={null}
xano release pull -d ./my-release -r v1.0
```

| Flag        | Description                   |
| ----------- | ----------------------------- |
| `-r`        | Release name (required)       |
| `--env`     | Include environment variables |
| `--records` | Include database records      |
| `-w`        | Workspace ID                  |

### `xano release push`

```bash theme={null}
xano release push -d ./my-release -n "v2.0"
```

| Flag           | Description                |
| -------------- | -------------------------- |
| `-n`           | Release name (required)    |
| `-d`           | Description                |
| `--hotfix`     | Mark as a hotfix release   |
| `--no-records` | Skip importing records     |
| `--no-env`     | Skip environment variables |
| `-w`           | Workspace ID               |

### `xano release export`

```bash theme={null}
xano release export v1.0
xano release export v1.0 --output ./backups/release.tar.gz
```

| Flag       | Description             |
| ---------- | ----------------------- |
| `--output` | Custom output file path |

### `xano release import`

```bash theme={null}
xano release import --file ./my-release.tar.gz
```

| Flag     | Description                               |
| -------- | ----------------------------------------- |
| `--file` | Path to release `.tar.gz` file (required) |

### `xano release deploy`

```bash theme={null}
xano release deploy "v1.0"
xano release deploy "v1.0" --force
xano release deploy "v1.0" -b "restore-v1" --set_live
xano release deploy "v1.0" -w 40 -o json --force
```

Prompts for confirmation before deploying. Use `-f` / `--force` to skip the prompt. `--set_live` is off by default — omit it to deploy without promoting the new branch.

| Flag          | Description                                                           |
| ------------- | --------------------------------------------------------------------- |
| `-b`          | Branch label for the new branch (defaults to the release branch name) |
| `--set_live`  | Set the new branch as live (default: off)                             |
| `-f, --force` | Skip the confirmation prompt                                          |
| `-w`          | Workspace ID                                                          |
| `-o`          | Output format: `summary` or `json`                                    |

***

## `xano tenant`

Manage tenants, deployments, and backups. See [Tenants](/xano-cli/tenants) for full documentation.

| Command                              | Description                                 |
| ------------------------------------ | ------------------------------------------- |
| `xano tenant list`                   | List all tenants                            |
| `xano tenant get <name>`             | Get tenant details                          |
| `xano tenant create <display>`       | Create a tenant                             |
| `xano tenant edit <name>`            | Edit a tenant                               |
| `xano tenant delete <name>`          | Delete a tenant (`-f` to skip confirmation) |
| `xano tenant impersonate <name>`     | Open tenant dashboard in browser            |
| `xano tenant pull <dir>`             | Pull tenant as local XanoScript             |
| `xano tenant deploy_release <name>`  | Deploy a release to a tenant                |
| `xano tenant deploy_platform <name>` | Deploy a platform to a tenant               |
| `xano tenant license get <name>`     | Get tenant license (`--file`, `--view`)     |
| `xano tenant license set <name>`     | Set tenant license (`--file`, `--value`)    |

### `xano tenant create`

```bash theme={null}
xano tenant create "My Tenant" --type tier2 --cluster_id 5
xano tenant create "My Tenant" --type tier2 --cluster_id 5 --license ./license.yaml
```

| Flag                       | Description                                              |
| -------------------------- | -------------------------------------------------------- |
| `-d`                       | Description                                              |
| `--type`                   | Tenant type: `tier1` (default), `tier2`, `tier3`         |
| `--cluster_id`             | Cluster ID (required for tier2/tier3)                    |
| `-l, --license`            | Path to a license override file to apply during creation |
| `--platform_id`            | Platform ID                                              |
| `--domain`                 | Custom domain                                            |
| `--ingress / --no-ingress` | Enable/disable ingress (default: enabled)                |
| `--tasks / --no-tasks`     | Enable/disable background tasks (default: enabled)       |
| `-w`                       | Workspace ID                                             |
| `-o`                       | Output format: `summary` or `json`                       |

### `xano tenant pull`

```bash theme={null}
xano tenant pull -d ./my-tenant -t TENANT_NAME
```

| Flag        | Description                   |
| ----------- | ----------------------------- |
| `-t`        | Tenant name (required)        |
| `--env`     | Include environment variables |
| `--records` | Include database records      |
| `--draft`   | Include draft versions        |
| `-w`        | Workspace ID                  |

### Tenant Environment Variables

| Command                                             | Description                                     |
| --------------------------------------------------- | ----------------------------------------------- |
| `xano tenant env list <name>`                       | List env var keys                               |
| `xano tenant env get <name> --name KEY`             | Get a single env var                            |
| `xano tenant env set <name> --name KEY --value VAL` | Set an env var                                  |
| `xano tenant env delete <name> --name KEY`          | Delete an env var                               |
| `xano tenant env get_all <name>`                    | Export all env vars (`--file` for YAML)         |
| `xano tenant env set_all <name>`                    | Import env vars from YAML (`--file`, `--clean`) |

### Tenant Backups

| Command                             | Description                                            |
| ----------------------------------- | ------------------------------------------------------ |
| `xano tenant backup list <name>`    | List backups (`--page` for pagination)                 |
| `xano tenant backup create <name>`  | Create a backup                                        |
| `xano tenant backup restore <name>` | Restore from backup (`--backup_id`, `-f`)              |
| `xano tenant backup export <name>`  | Export backup as `.tar.gz` (`--backup_id`, `--output`) |
| `xano tenant backup import <name>`  | Import a backup file (`--file`)                        |
| `xano tenant backup delete <name>`  | Delete a backup (`--backup_id`, `-f`)                  |

### Tenant Snapshots

Snapshots are instant clones of a tenant's database. Each command takes the tenant name as its positional argument and supports `-w` and `-o`.

| Command                              | Description                                                           |
| ------------------------------------ | --------------------------------------------------------------------- |
| `xano tenant snapshot create <name>` | Create a database snapshot (`-l, --label`)                            |
| `xano tenant snapshot list <name>`   | List a tenant's snapshots                                             |
| `xano tenant snapshot swap <name>`   | Repoint the tenant's live database to a snapshot (`--snapshot`, `-f`) |
| `xano tenant snapshot delete <name>` | Delete a snapshot (`--snapshot`, `-f`) — destructive                  |

#### `xano tenant snapshot create`

```bash theme={null}
xano tenant snapshot create t1234-abcd-xyz1 --label before-v2
xano tenant snapshot create t1234-abcd-xyz1 -l before-v2 -o json
```

| Flag          | Description                                                        |
| ------------- | ------------------------------------------------------------------ |
| `-l, --label` | Optional label appended to the snapshot description (alphanumeric) |
| `-w`          | Workspace ID                                                       |
| `-o`          | Output format: `summary` or `json`                                 |

The snapshot name returned looks like `t1234-abcd-xyz1_bk_20260603_203614` — you'll pass it to `swap` and `delete`.

#### `xano tenant snapshot list`

```bash theme={null}
xano tenant snapshot list t1234-abcd-xyz1
```

Snapshots are tagged `ORIGINAL` (the tenant's initial database) and `LIVE` (the database the tenant currently serves).

| Flag | Description                        |
| ---- | ---------------------------------- |
| `-w` | Workspace ID                       |
| `-o` | Output format: `summary` or `json` |

#### `xano tenant snapshot swap`

Repoints a tenant's live database to a snapshot. The current live database is **left untouched**, not deleted — so a swap is reversible.

<Warning>
  To roll back a swap, run `swap` again pointing `--snapshot` at the **original** tenant database name (the snapshot tagged `ORIGINAL` in `snapshot list`). The tenant name itself is the original database name, so `--snapshot <tenant_name>` restores the starting state.
</Warning>

```bash theme={null}
xano tenant snapshot swap t1234-abcd-xyz1 --snapshot t1234-abcd-xyz1_bk_20260603_203614
xano tenant snapshot swap t1234-abcd-xyz1 --snapshot t1234-abcd-xyz1 --force   # roll back
```

| Flag          | Description                                                                             |
| ------------- | --------------------------------------------------------------------------------------- |
| `--snapshot`  | Snapshot database name to swap to (required); use the original tenant name to roll back |
| `-f, --force` | Skip the confirmation prompt                                                            |
| `-w`          | Workspace ID                                                                            |
| `-o`          | Output format: `summary` or `json`                                                      |

#### `xano tenant snapshot delete`

<Warning>
  Deleting a snapshot permanently drops that snapshot database and cannot be undone. The live and original databases cannot be deleted. Without `-f` the command prompts for confirmation.
</Warning>

```bash theme={null}
xano tenant snapshot delete t1234-abcd-xyz1 --snapshot t1234-abcd-xyz1_bk_20260603_203614
xano tenant snapshot delete t1234-abcd-xyz1 --snapshot t1234-abcd-xyz1_bk_20260603_203614 --force
```

| Flag          | Description                                 |
| ------------- | ------------------------------------------- |
| `--snapshot`  | Snapshot database name to delete (required) |
| `-f, --force` | Skip the confirmation prompt (destructive)  |
| `-w`          | Workspace ID                                |
| `-o`          | Output format: `summary` or `json`          |

### Tenant Clusters

| Command                                | Description                                                          |
| -------------------------------------- | -------------------------------------------------------------------- |
| `xano tenant cluster list`             | List clusters                                                        |
| `xano tenant cluster get <id>`         | Get cluster details                                                  |
| `xano tenant cluster create`           | Create a cluster (`--name`, `--credentials_file` or `--credentials`) |
| `xano tenant cluster edit <id>`        | Edit a cluster                                                       |
| `xano tenant cluster delete <id>`      | Delete a cluster (`-f`)                                              |
| `xano tenant cluster license get <id>` | Get cluster kubeconfig                                               |
| `xano tenant cluster license set <id>` | Set cluster kubeconfig (`--file`)                                    |

***

## `xano platform`

View platform versions. See [Platforms](/xano-cli/platforms) for full documentation.

| Command                  | Description          |
| ------------------------ | -------------------- |
| `xano platform list`     | List all platforms   |
| `xano platform get <id>` | Get platform details |

***

## `xano unit_test`

Run unit tests. See [Testing](/xano-cli/workflow-tests) for full documentation.

| Command                   | Description                                   |
| ------------------------- | --------------------------------------------- |
| `xano unit_test list`     | List unit tests (`--branch`, `--obj-type`)    |
| `xano unit_test run <id>` | Run a single unit test                        |
| `xano unit_test run_all`  | Run all unit tests (`--branch`, `--obj-type`) |

***

## `xano workflow_test`

Run workflow tests. See [Testing](/xano-cli/workflow-tests) for full documentation.

| Command                          | Description                                |
| -------------------------------- | ------------------------------------------ |
| `xano workflow_test list`        | List workflow tests (`-b` for branch)      |
| `xano workflow_test get <id>`    | Get test details (`--include-draft`, `-o`) |
| `xano workflow_test run <id>`    | Run a single test                          |
| `xano workflow_test run_all`     | Run all tests (`-b` for branch)            |
| `xano workflow_test delete <id>` | Delete a test (`-f`)                       |

***

## `xano sandbox`

Manage your sandbox environment — an isolated copy of your workspace for testing changes before promoting them. See [Sandbox](/xano-cli/sandbox) for full documentation.

| Command                   | Description                                           |
| ------------------------- | ----------------------------------------------------- |
| `xano sandbox get`        | Get your sandbox (creates one if it doesn't exist)    |
| `xano sandbox pull <dir>` | Pull sandbox content as local XanoScript              |
| `xano sandbox push <dir>` | Push local files to your sandbox                      |
| `xano sandbox review`     | Open sandbox in browser to review and promote changes |
| `xano sandbox reset`      | Reset sandbox (clears all data and drafts)            |
| `xano sandbox delete`     | Delete sandbox entirely                               |

### `xano sandbox pull`

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

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

### `xano sandbox push`

Unlike `xano workspace push`, sandbox push does **not** accept `-i/--include` or `-e/--exclude` — it always pushes the full set of changed files. It also warns and prompts if the local files target a different workspace than the sandbox currently holds (see [Sandbox — Workspace mismatch guard](/xano-cli/sandbox#workspace-mismatch-guard)).

```bash theme={null}
xano sandbox push -d ./my-sandbox
xano sandbox push -d ./my-sandbox --dry-run
xano sandbox push -d ./my-sandbox --sync --delete
xano sandbox push -d ./my-sandbox --review
```

| 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 records in import                                                   |
| `--env`            | Include environment variables in import                                     |
| `--dry-run`        | Show preview then exit without applying                                     |
| `--force`          | Skip 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 the browser after pushing                        |

### `xano sandbox review`

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

| Flag             | Description                                               |
| ---------------- | --------------------------------------------------------- |
| `-u, --url-only` | Print the URL without opening the browser                 |
| `-k, --insecure` | Skip TLS certificate verification (for self-signed certs) |
| `-o`             | Output format: `summary` or `json`                        |

### `xano sandbox reset`

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

| Flag | Description              |
| ---- | ------------------------ |
| `-f` | Skip confirmation prompt |

### `xano sandbox delete`

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

| Flag | Description              |
| ---- | ------------------------ |
| `-f` | Skip confirmation prompt |

### Sandbox Environment Variables

| Command                                       | Description                                                  |
| --------------------------------------------- | ------------------------------------------------------------ |
| `xano sandbox env list`                       | List env var keys                                            |
| `xano sandbox env get --name KEY`             | Get a single env var                                         |
| `xano sandbox env set --name KEY --value VAL` | Set an env var                                               |
| `xano sandbox env delete --name KEY`          | Delete an env var                                            |
| `xano sandbox env get_all`                    | Export all env vars (`--file` for YAML, `--view` for stdout) |
| `xano sandbox env set_all`                    | Import env vars from YAML (`--file`, `--clean`)              |

### Sandbox License

| Command                    | Description                               |
| -------------------------- | ----------------------------------------- |
| `xano sandbox license get` | Get sandbox license (`--file`, `--view`)  |
| `xano sandbox license set` | Set sandbox license (`--file`, `--value`) |

### Sandbox Tests

| Command                               | Description                                   |
| ------------------------------------- | --------------------------------------------- |
| `xano sandbox unit_test list`         | List unit tests (`--branch`, `--obj-type`)    |
| `xano sandbox unit_test run <id>`     | Run a single unit test                        |
| `xano sandbox unit_test run_all`      | Run all unit tests (`--branch`, `--obj-type`) |
| `xano sandbox workflow_test list`     | List workflow tests (`-b` for branch)         |
| `xano sandbox workflow_test run <id>` | Run a single workflow test                    |
| `xano sandbox workflow_test run_all`  | Run all workflow tests (`-b` for branch)      |

***

## `xano function`

Manage custom functions.

| Command                    | Description                         |
| -------------------------- | ----------------------------------- |
| `xano function list`       | List all custom functions           |
| `xano function get <id>`   | Get function details                |
| `xano function create`     | Create a new function               |
| `xano function edit <id>`  | Edit an existing function           |
| `xano function run [name]` | Run a function and print its result |

### `xano function list`

```bash theme={null}
xano function list
xano function list --include_draft --page 2 --per_page 10
```

| Flag                   | Description                                   |
| ---------------------- | --------------------------------------------- |
| `--include_draft`      | Include draft functions                       |
| `--include_xanoscript` | Include XanoScript in response                |
| `--sort`               | Sort field (default: `created_at`)            |
| `--order`              | Sort order: `asc` or `desc` (default: `desc`) |
| `--page`               | Page number (default: `1`)                    |
| `--per_page`           | Results per page (default: `50`)              |
| `-w`                   | Workspace ID                                  |
| `-o`                   | Output format: `summary` or `json`            |

### `xano function get`

```bash theme={null}
xano function get FUNCTION_ID
xano function get FUNCTION_ID -o xs
```

| Flag                   | Description                               |
| ---------------------- | ----------------------------------------- |
| `--include_draft`      | Include draft version                     |
| `--include_xanoscript` | Include XanoScript in response            |
| `-w`                   | Workspace ID                              |
| `-o`                   | Output format: `summary`, `json`, or `xs` |

### `xano function create`

```bash theme={null}
xano function create -f ./my-function.xs
cat my-function.xs | xano function create -s
```

| Flag          | Description                                             |
| ------------- | ------------------------------------------------------- |
| `-f, --file`  | Path to file containing XanoScript code                 |
| `-s, --stdin` | Read XanoScript from stdin                              |
| `-e, --edit`  | Open file in editor before creating (requires `--file`) |
| `-w`          | Workspace ID                                            |
| `-o`          | Output format: `summary` or `json`                      |

### `xano function edit`

```bash theme={null}
xano function edit FUNCTION_ID -f ./my-function.xs
```

| Flag          | Description                                             |
| ------------- | ------------------------------------------------------- |
| `-f, --file`  | Path to file containing XanoScript code                 |
| `-s, --stdin` | Read XanoScript from stdin                              |
| `-e, --edit`  | Open file in editor before updating (requires `--file`) |
| `--publish`   | Publish the function after editing (default: `true`)    |
| `-w`          | Workspace ID                                            |
| `-o`          | Output format: `summary` or `json`                      |

### `xano function run`

Executes a function in the workspace and prints its result. Pass the function name as an argument (or with `--name`); omit both to pick one interactively. By default the CLI validates the input payload against the function's declared inputs and prompts for any that are missing — use `--no-input-check` to skip that and send the payload as-is.

```bash theme={null}
xano function run calcScore -w 40
xano function run calcScore --data email=jo@x.com --data age:=30 --data active:=true
xano function run calcScore --json @payload.json --data env=staging
xano function run calcScore --branch dev --logs
```

| Flag               | Description                                                                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| `-n, --name`       | Function name (alternative to the positional argument)                                               |
| `-d, --data`       | Input field, repeatable: `key=value` (string), `key:=json` (raw JSON), or `key@file` (file contents) |
| `--json`           | Input as a JSON object: inline, `@file.json`, or `-` for stdin                                       |
| `-s, --stdin`      | Read the input JSON object from stdin (same as `--json -`)                                           |
| `--branch`         | Branch to run from (defaults to profile branch, then main)                                           |
| `--logs`           | Print the execution logs returned by the debugger                                                    |
| `--no-input-check` | Skip local schema validation / prompting; send the payload as-is                                     |
| `-w`               | Workspace ID                                                                                         |
| `-o`               | Output format: `json` (default) or `summary`                                                         |

***

## `xano knowledge`

Read a workspace's [knowledge and skills](/agent-knowledge) — the AGENTS.md, docs, and skills that shape how AI agents build in the workspace. These commands are read-only.

| Command                     | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `xano knowledge list`       | List workspace knowledge and skills                 |
| `xano knowledge get <name>` | Get a knowledge item, or one of its reference files |

### `xano knowledge list`

Lists knowledge and skills as plain-text markdown (the format AI agents consume). Only enabled items are shown by default.

```bash theme={null}
xano knowledge list -w 40
xano knowledge list -w 40 --output json
xano knowledge list -w 40 --type skill
xano knowledge list --no-enabled-only
```

| Flag             | Description                                                                                |
| ---------------- | ------------------------------------------------------------------------------------------ |
| `-t, --type`     | Filter by knowledge type: `skill`, `doc`, or `agents.md`                                   |
| `--enabled-only` | Only show enabled knowledge (default: `true`; use `--no-enabled-only` to include disabled) |
| `-b, --branch`   | Branch ID                                                                                  |
| `-w`             | Workspace ID                                                                               |
| `-o`             | Output format: `markdown` (default) or `json`                                              |

### `xano knowledge get`

Fetches a single knowledge item by name. Pass `--file` to fetch one of the item's reference files instead of its main content.

```bash theme={null}
xano knowledge get "deploy-runbook" -w 40
xano knowledge get "deploy-runbook" -w 40 --output json
xano knowledge get "deploy-runbook" -w 40 --file checklist.md
```

| Flag           | Description                                                   |
| -------------- | ------------------------------------------------------------- |
| `-f, --file`   | Path of a reference file to fetch instead of the main content |
| `-b, --branch` | Branch ID                                                     |
| `-w`           | Workspace ID                                                  |
| `-o`           | Output format: `text` (default) or `json`                     |

***

## `xano static_host`

Manage static file hosting and builds. See [Static Hosting](/xano-cli/static-hosting) for full documentation.

| Command                                       | Description                                                          |
| --------------------------------------------- | -------------------------------------------------------------------- |
| `xano static_host list`                       | List all static hosts                                                |
| `xano static_host create <name>`              | Create a new static host                                             |
| `xano static_host get <static_host>`          | Get a single host's details (description, git config, dev/prod URLs) |
| `xano static_host edit <static_host>`         | Update a host's name, description, or git config                     |
| `xano static_host build list <static_host>`   | List all builds for a static host                                    |
| `xano static_host build get <static_host>`    | Get build details (`--build_id`)                                     |
| `xano static_host build push <static_host>`   | Push a directory or zip file as a new build                          |
| `xano static_host build pull <static_host>`   | Download a build to disk (`--build_id`, `--latest`, or `--env`)      |
| `xano static_host build delete <static_host>` | Delete a build (`--build_id`; `-f` to skip confirmation)             |
| `xano static_host deploy <static_host>`       | Promote a build to an environment (`--build_id --env`)               |
| `xano static_host migrate [static_host]`      | Migrate v1 host(s) to instance-managed (v2) hosting                  |
| `xano static_host build create <static_host>` | **Deprecated** — use `build push -f <file>` instead                  |

### `xano static_host list`

```bash theme={null}
xano static_host list
xano static_host list -w 40 -o json
xano static_host list --page 2 --per_page 10
```

| Flag         | Description                                  |
| ------------ | -------------------------------------------- |
| `-w`         | Workspace ID (overrides profile)             |
| `-o`         | Output format: `summary` (default) or `json` |
| `--page`     | Page number for pagination (default: `1`)    |
| `--per_page` | Results per page (default: `50`)             |

### `xano static_host create`

```bash theme={null}
xano static_host create marketing
xano static_host create marketing --description "Marketing site" -w 40
```

| Flag            | Description                                  |
| --------------- | -------------------------------------------- |
| `--description` | Description for the static host              |
| `-w`            | Workspace ID (overrides profile)             |
| `-o`            | Output format: `summary` (default) or `json` |

### `xano static_host get`

```bash theme={null}
xano static_host get marketing
xano static_host get marketing -w 40 -o json
```

| Flag | Description                                  |
| ---- | -------------------------------------------- |
| `-w` | Workspace ID (overrides profile)             |
| `-o` | Output format: `summary` (default) or `json` |

### `xano static_host edit`

Provide at least one of `--name`, `--description`, or a `--git-*` flag. Renaming a host changes its deployed hostname.

```bash theme={null}
xano static_host edit marketing --description "Updated marketing site"
xano static_host edit marketing --name marketing-v2
xano static_host edit marketing --git-repo git@github.com:me/site.git --git-private-key-file ./deploy_key
```

| Flag                     | Description                                                                                          |
| ------------------------ | ---------------------------------------------------------------------------------------------------- |
| `--name`                 | New name for the static host (renaming changes the deployed hostname)                                |
| `--description`          | New description                                                                                      |
| `--git-repo`             | Git repository URL (e.g. `git@github.com:org/repo.git`)                                              |
| `--git-public-key`       | Git SSH public key                                                                                   |
| `--git-private-key-file` | Path to a file containing the git SSH private key (read from disk; never passed on the command line) |
| `-w`                     | Workspace ID (overrides profile)                                                                     |
| `-o`                     | Output format: `summary` (default) or `json`                                                         |

### `xano static_host build list`

```bash theme={null}
xano static_host build list my-site
xano static_host build list my-site -w 40 -o json
```

| Flag         | Description                                  |
| ------------ | -------------------------------------------- |
| `-w`         | Workspace ID (overrides profile)             |
| `-o`         | Output format: `summary` (default) or `json` |
| `--page`     | Page number for pagination (default: `1`)    |
| `--per_page` | Results per page (default: `50`)             |

### `xano static_host build get`

```bash theme={null}
xano static_host build get my-site --build_id 52
xano static_host build get my-site --build_id 52 -o json
```

| Flag         | Description                                  |
| ------------ | -------------------------------------------- |
| `--build_id` | Build ID (required)                          |
| `-w`         | Workspace ID (overrides profile)             |
| `-o`         | Output format: `summary` (default) or `json` |

### `xano static_host build push`

Push a directory (`-d`, zipped automatically) or a zip file (`-f`). Defaults to the current directory when neither is given. The build name is optional — omit `-n` and the CLI generates a timestamped name. For `package.json` builds the CLI waits for the build to finish unless `--no-wait` is set, then prints the resulting host URLs.

```bash theme={null}
xano static_host build push my-site -d ./dist -n "v1.0.0"
xano static_host build push my-site
xano static_host build push my-site -f ./build.zip -n "v1.0.0"
xano static_host build push my-site -n "production" --description "Production build" -w 40
```

| Flag              | Description                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------- |
| `-d, --directory` | Directory to push, zipped automatically (defaults to current directory; mutually exclusive with `-f`) |
| `-f, --file`      | Path to a zip file to upload (mutually exclusive with `-d`)                                           |
| `-n, --name`      | Build name (auto-generated from the current timestamp if omitted)                                     |
| `--description`   | Build description                                                                                     |
| `--no-wait`       | Return immediately after upload instead of waiting for the build to finish                            |
| `-w`              | Workspace ID (overrides profile)                                                                      |
| `-o`              | Output format: `summary` (default) or `json`                                                          |

### `xano static_host build pull`

Exactly one of `--build_id`, `--latest`, or `--env` is required. Defaults to the original uploaded source; use `--source built` for the compiled/served output.

```bash theme={null}
xano static_host build pull my-site --build_id 52
xano static_host build pull my-site --latest -d ./output
xano static_host build pull my-site --env prod -d ./prod-release
xano static_host build pull my-site --build_id 52 --source built
```

| Flag              | Description                                                                                                        |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| `--build_id`      | Build ID to pull (mutually exclusive with `--latest` and `--env`)                                                  |
| `--latest`        | Pull the most recent build (mutually exclusive with `--build_id` and `--env`)                                      |
| `--env`           | Pull the build deployed to this environment: `dev` or `prod` (mutually exclusive with `--build_id` and `--latest`) |
| `-d, --directory` | Output directory for pulled files (defaults to current directory)                                                  |
| `--source`        | Files to pull: `original` (default) or `built`                                                                     |
| `-w`              | Workspace ID (overrides profile)                                                                                   |

### `xano static_host build delete`

Prompts for confirmation unless `-f`/`--force` is set.

```bash theme={null}
xano static_host build delete my-site --build_id 52
xano static_host build delete my-site --build_id 52 --force
```

| Flag          | Description                                  |
| ------------- | -------------------------------------------- |
| `--build_id`  | Build ID to delete (required)                |
| `-f, --force` | Skip the confirmation prompt                 |
| `-w`          | Workspace ID (overrides profile)             |
| `-o`          | Output format: `summary` (default) or `json` |

### `xano static_host deploy`

Promote a build to a host environment.

```bash theme={null}
xano static_host deploy my-site --build_id 52 --env dev
xano static_host deploy my-site --build_id 52 --env prod
```

| Flag         | Description                                    |
| ------------ | ---------------------------------------------- |
| `--build_id` | Build ID to deploy (required)                  |
| `--env`      | Target environment: `dev` or `prod` (required) |
| `-w`         | Workspace ID (overrides profile)               |
| `-o`         | Output format: `summary` (default) or `json`   |

### `xano static_host migrate`

Migrate v1 hosts to instance-managed (v2) hosting. Provide either a host name or `--all`, not both.

```bash theme={null}
xano static_host migrate newsite
xano static_host migrate newsite --env dev
xano static_host migrate --all
xano static_host migrate --all --dry-run
```

| Flag        | Description                                                              |
| ----------- | ------------------------------------------------------------------------ |
| `--all`     | Migrate every host still on v1 in the workspace                          |
| `--env`     | Which environment to migrate: `dev` or `prod` (migrates both if omitted) |
| `--dry-run` | List the hosts that would be migrated without changing anything          |
| `-w`        | Workspace ID (overrides profile)                                         |
| `-o`        | Output format: `summary` (default) or `json`                             |

### `xano static_host build create`

<Warning>
  Deprecated and hidden. Its zip-upload capability has been folded into `build push` — use `xano static_host build push -f <file>` instead.
</Warning>

```bash theme={null}
xano static_host build push my-site -f ./build.zip -n "v1.0.0"
```
