Skip to content

Theme CLI

Create, preview and upload themes from your computer with the sworen command.

The sworen command line tool lets you write a theme on your own computer, preview it against a real store as you save, and upload it.

The CLI ships with Sworen in apps/cli. You need Node.js 18 or later on your computer:

cd apps/cli
npm ci
npm run build
npm link # makes the `sworen` command available everywhere

Check it with sworen --help.

sworen login

It asks for your store’s address and opens the admin in your browser. Approve the connection there (you need to be signed in, with permission to edit the theme). The CLI receives an API key that can only read and edit theme files, and saves it on your computer.

On a server without a browser, use sworen login --manual and paste an existing API key.

Command Does
sworen new <name> [dir] Creates a new theme folder: theme.json, layout/theme.liqx, config/ and an empty home template
sworen dev [dir] Opens a local preview at http://localhost:9292 that shows your files on your real store, uploads each change as you save and reloads the page
sworen check [dir] Checks every <schema> and settings file with the same rules the store uses
sworen push [dir] Uploads the theme files, then writes every template and the settings to the theme’s draft
sworen pull [dir] Downloads the theme’s templates and settings into your folder (--state live for the published ones)
sworen package [dir] Zips the theme in the shape the store accepts (-o file.zip to name it)

dev, push and pull target the theme your theme.json declares. Use -t <slug> to target another one, and -p <port> to change the preview port.

  • Theme files (Liqx, CSS, JavaScript, layout, assets) are live the moment push or dev uploads them. The whole theme is replaced at once.
  • Templates and settings go to the theme’s draft. They are live only after you publish from the theme editor.
sworen new my-theme
cd my-theme
sworen dev # edit files; the preview reloads on save
sworen check # before you share it
sworen push

Then activate the theme under Themes in the admin and publish from the editor.