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

# Cheat Sheet

> The most-used Xano CLI commands on one page, grouped by task and linked to the full reference.

A quick-scan map of the commands you reach for most. Everything is grouped by task, and each group links to the full reference when you need every flag. New to the CLI? Start with [Get Started](/xano-cli/get-started).

<Note>
  Looking for every command, subcommand, and flag? See the complete [Command Reference](/xano-cli/command-reference).
</Note>

## Quickstart

<Steps>
  <Step title="Install the CLI">
    ```bash theme={null}
    npm install -g @xano/cli
    ```

    Requires Node ≥ 20.12.
  </Step>

  <Step title="Authenticate">
    ```bash theme={null}
    xano auth
    ```

    Opens your browser and saves a profile.
  </Step>

  <Step title="Get a sandbox">
    ```bash theme={null}
    xano sandbox get
    ```

    Auto-provisions a personal, free-tier dev environment.
  </Step>

  <Step title="Pull your code">
    ```bash theme={null}
    xano sandbox pull -d ./code
    ```

    Splits the multidoc into folders of `.xs` files.
  </Step>
</Steps>

## Commands at a glance

<CardGroup cols={3}>
  <Card title="Auth and profiles" icon="user-lock" href="#auth-and-profiles">
    Login, contexts, and tokens.
  </Card>

  <Card title="Sandbox" icon="flask" href="#sandbox">
    Your personal dev environment.
  </Card>

  <Card title="Workspace" icon="folder-tree" href="#workspace">
    Git-friendly pull and push.
  </Card>

  <Card title="Branch" icon="code-branch" href="#branch">
    Labels, promotion, and live.
  </Card>

  <Card title="Function" icon="code" href="#function">
    Edit a single function fast.
  </Card>

  <Card title="Release" icon="tag" href="#release">
    Snapshots and deploys.
  </Card>

  <Card title="Tenant" icon="building" href="#tenant">
    Isolated multi-tenant deploys.
  </Card>

  <Card title="Testing" icon="vial" href="#testing">
    Unit and workflow tests in CI.
  </Card>

  <Card title="Hosting and platform" icon="server" href="#static-hosting-platform-and-maintenance">
    Frontends, platform, and updates.
  </Card>
</CardGroup>

## Auth and profiles

Profiles store credentials and the active workspace + branch. Keep one per environment (prod / staging / dev) and switch with `-p`.

| Command                                                           | What it does                                             |
| ----------------------------------------------------------------- | -------------------------------------------------------- |
| `xano auth`                                                       | Browser OAuth login. Auto-creates a profile.             |
| `xano profile wizard`                                             | Interactive token-based setup (CI / headless friendly).  |
| `xano profile create production -i https://x8.xano.io -t <token>` | Non-interactive, scriptable profile creation.            |
| `xano profile list --details`                                     | See every configured profile and which is default.       |
| `xano profile set staging`                                        | Change the default profile.                              |
| `xano profile me`                                                 | Show authenticated user, instance, and workspace.        |
| `xano profile token \| pbcopy`                                    | Pipe the token (use `$(xano profile token)` in scripts). |
| `xano profile workspace set`                                      | Interactive picker for the active workspace.             |

[Full reference: Profiles →](/xano-cli/profiles)

## Sandbox

A singleton dev environment per user, auto-provisioned on first call — the fastest path from `auth` to shipping XanoScript.

| Command                                          | What it does                                                                                      |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| `xano sandbox get`                               | Returns your sandbox; creates it on first run.                                                    |
| `xano sandbox pull -d ./code`                    | Download the multidoc into snake\_case folders of `.xs`.                                          |
| `xano sandbox push --review`                     | Push changes and open the browser to verify or promote.                                           |
| `xano sandbox push --dry-run`                    | Preview only — no changes applied.                                                                |
| `xano sandbox push --sync --delete`              | Full sync; remove remote objects missing locally.                                                 |
| `xano sandbox review`                            | Open the sandbox in the browser to review and promote changes (`--url-only` just prints the URL). |
| `xano sandbox reset`                             | Wipe data and drafts; the sandbox itself stays.                                                   |
| `xano sandbox env set -n API_KEY --value sk-...` | Manage sandbox env vars (also `get`, `list`, `delete`, `get_all`, `set_all`).                     |
| `xano sandbox unit_test run_all`                 | Run sandbox-scoped tests (also `workflow_test`).                                                  |

[Full reference: Sandbox →](/xano-cli/sandbox)

## Workspace

Canonical pull/push for shared and production workspaces. Splits the multidoc into a folder tree your version control will love.

| Command                                                    | What it does                                               |
| ---------------------------------------------------------- | ---------------------------------------------------------- |
| `xano workspace list`                                      | Show every workspace your account can reach.               |
| `xano workspace pull -d ./xano-code`                       | Pull the entire workspace into snake\_case folders.        |
| `xano workspace pull -d ./bk --env --records --draft`      | Include env vars, table records, and drafts.               |
| `xano workspace push --dry-run`                            | Preview the diff before any write.                         |
| `xano workspace push --sync --delete --force`              | Full mirror push (deletes remotes not present locally).    |
| `xano workspace push -i "api/**" -i "function/**"`         | Include globs, repeatable. Mirror with `-e` to exclude.    |
| `xano workspace push --no-transaction --no-guids`          | Disable transactional import / GUID write-back.            |
| `xano workspace git pull -r https://github.com/owner/repo` | Pull XanoScript straight from a git repo (token via `-t`). |

[Full reference: Push & pull →](/xano-cli/push-pull)

## Branch

`v1` always exists and can't be renamed or deleted. The live branch serves production traffic — `set_live` swaps it instantly.

| Command                                                      | What it does                                         |
| ------------------------------------------------------------ | ---------------------------------------------------- |
| `xano branch list`                                           | All branches in the workspace.                       |
| `xano branch create dev`                                     | Clone from `v1` (use `-s` to clone from elsewhere).  |
| `xano branch create feature-auth -s dev -d "Auth feature"`   | Branch from another branch with a description.       |
| `xano branch edit dev --label development --color "#ff5733"` | Rename or recolor a branch.                          |
| `xano branch set_live staging`                               | Promote to production — affects traffic immediately. |
| `xano branch delete feature-old --force`                     | Delete a branch (never `v1` or the live branch).     |
| `xano workspace pull -b dev`                                 | Target a specific branch on pull/push with `-b`.     |

[Full reference: Workspaces & branches →](/xano-cli/workspaces-and-branches)

## Function

Skip the full pull when you only need to tweak one function. `edit` with no flags fetches and opens it directly in `$EDITOR`.

| Command                                          | What it does                                                 |
| ------------------------------------------------ | ------------------------------------------------------------ |
| `xano function list --include_draft`             | List functions; sort with `--sort`, `--order`, `--per_page`. |
| `xano function get 145 -o xs > my_function.xs`   | Dump raw XanoScript to a file.                               |
| `xano function edit 145`                         | Most ergonomic flow — opens current code in `$EDITOR`.       |
| `xano function edit 145 -f ./fn.xs --no-publish` | Save as a draft instead of publishing.                       |
| `xano function create -f ./scaffold.xs --edit`   | Create from a file; `--edit` opens it first.                 |
| `cat fn.xs \| xano function create --stdin`      | Pipe XanoScript in from another tool.                        |

