references
cli

CLI Reference

You can use the Command-Line Interface (CLI) provided by Panda to develop, build, and preview your project from a terminal window.

Use Panda's Command-Line Interface (CLI) to develop, build, and preview your project from a terminal.

init

Initialize Panda in a project. This process will:

  • Create a panda.config.ts file in your project with the default settings and presets.
  • Emit CSS utilities for your project in the specified output directory.
FlagDescriptionRelated
--interactive, -iWhether to run the interactive mode-
--force, -fWhether to overwrite existing files-
--postcss, -pWhether to emit a postcss (opens in a new tab) config file-
--config, -c <path>Path to Panda config fileconfig
--cwd <dir>Path to current working directory-
--silentWhether to suppress all output-
--no-gitignoreWhether to update gitignore with the output directory-
--no-codegenWhether to run the codegen process-
--out-extension <ext>The extension of the generated js files (default: 'mjs')config.outExtension
--outdir <dir>The output directory for the generated filesconfig.outdir
--jsx-framework <framework>The jsx framework to useconfig.jsxFramework
--syntax <syntax>The css syntax preferenceconfig.syntax
--strict-tokensSet strictTokens to trueconfig.strictTokens
--logfile <file>Outputs logs to a fileDebugging

panda

Run the extract process to generate static CSS from your project.

By default it will scan and generate CSS for the entire project depending on your include and exclude options from your config file.

pnpm panda
# You can also scan a specific file or folder
# using the optional glob argument
pnpm panda src/components/Button.tsx
pnpm panda "./src/components/**"
FlagDescriptionRelated
--outdir, -o [dir]The output directory for the generated CSS utilitiesconfig.outdir
--minify, -mWhether to minify the generated CSSconfig.minify
--watch, -wWhether to watch for changes in the projectconfig.watch
--pollWhether to poll for file changesconfig.poll
--config, -c <path>The path to the config fileconfig
--cwd <path>The current working directoryconfig.cwd
--preflightWhether to emit the preflight or reset CSSconfig.preflight
--silentWhether to suppress all outputconfig.logLevel
--exclude, -e <files>Files to exclude from the extract processconfig
--cleanWhether to clean the output directory before emittingconfig.clean
--hashWhether to hash the output classnamesconfig.hash
--lightningcssUse lightningcss instead of postcss for css optimizationconfig.lightningcss
--polyfillPolyfill CSS @layers at-rules for older browsersconfig.polyfill
--emitTokensOnlyWhether to only emit the tokens directoryconfig.emitTokensOnly
--cpu-profGenerate a panda-{command}-{timestamp}.cpuprofile file for profilingDebugging
--logfile <file>Outputs logs to a fileDebugging

codegen

Generate new CSS utilities for your project based on the configuration file.

FlagDescriptionRelated
--silentWhether to suppress all outputconfig.logLevel
--cleanWhether to clean the output directory before emittingconfig.clean
--config, -c <path>Path to Panda config fileconfig
--watch, -wWhether to watch for changes in the projectconfig.watch
--poll, -pWhether to poll for file changesconfig.poll
--cwd <path>Current working directoryconfig.cwd
--cpu-profGenerate a panda-{command}-{timestamp}.cpuprofile file for profilingDebugging
--logfile <file>Outputs logs to a fileDebugging

cssgen

Generate the CSS from files.

You can use a glob to override the config.include option like this:

panda cssgen "src/**/*.css" --outfile dist.css

or you can use it with a {type} argument to generate only a specific type of CSS:

  • preflight
  • tokens
  • static
  • global
  • keyframes
💡

Note that this only works when passing an --outfile.

You can use it like this:

panda cssgen "static" --outfile dist/static.css
FlagDescriptionRelated
--outfile, -o <file>Output file for extracted css, default to './styled-system/styles.css'-
--silentWhether to suppress all outputconfig.logLevel
--minify, -mWhether to minify the generated CSSconfig.minify
--cleanWhether to clean the output directory before emittingconfig.clean
--config, -c <path>Path to Panda config fileconfig
--watch, -wWhether to watch for changes in the projectconfig.watch
--minimalSkip generating CSS for theme tokens, preflight, keyframes, static and global css-
--poll, -pWhether to poll for file changesconfig.poll
--cwd <path>Current working directoryconfig.cwd
--lightningcssUse lightningcss instead of postcss for css optimizationconfig.lightningcss
--polyfillPolyfill CSS @layers at-rules for older browsersconfig.polyfill
--cpu-profGenerate a panda-{command}-{timestamp}.cpuprofile file for profilingDebugging
--logfile <file>Outputs logs to a fileDebugging

studio

Realtime documentation for your design tokens.

FlagDescriptionRelated
--buildBuild-
--previewPreview-
--port <port>Use custom port-
--hostExpose to custom host-
--config, -c <path>Path to Panda config fileconfig
--cwd <path>Current working directoryconfig.cwd
--outdir <dir>Output directory for static files-
--base <path>Base path of project-

analyze

Analyze design token and recipe usage.

By default, it will analyze your project based on the include and exclude config options.

pnpm panda analyze
 
# analyze a specific file
pnpm panda analyze src/components/Button.tsx
 
# analyze a specific glob
pnpm panda analyze "src/components/**"
FlagDescriptionRelated
--outfile <filepath>Output analyze report in given JSON filepath-
--silentWhether to suppress all outputconfig.logLevel
--config, -c <path>Path to Panda config fileconfig
--cwd <path>Current working directoryconfig.cwd

debug

Debug design token extraction & CSS generated from files in glob.

More details in Debugging docs.

FlagDescriptionRelated
--silentWhether to suppress all output-
--dryOutput debug files in stdout without writing to disk-
--outdir <dir>Output directory for debug files, defaults to ../styled-system/debug-
--only-configShould only output the config file, default to 'false'-
--config, -c <path>Path to Panda config fileconfig
--cwd <path>Current working directoryconfig.cwd
--cpu-profGenerate a panda-{command}-{timestamp}.cpuprofile file for profilingDebugging
--logfile <file>Outputs logs to a fileDebugging

ship

Ship extract result from files in glob.

By default it will extract from the entire project depending on your include and exclude options from your config file.

pnpm panda ship
# You can also analyze a specific file or folder
# using the optional glob argument
pnpm panda ship src/components/Button.tsx
pnpm panda ship "./src/components/**"
FlagDescriptionRelated
--outfile <filepath>Output path for the JSON build info file, default to './styled-system/panda.buildinfo.json'-
--silentWhether to suppress all outputconfig.logLevel
--minify, -mWhether to minify the generated JSON-
--config, -c <path>Path to Panda config fileconfig
--cwd <path>Current working directoryconfig.cwd
--watch, -wWhether to watch for changes in the projectconfig.watch
--poll, -pWhether to poll for file changesconfig.poll

emit-pkg

Emit package.json with entrypoints, can be used to create a workspace package dedicated to the config.outdir, in combination with config.importMap

FlagDescriptionRelated
--outdir <dir>The output directory for the generated CSS utilitiesconfig.outdir
--base <path>The base directory of the package.json entrypoints-
--silentWhether to suppress all outputconfig.logLevel
--cwd <path>Current working directoryconfig.cwd