tiendu
v0.9.2
Published
CLI para desarrollar y publicar temas en Tiendu
Maintainers
Readme
tiendu
Official CLI for Tiendu — develop and publish storefront themes from your local machine.
Download your store's theme, edit files locally, preview changes with a sharable preview URL, and publish when you're ready — all from the terminal.
Requirements
- Node.js 20 or higher
- A Tiendu store
- A Tiendu API key (request one at [email protected])
Installation
npm install -g tienduQuick start
Simple theme
mkdir my-theme && cd my-theme
tiendu init
tiendu stores list
tiendu stores set <store-id>
tiendu pull
tiendu devPipeline-enabled theme
Clone the default theme template, connect to your store, and start developing:
git clone <default-theme-repo> my-theme && cd my-theme
npm install
tiendu init
tiendu stores list
tiendu stores set <store-id>
tiendu devAgent-friendly setup
tiendu init <api-key> [base-url] --non-interactive
tiendu stores list --non-interactive
tiendu stores set <store-id> --non-interactiveWhen --non-interactive is passed, the CLI avoids prompts and prints plain text output.
tiendu dev creates or attaches a remote preview, builds or stages your theme into dist/, runs an initial push from that prepared output, and then watches for changes. It prints a sharable preview URL like:
http://preview-xxxxxxxxxxxx.tiendu.uy/The preview renders with the real Tiendu engine — same output as production.
When tiendu dev starts, it always re-syncs your current local files to the active preview before watching for changes.
For dev, push, pull, and publish, choose how theme state is handled with --preserve-state or --override-state. Interactive runs ask when neither flag is passed. Non-interactive runs require one of the two flags. State files are templates/*.json, section group files like sections/header-group.json, and config/settings_data.json.
Commands
tiendu init [apiKey] [baseUrl]
Initializes a theme project in the current directory.
- With no arguments, it runs the interactive setup wizard.
- With
apiKeyand optionalbaseUrl, it reinitializes the saved config without prompts. - If only one store is available, it is selected automatically.
- If multiple stores are available, leave the store unset and use
tiendu stores listplustiendu stores set <id>.
tiendu init
tiendu init <api-key>
tiendu init <api-key> https://tiendu.uy --non-interactiveAdd
.cli/to your.gitignoreif you version-control your theme — it contains your API key.
tiendu stores list
Lists all stores available for the configured API key and highlights the active one when present.
tiendu stores list
tiendu stores list --non-interactivetiendu stores set <storeId>
Validates the store against the configured API key and saves it as the active store.
tiendu stores set 123
tiendu stores set 123 --non-interactivetiendu pull
Downloads the attached preview theme, or the live theme with --live, into dist/ and syncs theme directories to src/.
pullclearsdist/first.- The downloaded archive is then extracted into
dist/. - Theme directories from the download are synced into
src/, overwriting local theme files. - In interactive mode, the CLI asks before overwriting
src/and asks whether to preserve or override state when no state flag is passed. - In non-interactive mode, pass either
--preserve-stateor--override-state;src/is overwritten without prompting.
tiendu pull
tiendu pull --live
tiendu pull --preserve-state
tiendu pull --override-statetiendu build
Builds or stages the current theme into its deployable output directory (dist/).
- Theme files and assets are always prepared into
dist/. - Optional pipeline steps are enabled through
tiendu.config.json. - With no config file, or with no enabled pipeline steps,
buildjust stages the theme files intodist/.
tiendu build
tiendu build --override-state- By default,
buildomits editor-managed state files fromdist/. - Use
--override-stateto include template JSON, section group JSON, andconfig/settings_data.jsonindist/. --include-instancesis still accepted as a deprecated alias for--override-state.--skip-instancesis still accepted as a deprecated alias for the default preserve behavior.
The build:
- Copies theme files from
src/layout/,src/templates/,src/sections/,src/blocks/,src/snippets/, andsrc/config/todist/ - Flattens static files from
src/assets/intodist/assets/ - Optionally discovers script and style entry points in
src/layout/andsrc/templates/ - Optionally compiles JS/TS and CSS into
dist/assets/ - Optionally runs project PostCSS plugins for compiled CSS entries
For TypeScript source, extensionless relative imports such as import { initHeaderCart } from '../lib/scripts/cart' are supported and recommended.
Entry naming convention:
src/layout/theme.ts→dist/assets/layout-theme.bundle.jssrc/templates/product.ts→dist/assets/template-product.bundle.jssrc/layout/theme.css→dist/assets/layout-theme.bundle.css
tiendu dev
The main development command.
- Runs
tiendu buildin watch mode first. - Watches
dist/and syncs changes to the preview.
tiendu dev
tiendu dev --override-state
tiendu dev --preserve-state- In interactive mode,
devasks whether to preserve or override theme state when no state flag is passed. - In non-interactive mode, pass either
--preserve-stateor--override-state. - Use
--preserve-stateto keep template JSON, section group JSON, andconfig/settings_data.jsonon the preview so theme editor changes are not overwritten. - Use
--override-stateto sync those state files from your local project too. - Prints the preview URL on start
- Re-syncs the full local theme to the preview on startup
- Syncs file creates, edits and deletes
- Retries failed file sync operations up to 3 times before giving up
- Handles both text and binary files (images, fonts, etc.)
- Press
Ctrl+Cto stop
tiendu push
Zips and uploads dist/ to the active preview, replacing its content entirely.
- By default it runs
tiendu buildfirst. - Use
--skip-buildto upload the existingdist/artifact without rebuilding.
tiendu push
tiendu push --skip-build
tiendu push --skip-build --preserve-state --non-interactive
tiendu push --override-state
tiendu push --preserve-state- In interactive mode,
pushasks whether to preserve or override theme state when no state flag is passed. - In non-interactive mode, pass either
--preserve-stateor--override-state. - Use
--preserve-stateto upload code/assets while preserving editor-managed state on the preview. - Use
--override-stateto upload local template JSON, section group JSON, andconfig/settings_data.json.
tiendu publish
Publishes the active preview to the live storefront. Visitors will see the new theme immediately. Existing previews are kept after publishing.
- By default it runs
tiendu build, uploadsdist/to the preview, and then publishes it. - Use
--skip-buildto publish after syncing the existingdist/output.
tiendu publish
tiendu publish --skip-build
tiendu publish --skip-build --preserve-state --non-interactive
tiendu publish --override-state
tiendu publish --preserve-state- In interactive mode,
publishasks whether to preserve or override theme state when no state flag is passed. - In non-interactive mode, pass either
--preserve-stateor--override-state. - Use
--preserve-stateto sync code/assets before publishing while preserving editor-managed state. - Use
--override-stateto publish local template JSON, section group JSON, andconfig/settings_data.json.
In non-interactive mode, the publish confirmation is skipped.
tiendu check-updates
Checks npm for a newer tiendu version on demand.
tiendu check-updatestiendu --version / tiendu -v
Prints the current CLI version.
tiendu --version
tiendu -vtiendu preview create [name]
Creates a new remote preview.
tiendu preview create
tiendu preview create "Winter campaign"tiendu preview list
Lists all previews for your store.
tiendu preview listtiendu preview delete
Deletes the active preview (both remotely and from your local config).
tiendu preview delete
tiendu preview delete --non-interactivetiendu preview open
Opens the active preview URL in your default browser.
tiendu preview openTypical workflow
Standard
tiendu init # one time: connect to your Tiendu account
tiendu stores list # one time: see available stores
tiendu stores set # one time: select the store to work on
tiendu pull # one time: refresh dist/ from the live theme
tiendu dev # develop: build/stage into dist/, sync preview updates live
tiendu publish # when ready: push to the live storefrontPipeline-enabled
git clone <template-repo> my-theme
cd my-theme && npm install
tiendu init # one time: connect to your Tiendu account
tiendu stores list # one time: see available stores
tiendu stores set # one time: select the store to work on
tiendu dev # develop: builds src/, watches dist/, syncs to preview
tiendu publish # when ready: push to the live storefrontHow previews work
A theme preview is a remote copy of your theme hosted by Tiendu. It renders with the exact same engine as your live storefront — same Liquid templates, same data, same assets — so what you see in the preview is exactly what production will look like.
- One preview per user per store
- Preview URLs are stable and shareable
- Previews are excluded from search engines (
noindex) - Analytics are disabled in preview mode so test traffic doesn't pollute your metrics
- Cart and checkout work normally in previews (orders placed in a preview are real orders)
Pipeline-enabled themes
All themes are staged into dist/ before upload.
tiendu.config.json can optionally enable extra pipeline steps such as script compilation, style compilation, and PostCSS processing.
When pipeline steps are enabled, a theme can use:
- npm packages via a local
package.json - TypeScript (
.ts) for browser code - JS bundling (multiple modules → single versioned bundle)
- CSS bundling (
@importsupport)
Project structure
my-theme/
├── tiendu.config.json # optional pipeline flags
├── package.json # npm dependencies
├── .gitignore
├── src/
│ ├── layout/
│ │ ├── theme.liquid # copied to dist/layout/theme.liquid
│ │ ├── theme.ts # layout TS entry → layout-theme.bundle.js
│ │ └── theme.css # layout CSS entry → layout-theme.bundle.css
│ ├── templates/
│ │ ├── product.liquid # copied to dist/templates/product.liquid
│ │ ├── product.ts # template TS entry → template-product.bundle.js
│ │ └── product.css # template CSS entry → template-product.bundle.css
│ ├── snippets/ # Liquid snippets copied to dist/snippets/
│ ├── assets/ # source assets → flattened into dist/assets/
│ ├── lib/ # shared modules (bundled into entries, not served)
│ └── css/ # shared CSS (imported by entry CSS)
└── dist/ # staged upload artifact (gitignored, uploaded to Tiendu)How it works
- Theme files and static assets are staged into
dist/ - Script entries are compiled only when
pipeline.compileScriptsis enabled - Style entries are compiled only when
pipeline.compileStylesis enabled - PostCSS runs only when
pipeline.postcssis enabled dist/is what gets uploaded — it looks like a normal Tiendu theme- Liquid templates reference bundles and assets via
asset_urlwhen compiled entries are used
Tailwind v4
Pipeline-enabled themes can use Tailwind v4 in CSS entry files when pipeline.compileStyles and pipeline.postcss are enabled.
Install it in your theme project:
npm install -D tailwindcss @tailwindcss/postcss postcssThen import Tailwind from a CSS entry such as src/layout/theme.css:
@import "tailwindcss";You can either:
- rely on Tiendu CLI's automatic Tailwind detection when
@tailwindcss/postcssis installed, or - add a local
postcss.config.mjs/postcss.config.js/postcss.config.cjs/postcss.config.json
Example postcss.config.mjs:
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};tiendu.config.json
Config is optional. When present, you can enable pipeline steps explicitly:
{
"pipeline": {
"compileScripts": true,
"compileStyles": true,
"postcss": true
}
}Without enabled pipeline steps, the CLI still stages the theme into dist/, but it skips compilation and PostCSS.
With no tiendu.config.json, the behavior is the same as having all pipeline steps disabled.
License
MIT — see LICENSE.
