Skip to content

CLI reference

The CLI for new apps is the npm package @sovyn/build. Usually your AI assistant runs it for you. This page lists every command, so you know what your assistant is doing and which steps need your OK.

Terminal window
npx @sovyn/build <command>

npx @sovyn/build --help shows the list of commands.

  • Node.js 20 from version 20.19, or 22.12 and later. With an older version, the CLI stops and tells you to update.
  • A package-lock.json next to package.json in the project folder. npm install --package-lock-only writes it if it is missing. You do not need a local npm install or a local build; the platform installs and builds.
  • After adding a package with npm install <package>, the updated package-lock.json can lack entries. If deploy or the build reports “from lock file”, delete node_modules and the lockfile and write it again (an existing node_modules carries the gap over): rm -rf node_modules package-lock.json && npm install --package-lock-only, then run deploy again. A full npm install does not repair it.

Run every command except init in the project folder of the app, the folder that init created.

The CLI needs an access token for the app. Add it with --token <token>.

  • A token is valid for one hour.
  • Your assistant gets a fresh one from Sovyn whenever it needs one (through the tool build_get_status). The CLI remembers it in the folder .sovyn of the project, which deploy never uploads.
  • For setting secrets, you get your own token in the console. It is not stored in the project. See API keys and secrets.

Fetches the starter project into an empty folder and links it to the app. The folder must be empty.

Applies the manifest (sovyn.build.yaml) to development, lists the changes and writes the types to src/lib/sovyn.gen.ts. It only adds: new collections, new fields, new values. If a field or a collection would disappear, apply stops and names it. Other changes are refused, and nothing is changed.

Also removes the fields and collections the manifest no longer has. They move to the trash with their values for 30 days. Only with your consent.

Rebuilds development empty. The old data, end users and sessions move to the trash for 30 days. Only with your consent.

Uploads the source code and waits while the platform checks, builds and publishes it as a new version in development. It never uploads node_modules, dist, .git, .sovyn or .env files; packed, the upload may be at most 25 MB. If a step fails, the running app stays unchanged. Details on Versions, development and production.

Puts the version running in development into production, without a new build. No data is copied. Your assistant runs it only when you explicitly ask for production; the command does not ask back.

Also removes fields and collections in production that the promoted manifest no longer has. They move to the trash of production for 30 days. Only with your consent.

Names the plan of production. During the introductory phase there is only pro. The first promote needs it. With a running contract, it books nothing yet: it names the monthly price and what is charged today. See Plans and usage.

Books the app as a paid monthly position. Only after you have approved the named price.

Lists the versions that were active in development (dev) or production (prod), newest first, 50 at a time. --before with an entry number shows older ones.

Checks a rollback to an earlier version against the real data. It changes nothing and shows what would happen.

rollback <dev|prod> --to <version> --confirm

Section titled “rollback <dev|prod> --to <version> --confirm”

Rolls back for real. Only with your consent, after you have seen the check.

secret set, secret list, secret delete, secret import

Section titled “secret set, secret list, secret delete, secret import”

Set, list, delete and import API keys and other secrets of an environment. These commands are for people, not for your assistant. See API keys and secrets.

Some files in the project belong to the platform. Their first line starts with // Platform file of sovyn.build. Do not edit them: apply and deploy replace them with the current version. The types of your app are generated into src/lib/sovyn.gen.ts by apply.