@bootcn-vue/cli
v0.6.2
Published
CLI for adding accessible, customizable Bootstrap + Vue 3 components to your project
Maintainers
Readme
@bootcn-vue/cli
CLI for adding Bootstrap + Vue 3 components to your project.
Installation
# Using npm
npm install -g @bootcn-vue/cli
# Using pnpm
pnpm add -g @bootcn-vue/cli
# Using npx (no installation required)
npx @bootcn-vue/cliUsage
Initialize bootcn-vue in your project
npx bootcn-vue initThis command will:
- Detect your Vue 3 + Vite project
- Ask for your
srcdirectory location - Create
bootcn.config.jsonconfiguration file - Update
tsconfig.jsonwith path aliases (@/*) - Update
vite.config.tswith path aliases - Create
src/lib/utils.tswith thecn()utility function - Create
src/components/ui/directory for components - Install required dependencies (bootstrap, reka-ui, cva, clsx, tailwind-merge)
Add components to your project
# Add a single component
npx bootcn-vue add button
# Add multiple components
npx bootcn-vue add button input
# Interactive mode - select from list
npx bootcn-vue addThis command will:
- Copy component files from
@bootcn-vue/buttonstosrc/components/ui/Button/ - Transform imports from package imports to local imports
- Make the component ready to use
Remove components from your project
# Remove a single component
npx bootcn-vue remove button
# Remove multiple components
npx bootcn-vue remove button input
# Interactive mode - select from list
npx bootcn-vue remove
# Remove ALL bootcn-vue setup (components, config, utils)
npx bootcn-vue remove --allThe remove --all command will:
- Delete all components in
src/components/ui/ - Delete
src/lib/utils.ts(andlib/directory if empty) - Delete
bootcn.config.json - Show command to uninstall dependencies
- Include safety confirmations before removing
Configuration
After running init, a bootcn.config.json file is created:
{
"$schema": "https://bootcn-vue.dev/schema.json",
"srcDir": "src",
"aliases": {
"components": "@/components",
"utils": "@/lib"
}
}Usage in your Vue app
After adding components:
<script setup lang="ts">
import { Button } from "@/components/ui/Button";
</script>
<template>
<Button variant="primary" size="lg"> Click me </Button>
</template>Requirements
- Vue 3
- Vite
- Node.js >= 20.0.0
Available Components
button- Button component with variants and sizes
More components coming soon!
License
MIT
