@teacss/cli
v0.5.2
Published
Command-line interface for TeaCSS — scan content and generate CSS, with watch mode.
Readme
@teacss/cli
Generate a standalone TeaCSS stylesheet from the command line.
npm install --save-dev @teacss/cli
npx teacss "src/**/*.{ts,tsx,html}" -o tea.css
npx teacss "src/**/*.{ts,tsx,html}" -o tea.css --watch
npx teacss --checkUse the equivalent local-binary command for pnpm, Yarn, or Bun. Run
teacss --help for all options.
Configuration comes from index.css, src/index.css, or
package.json#teacss.entry:
@preset "standard";
@source "./src/**/*.{ts,tsx,html}";
@teacss;The CLI never selects a preset implicitly. Without a CSS entry, pass
--preset standard. --check prints the resolved project, entry, presets,
sources, rules, and shortcuts without writing CSS.
Source transformers may produce an empty file; its original classes then emit
no utilities. --rewrite writes that empty result back to the source, while
normal generation leaves the source file intact.
Programmatic watch
import { build } from "@teacss/cli";
const session = await build({
patterns: ["src/**/*.{ts,tsx,html}"],
outFile: "tea.css",
watch: true,
});
await session.dispose();Each session owns its watcher. Disposal cancels queued builds and waits for active work. Recoverable watch errors are reported without changing the host process exit code; startup failures still set the CLI exit status.
Use a build adapter when another tool owns the module graph. Class sorting is editor-owned, not a CLI command.
Pre-1.0.
