tiendu
v0.5.0
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 live with a local auto-reloading URL plus 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
Buildless theme (simple)
mkdir my-theme && cd my-theme
tiendu init
tiendu pull
tiendu devBuilt theme (TypeScript, npm packages, bundling)
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 devtiendu dev creates a remote preview, builds your source files, runs an initial push from the prepared output, and then watches for changes. It prints a local live-preview URL first, plus 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.
It also starts a local live-preview URL that proxies the preview and auto-reloads after successful syncs.
Commands
tiendu init
Initializes a theme project in the current directory. Prompts for your API key, API base URL (defaults to https://tiendu.uy), and store ID. Saves configuration to .cli/.
tiendu initAdd
.cli/to your.gitignoreif you version-control your theme — it contains your API key.
tiendu pull
Downloads the current live theme from your store as local files.
- Buildless themes: extracts to the current directory.
- Built themes (with
tiendu.config.json): extracts todist/.
tiendu pulltiendu build
Builds a theme into its deployable output directory (dist/). Only available for built themes (requires tiendu.config.json).
tiendu buildThe build:
- Copies theme files from
src/layout/,src/templates/, andsrc/snippets/todist/ - Flattens static files from
src/assets/intodist/assets/ - Discovers entry points in
src/layout/andsrc/templates/ - Bundles JS/TS and CSS into
dist/assets/ - Runs project PostCSS plugins for CSS entries when available (for example Tailwind v4)
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.
- Buildless themes: watches the current directory and syncs file changes to the preview.
- Built themes: runs
tiendu buildin watch mode first, then watchesdist/and syncs changes to the preview.
tiendu dev- 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
- Starts a local live-preview URL on
localhostthat refreshes after successful uploads - Handles both text and binary files (images, fonts, etc.)
- Press
Ctrl+Cto stop
tiendu push
Zips and uploads files to the active preview, replacing its content entirely.
- Buildless themes: uploads from the current directory.
- Built themes: runs
tiendu buildfirst, then uploads fromdist/.
tiendu push
tiendu push --skip-buildUse --skip-build to upload the existing dist/ output without rebuilding.
tiendu publish
Publishes the active preview to the live storefront. Visitors will see the new theme immediately. All previews for the store are removed after publishing.
- Buildless themes: publishes the active preview as-is.
- Built themes: builds the theme, uploads the latest
dist/output to the preview, then publishes it.
tiendu publish
tiendu publish --skip-buildUse --skip-build to publish after uploading the existing dist/ output without rebuilding.
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 deletetiendu preview open
Opens the active preview URL in your default browser.
tiendu preview openTypical workflow
Buildless
tiendu init # one time: connect to your store
tiendu pull # one time: download the live theme
tiendu dev # develop: edit locally, see changes live at the preview URL
tiendu publish # when ready: push to the live storefrontBuilt theme
git clone <template-repo> my-theme
cd my-theme && npm install
tiendu init # one time: connect to your store
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)
Built themes
A built theme is a theme that uses tiendu.config.json to enable the build pipeline. It allows:
- 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 # marks this as a built theme
├── 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/ # build output (gitignored, uploaded to Tiendu)How it works
- Source assets in
src/assets/are flattened intodist/assets/(payment-methods/visa.svgbecomespayment-methods___visa.svg) - Source JS/TS/CSS in
src/is bundled by esbuild intodist/assets/ - CSS entries also run through your local PostCSS pipeline when configured
- Liquid files are copied from
src/todist/ dist/is what gets uploaded — it looks like a normal Tiendu theme- Liquid templates reference bundles and assets via
asset_url(e.g.{{ 'layout-theme.bundle.js' | asset_url | script_tag }}or{{ 'payment-methods/visa.svg' | asset_url }})
Tailwind v4
Built themes can use Tailwind v4 in CSS entry files.
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
Minimal config — the build conventions are hardcoded:
{
"name": "my-theme",
"version": "1.0.0"
}License
MIT — see LICENSE.
