Vue.js component generator for design systems. Scaffolds complete component structures with Vue 2/3 templates, styles, and tests.
- π Fast Component Generation: Instant Vue component scaffolding with complete structure
- π― Vue 2/3 Support: Auto-detects version from package.json or force specific syntax
- π Complete Structure: Creates component, index, style, and test files with proper organization
- π Automatic Documentation: Generates VuePress documentation with examples and API reference
- β‘ Dual Interface: CLI commands and programmatic JavaScript API for automation
- π‘οΈ Safe Operations: Dry-run preview, force overwrite, and existence checking
- π§ Highly Customizable: Custom directories, naming conventions, file extensions, and templates
- π Clean Output: Professional CLI interface with hierarchical progress indicators
Current Scope: Vue component generation with complete structure. Future versions will support services, stores, pages, and more scaffold types.
The automatic VuePress documentation generation has specific requirements:
- π Vue Version: Only supports Vue 2 projects
- π VuePress: Designed for VuePress v1 compatibility
- π« Vue 3 Limitation: Documentation generation is automatically disabled for Vue 3 projects
Note: When Vue 3 is detected (auto-detected or forced with
--vue3), documentation generation will be skipped with a warning. Use--no-docsto explicitly disable documentation generation.
# npm
npm install -g shuri-cli
# yarn
yarn global add shuri-cli# npm
npm install --save-dev shuri-cli
# yarn
yarn add --dev shuri-cli# Create a basic Vue component
shuri-cli new MyButton
# Create component with SCSS styles (style included by default)
shuri-cli new MyButton --style-ext scss
# Create component with all options
shuri-cli new MyButton --style-ext scss --out ./src/ui --verboseCreates a complete component structure with all necessary files:
src/components/MyButton/
βββ index.js # Export file for easy imports
βββ MyButton.vue # Vue component file
βββ MyButton.scss # Stylesheet (css/scss/sass/less/styl)
βββ MyButton.unit.js # Unit test file (.unit.js/.spec.js)
docs/ # π Auto-generated documentation
βββ components/
β βββ my-button.md # Component documentation
βββ examples/my-button/
β βββ my-button-example.vue # Usage example
βββ components-api/
β βββ my-button-api.js # API reference
βββ .vuepress/
βββ config.js # Auto-updated sidebar
shuri-cli new <name> [options]Note: Currently only supports component generation. Future versions may include other scaffold types.
| Option | Description | Default | Details |
|---|---|---|---|
-r, --root <root> |
Root directory name | Component name | Change the root dir name |
--vue2 |
Use Vue 2 template | Vue 3 | Forces Vue 2 syntax (options API) |
--vue3 |
Use Vue 3 template | β | Forces Vue 3 syntax (composition API) |
--style-ext <ext> |
Style extension | scss |
css, scss, sass, less, styl |
--test-ext <ext> |
Test extension | .unit.js |
.unit.js, .spec.js, .ts |
--kebab |
Use kebab-case naming | PascalCase | Changes file/folder naming convention |
--no-style |
Skip style file | includes style | Won't create style file |
--no-test |
Skip test file | includes test | Won't create test file |
--no-docs |
Skip documentation | includes docs | Won't create VuePress docs |
--backup |
Create backups | false |
Backs up modified config files |
-o, --out <path> |
Output directory | src/components |
Custom output path (relative or absolute) |
-f, --force |
Overwrite existing | false |
Overwrites existing files without prompt |
--dry-run |
Preview without creating | false |
Shows what would be created |
-v, --verbose |
Detailed output | false |
Shows detailed creation process |
Shuri CLI is flexible with component naming and automatically converts between formats:
| Input Format | Example | Output Directory | Output Files |
|---|---|---|---|
| PascalCase | UserButton |
UserButton/ |
UserButton.vue |
| camelCase | userButton |
UserButton/ |
UserButton.vue |
| kebab-case | user-button |
UserButton/ |
UserButton.vue |
| snake_case | user_button |
UserButton/ |
UserButton.vue |
| space separated | "user button" |
UserButton/ |
UserButton.vue |
Use
--kebabflag to output kebab-case files:user-button/user-button.vue
- Vue Version: Auto-detects from
package.jsondependencies - Project Structure: Adapts to your existing folder structure
- Smart Defaults: Uses sensible defaults based on your project
# All these create the same component structure
shuri-cli new UserCard # PascalCase
shuri-cli new userCard # camelCase
shuri-cli new user-card # kebab-case
shuri-cli new user_button # snake_case
shuri-cli new "user card" # space separatedshuri-cli new UserCardβ‘οΈ Creates:
src/components/UserCard/
βββ index.js
βββ UserCard.vue
βββ UserCard.scss
βββ UserCard.unit.js
shuri-cli new SuperDuperClockComponent --root clockβ‘οΈ Creates:
# src/components/SuperDuperClockComponent/ β
src/components/clock/ β
β
β
βββ index.js
βββ SuperDuperClockComponent.vue
βββ UsSuperDuperClockComponenterCard.styl
βββ SuperDuperClockComponent.unit.js
# Supports multiple preprocessors
shuri-cli new UserCard --style-ext stylβ‘οΈ Creates:
src/components/UserCard/
βββ index.js
βββ UserCard.vue
βββ UserCard.styl
βββ UserCard.unit.js
# Relative paths
shuri-cli new UserCard --out components/ui
shuri-cli new UserCard --out src/shared/components
# Absolute paths
shuri-cli new UserCard --out /path/to/components
# Nested structures
shuri-cli new UserCard --out src/features/user/componentsshuri-cli new UserCard --kebab --no-styleβ‘οΈ Creates:
src/components/user-card/
βββ index.js
βββ user-card.vue
βββ user-card.unit.js
# Force Vue 2 syntax (Options API)
shuri-cli new UserCard --vue2 --style-ext scss
# Force Vue 3 syntax (Composition API)
shuri-cli new UserCard --vue3 --style-ext scssShuri CLI automatically generates VuePress documentation for every component:
β οΈ Vue 2 Only: Documentation generation is only available for Vue 2 projects and VuePress v1. Vue 3 projects will automatically skip documentation generation.
# Generate component with full documentation (Vue 2 projects only)
shuri-cli new UserCard --verboseβ‘οΈ Creates Documentation:
docs/
βββ components/user-card.md # π Component documentation
βββ examples/user-card/
β βββ user-card-example.vue # π― Live example
βββ components-api/
β βββ user-card-api.js # π API reference
βββ .vuepress/config.js # βοΈ Auto-updated sidebar
# Create component without documentation
shuri-cli new UserCard --no-docs# Vue 3 components (documentation automatically disabled)
shuri-cli new UserCard --vue3 --verbose
# Output: β οΈ Aviso: GeraΓ§Γ£o de documentaΓ§Γ£o nΓ£o suportada para Vue 3
# Vue 3 with explicit no-docs (cleaner output)
shuri-cli new UserCard --vue3 --no-docs --verbose# Create backups of modified config files
shuri-cli new UserCard --backup --verbose# Use custom root name for documentation paths
shuri-cli new "Super Complex Button" --root simple-button --verboseβ‘οΈ Creates:
docs/
βββ components/simple-button.md # π Uses --root name
βββ examples/simple-button/ # π― Organized structure
βββ components-api/simple-button-api.js # π Clean API paths
# Preview without creating files
shuri-cli new "Navigation Menu" --style-ext scss --dry-run --verbose
# Component without test file
shuri-cli new UserCard --style-ext scss --no-test
# Component without style file
shuri-cli new UserCard --no-style
# Component without documentation
shuri-cli new UserCard --no-docs
# Component with backup of modified config files
shuri-cli new UserCard --backup --verbose
# Complex example with all options
shuri-cli new "Shopping Cart Item" \
--root cart-item \
--style-ext scss \
--test-ext .spec.js \
--kebab \
--out src/features/shopping/components \
--vue3 \
--backup \
--verbose \
--force
# Documentation-focused component creation
shuri-cli new "Complex Data Table" \
--root data-table \
--style-ext scss \
--backup \
--verboseconst shuri = require('shuri-cli');
// Create component programmatically
const result = await shuri.run(['new', 'MyButton'], {
out: './src/components',
styleExt: 'scss',
testExt: '.spec.js',
force: true
});
console.log(result);
// { created: true, path: './src/components/MyButton' }await shuri.run(['new', 'ComponentName'], {
root: 'ComponentName', // Root folder name
out: './custom/path', // Output directory
styleExt: 'scss', // Style extension (default: 'scss')
testExt: '.spec.js', // Test extension (default: '.unit.js')
noStyle: false, // Skip style file
noTest: false, // Skip test file
noDocs: false, // Skip documentation generation
backup: false, // Create backups of modified files
force: true, // Overwrite existing
dryRun: false, // Preview mode
kebab: false, // Use kebab-case
vue2: false, // Use Vue 2 template
vue3: true, // Use Vue 3 template
verbose: false // Detailed output
});Notes: the template generation is based on the Vue version of the project.
<template>
<div class="component-name">
<!-- Component content goes here -->
</div>
</template>
<script setup>
defineOptions({
name: "ComponentName"
})
props: defineProps({})
</script>
<style scoped>
/* styles */
</style><template>
<div class="component-name">
<!-- Component content goes here -->
</div>
</template>
<script>
export default {
name: 'ComponentName',
props: {}
};
</script>
<style scoped>
/* styles */
</style>Shuri CLI integrates seamlessly with VuePress to generate comprehensive documentation:
β οΈ Important: Documentation generation is only available for Vue 2 projects and requires VuePress v1. Vue 3 projects will automatically skip documentation generation with a warning message.
- Component Docs: Markdown files with usage examples and props documentation
- Live Examples: Interactive Vue components showcasing usage
- API Reference: JavaScript files with component API documentation
- Auto-Updated Config: VuePress sidebar automatically includes new components
- Automatic Sidebar: New components are added to VuePress navigation
- Alphabetical Ordering: Components are sorted alphabetically in README
- Path Management: Uses correct
/components/nameformat for VuePress - Backup System: Optional backups of configuration files
docs/
βββ components/ # Main documentation
β βββ component-name.md
βββ examples/ # Live examples
β βββ component-name/
β βββ component-name-example.vue
βββ components-api/ # API documentation
β βββ component-name-api.js
βββ .vuepress/ # VuePress configuration
βββ config.js # Auto-updated sidebar
- Vue Version: Automatically detects from
package.json - Smart Naming: Converts between PascalCase and kebab-case
- File Structure: Creates organized component directories
- Documentation Paths: Generates clean, SEO-friendly documentation URLs
# Clone repository
git clone https://github.com/amendx/shuri-cli.git
cd shuri-cli
# Install dependencies
npm install
# Link for local development
npm link
# Run tests
npm testMIT Β© amendx
Made with β€οΈ for Vue.js developers