CLI for Xano's Metadata API
npm install @xano/cliCommand-line interface for the Xano Metadata API.


``bash`
npm install -g @xano/cli
1. Create a profile with the wizard:
`bash`
xano profile:wizard
2. List your workspaces:
`bash`
xano workspace:list
3. Execute XanoScript code:
`bash`
xano run exec script.xs
Profiles store your Xano credentials and default workspace/project settings.
`bashCreate a profile interactively (auto-fetches run projects)
xano profile:wizard
The
profile:wizard command automatically fetches your run projects and sets the first one as the default for xano run commands.$3
`bash
List all workspaces
xano workspace:list
xano workspace:list -o json
`$3
`bash
List functions in a workspace
xano function:list -w 40
xano function:list -o jsonGet a specific function
xano function:get 145
xano function:get 145 -o xs # Output as XanoScriptCreate a function from XanoScript
xano function:create -f function.xs
cat function.xs | xano function:create --stdinEdit a function
xano function:edit 145 # Opens in $EDITOR
xano function:edit 145 -f new.xs # Update from file
xano function:edit 145 --publish # Publish after editing
`$3
Execute XanoScript code and manage projects, sessions, environment variables, and secrets.
#### Executing Code
`bash
Execute XanoScript (job or service)
xano run exec script.xs # Single file
xano run exec ./my-workspace # Directory (multidoc from .xs files)
xano run exec https://example.com/script.xs # From URL
xano run exec script.xs -a args.json # With input arguments (file)
xano run exec script.xs -a https://ex.com/args.json # With input arguments (URL)
xano run exec script.xs --edit # Edit in $EDITOR first
xano run exec script.xs --env API_KEY=secret # With env overrides
cat script.xs | xano run exec --stdin # From stdinGet document info (type, inputs, env vars)
xano run info -f script.xs
`When a directory is provided, all
.xs files are collected recursively and combined into a multidoc (joined with --- separators), similar to xano workspace push.#### Projects
`bash
List projects
xano run projects listCreate a project
xano run projects create -n "My Project"
xano run projects create -n "My Project" -d "Description"Update a project
xano run projects update -n "New Name"
xano run projects update -d "New description"Delete a project
xano run projects delete
xano run projects delete --force # Skip confirmation
`#### Sessions
`bash
List sessions
xano run sessions listGet session details
xano run sessions get Start/stop a session
xano run sessions start
xano run sessions stop Delete a session
xano run sessions delete
xano run sessions delete --force # Skip confirmationGet sink data for a completed session
xano run sink get
`#### Environment Variables
`bash
List environment variable keys
xano run env listSet an environment variable
xano run env set API_KEY my-secret-keyGet an environment variable value
xano run env get API_KEYDelete an environment variable
xano run env delete API_KEY
xano run env delete API_KEY --force # Skip confirmation
`#### Secrets
`bash
List secrets
xano run secrets listSet a secret
xano run secrets set docker-registry -t dockerconfigjson -v '{"auths":{...}}' -r ghcr.io
xano run secrets set service-key -t service-account-token -v 'token-value'Get a secret value
xano run secrets get docker-registryDelete a secret
xano run secrets delete docker-registry
xano run secrets delete docker-registry --force # Skip confirmation
`$3
`bash
List static hosts
xano static_host:listCreate a build
xano static_host:build:create default -f ./build.zip -n "v1.0.0"List builds
xano static_host:build:list defaultGet build details
xano static_host:build:get default 52
`Global Options
All commands support these options:
| Flag | Description |
|------|-------------|
|
-p, --profile | Profile to use (or set XANO_PROFILE env var) |
| -w, --workspace | Workspace ID (overrides profile default) |
| -o, --output | Output format: summary (default) or json |
| -v, --verbose | Show detailed request/response information (or set XANO_VERBOSE env var) |$3
Use
-v or --verbose to see detailed HTTP request and response information, useful for debugging:`bash
xano run exec script.xs -v
`This will show:
- Request method, URL, and content type
- Request body (truncated if large)
- Response status, timing, and body
Configuration
Profiles are stored in
~/.xano/credentials.yaml:`yaml
profiles:
default:
account_origin: https://app.xano.com
instance_origin: https://instance.xano.com
access_token:
workspace:
branch:
project:
default: default
`Help
`bash
xano --help
xano --help
``