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.
Install
Section titled “Install”The CLI ships with Sworen in apps/cli. You need Node.js 18 or later on your computer:
cd apps/clinpm cinpm run buildnpm link # makes the `sworen` command available everywhereCheck it with sworen --help.
Connect to your store
Section titled “Connect to your store”sworen loginIt 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.
Commands
Section titled “Commands”| 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.
What goes live when
Section titled “What goes live when”- Theme files (Liqx, CSS, JavaScript, layout, assets) are live the moment
pushordevuploads 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.
A typical loop
Section titled “A typical loop”sworen new my-themecd my-themesworen dev # edit files; the preview reloads on savesworen check # before you share itsworen pushThen activate the theme under Themes in the admin and publish from the editor.
