one-file-cli
Version:
Run shadcn/ui React components instantly with zero config - perfect for quick prototypes
126 lines (96 loc) โข 3.11 kB
Markdown
# 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