Installation
Install the Fluid CLI and its theme plugin from npm:fluid theme commands come from the theme plugin, so install both.
After installation, verify it is available by running fluid --version.
Authentication
Before you can interact with any theme, you need to authenticate the CLI with your Fluid account.FLUID_TOKEN environment variable so it stays out of your shell history:
Company Management
If you manage multiple companies in Fluid, you can switch between them without logging out. Run the interactive company switcher:Theme Commands
Use these commands to manage your theme files between your local machine and the Fluid platform.pull, push, and dev accept --theme (-t) with a theme name or ID. See Choose the theme a command uses for what each command targets without it.
pull, push, dev, and lint accept --root to run against a theme directory other than the current one.
fluid theme lint runs the same schema validation as fluid theme push, so it catches errors that would block a push before you upload.
It also warns about each page type your theme has no template for, because the storefront shows your home page at those URLs.
Native widget references such as fluid://native/widgets/chgoal and fluid://native/widgets/<key>/sections/<name> have no local file, so lint accepts them when <key> is in the native widget catalog. It warns about an unknown key, which may be newer than your CLI, without failing the lint. A malformed fluid://native/ reference is still an error.
In .liquid files and assets/ scripts, it warns about cart code that misuses the SDK: cart/create-cart-for-data and cart/custom-add-without-drawer-open. See Common pitfalls.
Warnings don’t fail lint.
A clean lint result doesn’t prove every template renders: check the page in fluid theme dev as well.
Choose the theme a command uses
fluid theme push picks its target in this order:
- With
--unpublished, it asks you for a name, creates a new unpublished theme, and pushes to it. - With
--theme, it pushes to the theme you name. - Otherwise, it pushes to the theme this directory is bound to in
.fluid-theme.json, and printsUsing theme from .fluid-theme.jsonwith the theme’s name and ID.fluid theme pullwrites that file, so a project pushes back to the theme you pulled it from. - With no
.fluid-theme.json, it asks you to pick a theme.
fluid theme pull uses --theme, or asks you to pick a theme. It doesn’t read .fluid-theme.json to choose one.
A push needs a baseline: the state of the theme the last time this directory synced with it. Without one, for example when you haven’t pulled the theme into this directory, the push stops before it changes anything. Run fluid theme pull -t <theme-id> first, or rerun the push with --auto-baseline, or with --force to overwrite the theme’s files with yours.
Development themes
fluid theme dev syncs your files to a development theme, a scratch copy named like Development (<host>-<random>). Your storefront never serves a development theme, so a push to one changes nothing live.
- When your project is bound to a real theme,
fluid theme push --theme <development-theme-id>updates this project’s development theme. The project stays bound to the real theme. fluid theme push --publishrefuses to publish a development theme, because that would make the scratch copy your live theme. Push without--publish, or publish the theme the project is bound to.- Push refuses a development theme that another project or teammate created, because the push would overwrite it with your files. To sync to one on purpose, run
fluid theme dev --theme <id>. fluid theme pullrefuses to pull a development theme into a project bound to another theme. Pull it into a separate directory with--root.
Examples
Pull your current theme before making changes:Run the dev server
fluid theme dev serves your theme locally and syncs each saved file to a development theme of its own.
The first run creates that theme, copying the theme you pulled when it can, and later runs in the same project reuse it.
Your live theme doesn’t change.
Preview member pages
Member pages live on the account subdomain, not the storefront, so the dev server serves them under/_members:
- Open
http://127.0.0.1:9292/_members. It lists each member site in the theme with its pages, including drafts. - Choose a page. Its URL keeps the site you picked, for example
http://127.0.0.1:9292/_members/rewards?members_site_id=<id>. The home page is/_members/?members_site_id=<id>.
members_site_id. Without it, the dev server asks you to select a member site at /_members first. Opening /accounts returns not found, as it does on the storefront domain.
The preview renders with sample data, as a guest. To preview as a sample member of one type, add member_type_id=<id>, which also applies that site’s access rules. country_id and language_id pick the country and language. The preview never signs in as a real member: forms, sign-in links, and native widget actions do nothing, and widgets show sample content. Saved files reload member pages the same way as storefront pages.
To see a page with live data, use the member preview in the builder, or sign in on the account subdomain. See Test a member site.
Preview on a theme branch
fluid theme staging gives a theme a staging branch: a private copy that you publish your local files to and preview on your real storefront through a shareable link, without changing the live theme. When staging looks right, promote it to the live theme.
status prints the preview link. promote --dry-run lists what promoting would change, and promote puts exactly what staging shows onto the live theme after you confirm. fluid theme staging undo-promote reverses the latest promotion. See Theme branches for the full workflow, how teammates’ changes are kept safe, and when to push instead.
MySite themes
MySite themes have their own commands, from the@fluid-app/fluid-cli-mysite plugin: fluid mysite list, fluid mysite pull --theme <id>, fluid mysite dev, and fluid mysite publish. A MySite publish has no draft and changes every MySite that uses the theme at once. See MySite themes.
Capture a live page
fluid theme crawl <url> loads a page in Fluid’s managed browser, runs its JavaScript, and prints a JSON report with the page’s content. Use it to capture a production page before you change it, so you can compare it with your version afterwards.
Without
--direct, the crawl runs through your Fluid sign-in, so run fluid login first. When the report says "ok": false, the command exits with code 1.
Install theme skills
Install the bundled theme-development skills so a compatible coding agent can use them:.agents/skills/ in your current project. Existing skills remain untouched unless you approve the overwrite.
Choose a different destination with --dir or -d:
--force or -f:
Getting Started Workflow
Follow these steps to go from a fresh install to an active local development environment:1
Install the CLI
Install the CLI and its theme plugin from npm as shown above.
2
Log in
Run
fluid login and enter the one-time code sent to your email.3
Create a project directory
4
Initialize or pull your theme
To start a brand new theme:Or, to download your existing published theme:
5
Start the development server
6
Push your changes
Push your changes to the theme, and publish it when you’re ready:Or push to a new unpublished theme first to review it in the admin: