Skip to main content
The Fluid CLI is a command-line tool that brings your theme development workflow to your local machine. With it, you can pull your live theme down to edit in your preferred code editor, push changes back to the server, run a local development server with hot reload, and manage authentication across multiple company accounts. It is designed for developers who want full control over their theme files outside of the browser-based editor.

Installation

Install the Fluid CLI and its theme plugin from npm:
The 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.
The CLI asks for your email address and sends you a one-time code. Enter the code to sign in; the CLI stores your credentials locally for future commands. To sign in with an API token instead, pass it in the FLUID_TOKEN environment variable so it stays out of your shell history:
To check which account and company you are currently authenticated as:
To sign out and remove the stored token:

Company Management

If you manage multiple companies in Fluid, you can switch between them without logging out. Run the interactive company switcher:
Or switch directly to a company or profile by name:
After switching, all subsequent theme commands operate against the selected company’s theme.

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:
  1. With --unpublished, it asks you for a name, creates a new unpublished theme, and pushes to it.
  2. With --theme, it pushes to the theme you name.
  3. Otherwise, it pushes to the theme this directory is bound to in .fluid-theme.json, and prints Using theme from .fluid-theme.json with the theme’s name and ID. fluid theme pull writes that file, so a project pushes back to the theme you pulled it from.
  4. 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.
A push to your live theme changes your storefront straight away. There’s no draft step, whatever flags you add: --force only skips validation and the merge check, and --auto-baseline only records a baseline. To review changes before shoppers see them, push with --unpublished, work in fluid theme dev, or publish to the theme’s staging branch, share its preview link, and promote it when it’s right.

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 --publish refuses 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 pull refuses 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:
Push your local changes to a new unpublished theme so you can preview them before anything goes live:
Start the local dev server for active development:

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.
--theme syncs your local edits into the theme you name. Point it at the live theme only when you mean to change what shoppers see.

Preview member pages

Member pages live on the account subdomain, not the storefront, so the dev server serves them under /_members:
  1. Open http://127.0.0.1:9292/_members. It lists each member site in the theme with its pages, including drafts.
  2. 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>.
A member page URL needs 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:
The default destination is .agents/skills/ in your current project. Existing skills remain untouched unless you approve the overwrite. Choose a different destination with --dir or -d:
Overwrite existing copies without a prompt with --force or -f:
Restart your agent session after installation so it can discover the new skills.

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

The dev server proxies requests to your local theme files, so you can see changes in the browser instantly as you save.
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: