@xano/cli) lets you manage your Xano workspaces, push and pull XanoScript, and work with branches — all from your terminal.
Use Git to Protect Your Work
Because the CLI syncs schema definitions that directly affect your database, you should treat your local XanoScript files with the same care as production infrastructure code:- Initialize a git repository in your workspace directory so every change is tracked.
- Review diffs before pushing — run
git diff(or use your IDE’s diff viewer) to inspect exactly what has changed since your last push. Pay close attention to table schema modifications. - Commit before pushing — create a git commit before running
xano workspace pushso you have a known-good snapshot to revert to if something goes wrong. - Be especially careful with schema changes — renaming or removing columns or changing field types can cause data loss. Double-check these changes and consider backing up critical data first.
Xano maintains rolling backups of your instance on all paid plans. Read more about restoring backups.
Installation
Install the CLI globally via npm:Terminal
Terminal
Authentication
The fastest way to get started is with browser-based authentication:Terminal
- Instance — the Xano instance to connect to
- Workspace — the workspace you want to work in (optional)
- Branch — the branch to target (optional)
- Profile name — a name for this configuration (defaults to “default”)
~/.xano/credentials.yaml and the profile is set as your default.
Other Environments
If you’re using a self-hosted Xano instance or a non-production environment, pass the-o flag with your environment URL:
- Self-Hosted
- Beta
Terminal
-o (origin) flag tells the CLI where to direct the authentication flow. This is the URL where your Xano account management UI is hosted. For self-hosted instances, the CLI automatically detects that the origin is the instance itself and skips the instance selection step.
If your self-hosted instance uses a self-signed TLS certificate, add the --insecure (-k) flag to skip certificate verification:
Terminal
Profile Wizard
The profile wizard provides a step-by-step, interactive setup using an access token instead of browser-based login. This is useful for CI/CD environments, self-hosted instances, or when you prefer token-based auth.Terminal
Enter your access token
You’ll be prompted to enter your Xano access token (input is hidden for security).You can generate an access token from your Xano account settings under API Access.
Select your instance
The CLI fetches all instances associated with your account. Choose the one you want to work with.
Name your profile
Give this profile a name. This lets you maintain multiple profiles for different environments.
Wizard for Other Environments
For self-hosted or beta environments, pass the-o flag:
Terminal
Terminal
Managing Profiles
Profiles let you store multiple configurations and quickly switch between them.List Profiles
Terminal
-d for full details including origin URLs, workspace IDs, and masked tokens:
Terminal
Create a Profile Manually
For scripting or CI/CD, create a profile directly without the interactive wizard:Terminal
| 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 (for self-signed certs) |
--default | Set as the default profile |
Edit a Profile
Update any field on an existing profile:Terminal
--remove-* flag:
Terminal
Terminal
Get Default Profile
Print the name of the current default profile:Terminal
Switch Default Profile
Terminal
Print Access Token
Output the access token for the default profile (useful for piping to other commands):Terminal
Print Workspace ID
Output the workspace ID for the default profile:Terminal
Change Workspace Interactively
Switch the workspace on a profile by selecting from a list of available workspaces:Terminal
Terminal
Delete a Profile
Terminal
-f to skip the confirmation prompt.
Using a Profile for a Single Command
Override the default profile for any command with-p:
Terminal
XANO_PROFILE environment variable:
Terminal
Global Flags
These flags are available on all CLI commands:| Flag | Env Variable | Description |
|---|---|---|
-p, --profile | XANO_PROFILE | Use a specific profile (overrides default) |
-v, --verbose | XANO_VERBOSE | Show detailed request/response information for troubleshooting |
Verbose Mode
When something isn’t working as expected, add-v to any command to see the underlying HTTP request and response:
Terminal
Verify Your Setup
Check that your profile is configured correctly:Terminal
- CLI Information — your active profile name and CLI version
- Account — your authenticated user details
- Instance — the connected instance, along with the workspace and branch your profile targets (if set)
-o json for the full JSON response.
Updating the CLI
Update to the latest version:Terminal
Terminal