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
--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.
--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:
--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
initprints, andxano/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.examplelists only the names.
xano/xano.lock from that same export, so commit it with the
first commit:
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 unpacks the workspace’s records, stored files and instance secrets into
xano/data; - it pulls the backend code into
xano/, asinit --from localdoes; - with no directory named, it writes a new folder named after the workspace (
--namestill 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.
.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.
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 workspacebefore each change you make in code.
Next
- How it works: the model behind the code you just pulled.
- Deploy to Xano: ship a change back to the workspace through a release.