[Full reference: Function commands →](/xano-cli/command-reference#xano-function)

## Release

Releases are named, versioned snapshots of a branch. Deploy them to tenants, export them to a file, or move them between workspaces.

| Command                                             | What it does                                        |
| --------------------------------------------------- | --------------------------------------------------- |
| `xano release create v1.0.0 -b dev`                 | Cut a release from a branch (name is positional).   |
| `xano release create hotfix-auth -b v1 --hotfix`    | Bypass the normal flow for urgent prod fixes.       |
| `xano release deploy v1.0 -w 40 --set_live --force` | Deploy to a workspace as a new branch and go live.  |
| `xano release export v1.0.0 --output ./v1.tar.gz`   | Export a portable file (note `--output`, not `-o`). |
| `xano release import -f ./v1.tar.gz -w 123`         | Import into another workspace.                      |
| `xano release pull -r v1.0.0 -d ./release-v1`       | Inspect a release's contents locally.               |
| `xano release push -d ./release -n v1.1 -b dev`     | Push a directory as a brand-new release.            |

[Full reference: Releases →](/xano-cli/releases)

## Tenant

Each tenant has its own database, env vars, license, and backups. Direct push is blocked — deploy through a release or iterate in a sandbox.

| Command                                                        | What it does                                           |
| -------------------------------------------------------------- | ------------------------------------------------------ |
| `xano tenant list`                                             | All tenants in the workspace.                          |
| `xano tenant create "My Tenant" --type tier2 --cluster_id 1`   | Create a new tenant on a cluster.                      |
| `xano tenant deploy_release my-tenant -r v1.0.0`               | Promote a release to a tenant.                         |
| `xano tenant deploy_platform my-tenant --platform_id 5`        | Update the runtime platform version.                   |
| `xano tenant pull -t my-tenant -d ./out`                       | Read-only export of tenant code/data.                  |
| `xano tenant impersonate my-tenant`                            | Open the tenant dashboard in a browser.                |
| `xano tenant env set_all my-tenant -f ./env.yaml --clean`      | Bulk import env vars (`--clean` replaces).             |
| `xano tenant backup create my-tenant -d "pre-deploy"`          | Snapshot before risky changes.                         |
| `xano tenant backup restore my-tenant --backup_id 123 --force` | Disaster recovery — restore in place.                  |
| `xano tenant cluster list`                                     | Manage clusters (`create`, `edit`, `license get/set`). |

[Full reference: Tenants →](/xano-cli/tenants)

## Testing

Tests are authored in the dashboard; the CLI runs them. Use `-o json` for machine-readable results in pipelines.

| Command                                                | What it does                                            |
| ------------------------------------------------------ | ------------------------------------------------------- |
| `xano unit_test list --branch dev --obj-type function` | Filter by branch or object type.                        |
| `xano unit_test run_all -o json`                       | CI gate — run every unit test, machine-readable output. |
| `xano unit_test run 123`                               | Run a single test by ID.                                |
| `xano workflow_test run_all --branch dev -o json`      | Run end-to-end, multi-step request flows.               |
| `xano workflow_test get 456 -o xs`                     | Inspect a workflow test as XanoScript.                  |
| `xano workflow_test delete 456 --force`                | Remove a workflow test (rarely needed).                 |

[Full reference: Workflow tests →](/xano-cli/workflow-tests)

## Static hosting, platform, and maintenance

Ship the SPA next to the API, pin the runtime version, and keep the CLI itself current.

| Command                                                           | What it does                                     |
| ----------------------------------------------------------------- | ------------------------------------------------ |
| `xano static_host list`                                           | Every static host in the workspace.              |
| `xano static_host build create my-app -f ./build.zip -n 'v1.0.0'` | Upload a frontend build as a new version.        |
| `xano static_host build list my-app`                              | Browse historical builds (also `get`).           |
| `xano platform list`                                              | Available platform versions (helm + image tags). |
| `xano platform get 23629 -o json`                                 | Inspect details before `tenant deploy_platform`. |
| `xano update`                                                     | Pull the latest CLI release.                     |

[Full reference: Static hosting →](/xano-cli/static-hosting)

## Power-user tips

<CardGroup cols={2}>
  <Card title="Global flags" icon="flag">
    Available on any command:

    * `-p <name>` — swap profile
    * `-c <path>` — alternate credentials file
    * `-v` — verbose HTTP
    * `-o <fmt>` — output format (`summary` / `json` / `xs`)
  </Card>

  <Card title="Override with env vars" icon="gear">
    ```bash theme={null}
    XANO_PROFILE=staging
    XANO_CONFIG=/opt/.xano/creds.yaml
    XANO_VERBOSE=1
    ```
  </Card>

  <Card title="Sandbox vs. workspace" icon="shuffle">
    **Sandbox** for personal experiments and AI-generated code. **Workspace** for shared/production code and CI. Same multidoc layout — workflows translate 1:1.
  </Card>

  <Card title="Always dry-run first" icon="shield-check">
    ```bash theme={null}
    xano workspace push --dry-run
    ```

    Add `--sync --delete` only when you want a true mirror. The default mode is partial (changed-only).
  </Card>

  <Card title="Glob filters" icon="filter">
    ```bash theme={null}
    xano workspace push \
      -i "api/users/**" \
      -e "table/**"
    ```

    `-i` includes and `-e` excludes — both repeatable, both glob.
  </Card>

  <Card title="Atomic by default" icon="database">
    Pushes wrap in a DB transaction and write server-assigned GUIDs back to local files. Disable only when needed with `--no-transaction` or `--no-guids`.
  </Card>

  <Card title="Edit a function in $EDITOR" icon="pen">
    ```bash theme={null}
    export EDITOR=cursor
    xano function edit 145
    ```

    No file, no flags — the CLI fetches the current code, opens it, and publishes on save.
  </Card>

  <Card title="Reuse the token" icon="key">
    ```bash theme={null}
    TOKEN=$(xano profile token)
    curl -H "Authorization: Bearer $TOKEN" \
      https://x8.xano.io/api:meta/workspace
    ```
  </Card>

  <Card title="CI/CD recipe" icon="gears">
    ```bash theme={null}
    xano profile create ci -i $URL -t $TOKEN
    xano unit_test run_all -o json
    xano release create v$SHA -b dev
    xano tenant deploy_release prod -r v$SHA
    ```
  </Card>

  <Card title="Branches as environments" icon="code-branch">
    ```bash theme={null}
    xano workspace pull -b dev   -d ./code
    xano workspace push -b stage -d ./code
    ```

    Branches are labels (strings), not IDs. `v1` is reserved.
  </Card>

  <Card title="Include data on pull/push" icon="boxes-stacked">
    Add data alongside code:

    * `--records` — include table rows
    * `--env` — include env vars
    * `--draft` — include drafts

    Combine for full backups: `pull --env --records --draft`.
  </Card>

  <Card title="Tenant push is blocked" icon="lock">
    ```bash theme={null}
    xano release create v1 -b dev
    xano tenant deploy_release my-tenant -r v1
    ```

    Or iterate in a sandbox first, then promote.
  </Card>
</CardGroup>

## Go deeper

<CardGroup cols={2}>
  <Card title="Command Reference" icon="rectangle-list" href="/xano-cli/command-reference">
    Every command, subcommand, and flag.
  </Card>

  <Card title="Get Started" icon="download" href="/xano-cli/get-started">
    Install, authenticate, and pull your first code.
  </Card>

  <Card title="Team workflows" icon="users" href="/xano-cli/team-workflows">
    Branching, releases, and promotion across a team.
  </Card>

  <Card title="Push & pull" icon="arrows-rotate" href="/xano-cli/push-pull">
    How the multidoc maps to a local folder tree.
  </Card>
</CardGroup>
