CLI
appbuilder is a command line tool. It pulls a shop's screens, theme and custom blocks into a folder, lets you edit them, and pushes your changes back as drafts.
Status: built. The CLI runs from the repository with the installed tsx tool. A packaged build is not yet set up.
Set up#
appbuilder login --api-url https://<your-api-address>
You are asked for an API key. The key is stored in ~/.appbuilder/config.json, which is readable only by you. You can also set the environment variables APPBUILDER_API_URL and APPBUILDER_API_KEY instead.
The API address must be https. Plain http is allowed only for localhost. The CLI never prints the key.
Commands#
| Command | What it does |
|---|---|
login | Save the API address and key. |
logout | Remove the saved key. |
whoami | Show the shop and the key's scopes. |
pull | Download screens, theme and custom blocks into screens/, theme/ and blocks/. Records what it pulled in .appbuilder/state.json. |
push | Send only the files you changed. Custom blocks go first. |
validate | Check custom blocks on your machine. Check screens and theme on the server. |
blocks list | List the built-in and custom block types. |
preview | Make a preview link and a QR code. |
publish | Publish all drafts. |
Useful flags#
--json: machine-readable output on every command.--dry-runonpush: show what would change, send nothing.--createonpush: create a new screen.--forceonpull: overwrite local edits. Without it,pullstops if a file has changed locally.--yesonpublish: skip the confirmation. Without it, you type the shop domain. A non-interactive run without--yesstops.
Things to know#
pushnever publishes. Onlypublishdoes.- If the server has a newer draft than you pulled,
pushfails and asks you to pull again. - A changed custom block needs a higher
versionbefore it pushes. - Exit codes:
0ok,1failed or invalid,2wrong usage.
Typical loop#
appbuilder pull
# edit files in screens/, theme/ or blocks/
appbuilder validate
appbuilder push --dry-run
appbuilder push
appbuilder preview
appbuilder publish