Litestar Assets CLI
Overview
Standardize all frontend operations through litestar assets to keep Python and Vite in sync.
Command Map
# Install frontend deps
litestar assets install
# Dev server (managed by Litestar)
litestar assets serve
# Production build
litestar assets build
# SSR production server (framework/ssr modes)
litestar assets serve --production
# Diagnostics
litestar assets status
litestar assets doctor
# Type generation
litestar assets generate-types
litestar assets export-routes
Recommended Flows
Development (single-port)
litestar assets serve
litestar run
Development (two-port)
litestar assets serve
litestar run --reload
Production (static assets)
litestar assets build
litestar run
Production (SSR)
litestar assets build
litestar assets serve --production
litestar run
Testing and E2E Guidance
- Always use
litestar assetscommands in tests. Do not callnpm run devornpm run build. - Use
litestar assets statusbefore E2E tests to validate bridge config. - Use
litestar assets doctorwhen diagnosing missing Node executors, port conflicts, or malformed config.
Common Pitfalls
- Running npm scripts directly (bypasses Litestar integration layer).
- Starting Vite on a port that does not match
.litestar.json. - Building assets without
litestar assets buildand then expecting Litestar to serve them.
Related Files
src/py/litestar_vite/cli.pysrc/py/litestar_vite/commands.pysrc/py/litestar_vite/executor.pyspecs/guides/testing.md
Official References
- https://litestar-org.github.io/litestar-vite/usage/vite.html
- https://litestar-org.github.io/litestar-vite/usage/types.html
- https://litestar-org.github.io/litestar-vite/changelog.html
- https://pypi.org/project/litestar-vite/
- https://github.com/litestar-org/litestar-vite/blob/main/src/py/litestar_vite/cli.py
Shared Styleguide Baseline
- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.
- General Principles
- Litestar
- Python
- TypeScript
- Keep this skill focused on tool-specific workflows, edge cases, and integration details.
微信扫一扫