Making A CLI with Vite (...kind of)
summary
A Vite SPA is packaged to run inside a CLI: the project serves the built web UI from the CLI process via Fastify and exposes file access and logs over trpc and websockets, with TypeScript types inferred end-to-end. Build pipeline uses Vite for the UI, NCC to produce a single-file Node bundle and tsup for additional packaging, copying the web dist into the CLI and rewriting routes. Output is a published package with no node_modules at runtime, and the setup works as a local webhook tester.
AI-written summary · about
chapters (8)
- 0:00Introduction to Vite CLI
- 1:24Introducing Web Hook Thing
- 3:09Monorepo and CLI Core
- 5:54Web App with Vite
- 7:38Fastify Server Integration
- 8:18Bundling with NCC
- 10:44Final Build Output
- 11:46Demo and Conclusion








