Skip to main content
This guide walks you through building a brand new Xano backend entirely from the command line — from initial setup to pushing your first XanoScript.

Prerequisites


1

Install the Xano CLI

If you haven’t already, install the CLI globally:Verify with xano --version.
2

Authenticate

Log in with your Xano account:Your browser will open for authentication. After logging in, select your instance and name your profile.
For self-hosted or beta environments, add -o https://your-environment-url.com. See Get Started for details.
3

Create a workspace

Create a new workspace for your project:Note the workspace ID from the output, then add it to your profile:
4

Set up your local project

Pull the empty workspace scaffold to create your local directory structure:This creates the directory structure where you’ll add your XanoScript files.https://mintcdn.com/xano-997cb9ee/aZQYcxhIvSDTNEim/images/icons/githublogo_light.svg?fit=max&auto=format&n=aZQYcxhIvSDTNEim&q=85&s=7dca4ac53d7714c0be1c31479bf09a64https://mintcdn.com/xano-997cb9ee/aZQYcxhIvSDTNEim/images/icons/githublogo_dark.svg?fit=max&auto=format&n=aZQYcxhIvSDTNEim&q=85&s=f7cbc0394ba9e71c3ec33e07c86b85ae We recommend initializing a Git repository in your workspace folder so you can track and review the details of what changed before each push.
Want to start with a working example instead of an empty workspace? Pull the Hello World sample from the XanoScript examples repo:This gives you tables, functions, and API endpoints to explore and build on.
5

Open in VS Code and install the extension

Open the workspace folder in VS Code, then install the XanoScript Language Server extension. This provides syntax highlighting, inline validation, and autocomplete for .xs files — without it, they appear as plain text with no error feedback.
Already using the full XanoScript extension? If you want to keep it for push/pull, that’s fine — but delete any agents.md or other .md artifact files it created in your workspace root, as these can conflict with the Developer MCP and confuse AI assistants. For the best experience, we recommend using the XanoScript Language Server extension alongside the CLI for push/pull.
6

Install the Developer MCP

The Developer MCP gives AI tools direct access to XanoScript documentation and real-time code validation, significantly improving AI-generated XanoScript quality.In the VS Code terminal, add the Developer MCP to your project:
Not using Claude Code? See the Developer MCP guide for setup instructions for Cursor, Windsurf, Codex, VS Code Copilot, and other AI tools.
7

Build with AI

This is where the power of local XanoScript development shines. Use Claude Code with the Developer MCP to generate your backend — the MCP provides XanoScript documentation and real-time validation directly to your AI assistant.Ask Claude Code to generate what you need. For example:
Create a users table with name, email, and role fields, a signup API endpoint, and a login API endpoint.
Claude Code will write the XanoScript files directly into your local workspace.You can also write XanoScript by hand or paste the XanoScript documentation into your AI tool’s context and ask it to generate .xs files. Place them in the appropriate subdirectories (table/, api/, function/, task/).
Start with your database tables first, then functions, then API endpoints. This order ensures dependencies are resolved correctly when you push.
8

Review your changes

Before pushing, review what changed against your local repository. Pay attention to any table schema changes — renamed or removed columns can affect existing data. The CLI is safe by default: objects deleted locally won’t be removed from your Xano workspace unless you explicitly use the --delete flag. If any changes would result in data loss, the push preview will call them out as destructive operations before you confirm. See Push & Pull for a full breakdown.
Work on a development branch to keep your changes separate from the live branch, or use a secondary workspace as your development environment to keep your data schema isolated before promoting to production.
9

Preview the push

Before pushing, run a dry run to see exactly what will be created, updated, or changed — without applying anything:Review the output carefully, especially any destructive operations or schema changes.
10

Push to Xano

When you’re satisfied with the preview, head to your terminal and push yourself — we recommend not asking the AI agent to push for you, so you stay in control of what gets applied:The CLI shows the same preview again and prompts for confirmation before applying. Your tables, APIs, functions, and tasks are now live in Xano.CLI push preview — changesSee Push & Pull for a full breakdown of what each section of the preview means.
11

Verify in Xano

Open your workspace in the Xano dashboard to see your resources. You can test APIs directly from the dashboard, view your database tables, and make visual adjustments.Any changes you make visually in Xano can be pulled back down:

Once you’re up and running, a typical development cycle looks like this:
  1. Pull the latestxano workspace pull ./my-new-app
  2. Edit locally — Write or generate XanoScript with Claude Code and the Developer MCP
  3. Test — Run your workflow and unit tests with the CLI before pushing
  4. Review with Git — Run git diff to inspect exactly what changed before pushing
  5. Dry runxano workspace push ./my-new-app --dry-run — preview the server-side impact without applying anything
  6. Pushxano workspace push ./my-new-app — review the preview and confirm
  7. Verify in Xano — Check your APIs and resources in the Xano dashboard
  8. Iterate — Pull any Xano browser-edited changes, edit locally, and push again
Use a development branch to keep your logic separate from the live branch. When ready, set the branch live. For more safety, dedicate a Workspace to be your development environment to keep your data schema separate before promoting to a production Workspace.

Version Control with Git

Your XanoScript files are plain files on disk — commit, branch, and open PRs exactly like any other project. Git history pairs well with Xano’s own branching system: use Git for code history and Xano branches for deployment environments.