Developing, validating, and publishing themes with Daras CLI
Theme commands (daras theme ...) delegate to @daras/theme-kit using your active CLI profile; a theme is a directory structure (layout, templates, sections, snippets, locales, assets, theme.json).
Steps
- Scaffold a new theme:
daras theme init my-theme --name "My Store" --author "Team Name". - Enter the directory and start the local development server:
daras theme dev(default port 4477). If you want to work with real store data, add--api <url> --store <id>. - When you save files and refresh the page in your browser, the preview re-renders with the updated files; the page does not auto-reload.
- Validate the package before publishing:
daras theme validate— reports security, structure, schema, and syntax errors; pass--jsonfor machine-readable output. - Run
daras theme cssto compile the Tailwind source (assets/tailwind.css→assets/theme.css). - Run
daras theme pushto upload the package to the store as a draft; this command automatically runs the CSS build andvalidatefirst, and aborts the upload if validation fails. - Publish the draft live using the returned package ID:
daras theme deploy <packageId>. - If you want to download a published package back to your filesystem, run
daras theme pull <packageId> --out <dir>; use--dry-runto preview the diff first, or--forceto overwrite locally modified files.
Tips
- The
push/pull/deploycommands use theDARAS_API_URL,DARAS_API_TOKEN, andDARAS_STORE_IDenvironment variables or your activedaras envprofile. - Run
daras theme docsto view the complete theme language reference.