Skip to main content
If your backend already runs on Xano, you do not start from an empty xano/. init --from reads the workspace and writes it out as readable SDK TypeScript (real table(), query() and s.db.query(...) calls), inside the same runnable project a plain init writes.
On Windows on Arm? There is no Xano Engine build for your machine yet. Wherever this page says npm run xano:deploy, run npm run xano:deploy:ephemeral instead: it deploys the same code to an ephemeral in Xano’s cloud. That needs a Xano account, so sign in first (Connect to Xano). See supported platforms.

1. Sign in

The pull reads the workspace your login is bound to. Connect to Xano covers signing in, including --paste for a remote shell.

2. Pull the workspace

--from workspace reads the live Xano branch. --branch <label> reads another one. To add the pulled backend to an app you already have, run npx @xano/sdk init --from workspace inside it instead (Existing app covers what gets merged). A pull carries schema and logic only: no table rows and no stored files. Object identities are kept, so references between objects stay intact, and a statement the SDK does not model yet is carried over verbatim rather than breaking the pull. An audited table comes back with its audit setting, and reads of its change log come back as auditLog(<table>) (Data and tables).

Sites come too

After the backend, init --from workspace brings each of the workspace’s sites’ live code into frontend/, as npx @xano/sdk site pull does on its own. One site becomes frontend/, with the site named in package.json; several become one folder per site, frontend/<site>/. It lists what it will write and confirms first, and never touches xano/. When the workspace has sites, the new project gets no starter app: frontend/ holds the sites’ code instead. --framework asks for the starter anyway.
Off a terminal without --yes, the backend is pulled and the sites are skipped with a note to run npx @xano/sdk site pull.

Leave microservices out

A workspace’s microservices may be managed somewhere else. --exclude microservice leaves them out of the tree and records the choice in package.json, so every later pull, workspace diff and release leaves them out too, and a merge leaves the workspace’s own microservices as they are:
While a project excludes them, --prune and --replace are refused, since both would delete the workspace’s own microservices.

3. Read the round-trip report

After writing the tree, init checks its own work: it loads the project it just wrote, exports it, and diffs the result against the workspace. A mismatch names the object, and the command exits 2 with the tree written but reported as unverified. A workspace whose history settings inherit the instance’s mode, or that has a Studio GitHub link, verifies cleanly; a history capture mode set on the workspace itself is still reported. Read two things before you go further:
  • The decode report that init prints, and xano/README.md, which lists anything that did not translate cleanly and any object that was already empty in the workspace.
  • xano/.env, which holds the env var values the workspace carried. It is gitignored; xano/.env.example lists only the names.
A tree that passes gets its xano/xano.lock from that same export, so commit it with the first commit:
Then run it on your machine:
That deploys the pulled backend to the Xano Engine, not to your workspace.
After a pull, xano/ is your source. Promoting a release changes what the workspace runs, so try every change on the Xano Engine or an ephemeral first.

From a workspace exported from Xano

At the end of a hosted trial, a workspace downloads as a Xano Engine export bundle, a .tar.gz. init --from turns that file into a project that runs on the workspace’s own records:
It needs no Xano login, and it runs the Xano Engine on this machine to do the work:
  • it unpacks the workspace’s records, stored files and instance secrets into xano/data;
  • it pulls the backend code into xano/, as init --from local does;
  • with no directory named, it writes a new folder named after the workspace (--name still names the project);
  • it prints anything that did not carry over, such as stored files the export left out (those still read from the hosted storage, which goes away with the hosted instance);
  • it ends with the command that runs the project.
Any other .tar.gz is refused with the reason, and a refused or cancelled run leaves nothing behind. A target whose xano/data already holds data is refused rather than written over, and --branch, --with-sites and --profile do not apply to an export and are refused. From then on, deploy --local runs the Engine on xano/data instead of a throwaway database: every deploy merges your code in and keeps the rows, seed rows are never written over them, and --reset is refused. See Run on your own data.
xano/data holds the workspace’s secrets. It is gitignored, a deploy warns if git already tracks it, and the SDK never packs it into a publish, an archive or a source upload. Keep it out of commits, and init --force leaves it in place.

Code you wrote yourself: adopt the live identities

If your code did not come from a pull (you wrote it by hand, or ported part of a workspace), its objects do not yet carry the identities the workspace already serves. Without them, your first release would create duplicates beside the existing objects. Adopt them first:
lock import records every identity in that export, by type and name, in xano/xano.lock. A brand-new workspace has nothing to adopt and needs no such step.

Decide where the truth lives

Once the workspace is code, pick one source of truth:
  • The repo. People stop editing the workspace in the Xano editor, and every change arrives through a pull request and a release.
  • The workspace. The team keeps building in the editor, and you refresh the repo from it with npx @xano/sdk pull workspace before each change you make in code.
Source of truth compares the two and shows how to catch drift.

Next