UNPKG

one-file-cli

Version:

Run shadcn/ui React components instantly with zero config - perfect for quick prototypes

126 lines (96 loc) โ€ข 3.11 kB
# one-file-cli ๐Ÿš€ Run shadcn/ui React components instantly with zero config. Perfect for quick prototypes and proof of concepts! ## Features โœจ Zero config setup - just run and go! ๐ŸŽจ Complete shadcn/ui component library pre-configured ๐Ÿ”ฅ Native Vite hot reload ๐ŸŽจ Tailwind CSS v4 pre-configured ๐Ÿงฉ TypeScript support out of the box ๐Ÿ”„ Auto cleanup when done ๐ŸŽฏ Direct file import - Vite handles everything ๐Ÿ“‚ Dual import aliases: @ (template) and ~ (local) ๐Ÿ—๏ธ Production build support ## Usage ### Check Version ```bash npx one-file-cli --version ``` ### Initialize (Run Once) ```bash npx one-file-cli init ``` This installs all dependencies in a shared template directory (~30 seconds). ### Run a Component ```bash npx one-file-cli main.tsx ``` Instantly starts a dev server with hot reload (< 3 seconds). ### Build for Production ```bash npx one-file-cli build main.tsx ``` Creates optimized production build in `./dist`. ## Import Aliases - `@/*` - Access shadcn components and utils (e.g., `@/components/ui/button`) - `~/*` - Access your local files (e.g., `~/components/hello`) ## Example Component ```tsx import { Button } from "@/components/ui/button" import { Card } from "@/components/ui/card" import { Input } from "@/components/ui/input" export default function App() { return ( <Card className="p-6 max-w-sm mx-auto mt-8"> <h1 className="text-2xl font-bold mb-4">Hello shadcn/ui</h1> <div className="space-y-4"> <Input placeholder="Enter something..." /> <Button>Click Me</Button> </div> </Card> ) } ``` ## Available Components All components from [shadcn/ui](https://ui.shadcn.com/docs/components) are pre-configured and ready to use: ### Form Components - Button - Input - Textarea - Select - Checkbox - Radio Group - Switch - Form ### Layout Components - Card - Dialog - Sheet - Tabs - Accordion - Hover Card - Popover - Dropdown Menu - Navigation Menu ### Data Display - Table - Avatar - Badge - Progress - Scroll Area - Separator And many more! Check out the [full list of components](https://ui.shadcn.com/docs/components). ## Why one-file-cli? - ๐Ÿš€ **Instant shadcn Setup**: All components ready to use with zero config - ๐Ÿ’พ **Save Space**: Share dependencies across projects - ๐Ÿงช **Perfect for POCs**: Quickly test shadcn/ui ideas without boilerplate - ๐Ÿงน **Clean Workspace**: Auto-cleanup after you're done ## License MIT ## Contributing Pull requests are welcome! Feel free to open an issue for bugs or feature requests. # TODO: - [ ] Tests - [ ] Custom Templates people can specify - [ ] Command to basically bring all the config files into the directory updating the package files to not use the one-file-cli and to use vite - [ ] Plugins ? Like on a template can specify if you want theme-selector.tsx component for example. - [ ] Maybe github repo for the template and you specify what one and can specify custom repo if you want