An enterprise-grade CLI scaffolding tool built with Monorepo architecture, supporting rapid creation of React/Vue project templates with built-in local and remote template fetching capabilities.
- ποΈ Monorepo Architecture: Built with pnpm workspace + Turborepo for efficient monorepo management
- π― Full TypeScript Stack: 100% TypeScript with complete type safety
- π Template System: Supports both local templates and remote GitHub template fetching, highly extensible
- π¨ Interactive CLI: Friendly interactive experience powered by Commander.js and Prompts
- π¦ Ready to Use: Built-in React-TS, Vue-TS, and other mainstream framework templates
- π§ Engineering Best Practices: Integrated ESLint, Prettier, Husky, Lint-staged toolchain
- β‘ High Performance Build: Fast builds and hot reload with tsup
- Language: TypeScript 5.5.4
- Package Manager: pnpm 10.12.1
- Build Tools: Turbo 2.0.12 + tsup 8.2.4
- CLI Framework: Commander.js 12.1.0
- Code Standards: ESLint 9.9.0 + Prettier 3.3.3
- Git Hooks: Husky 9.1.4 + Lint-staged 15.2.9
- Commit Convention: Commitizen (cz-git 1.9.4)
- Dependency Analysis: Madge 8.0.0
- Interactive Prompts: Prompts 2.4.2
- Logger: Consola 3.2.3
- Loading Spinner: Ora 8.0.1
- Color Support: Picocolors 1.0.1
- Template Download: Giget 1.2.3
- File Operations: fs-extra 11.2.0
# Global installation
npm install -g @simple/cli
# Or using pnpm
pnpm add -g @simple/clisimple create my-appThe CLI will prompt you to choose:
- Framework: Vue / React / Vanilla
- Template: TypeScript version
# Create React TypeScript project
simple create my-react-app -f react -t react-ts
# Create Vue TypeScript project
simple create my-vue-app -f vue -t vue-tssimple create my-app -r# View CLI information
simple info
# Build project
simple build
# Start development server
simple servecli-template/
βββ packages/
β βββ cli/ # CLI core package
β β βββ bin/
β β β βββ simple # CLI entry point
β β βββ src/
β β β βββ cli.ts # CLI main program
β β β βββ command/ # Command modules
β β β β βββ base/ # Base commands
β β β β β βββ create.ts # Create project command
β β β β β βββ build.ts # Build command
β β β β β βββ server.ts # Dev server command
β β β β β βββ info.ts # Info command
β β β β βββ types/ # Type definitions
β β β βββ constants/ # Constants configuration
β β β β βββ templates.ts # Template configuration
β β β βββ utils/ # Utility functions
β β β βββ loadTemplate.ts # Template loading logic
β β β βββ logger.ts # Logger utility
β β β βββ validateGivenFramework.ts
β β β βββ validateGivenTemplate.ts
β β βββ templates/ # Built-in templates
β β βββ template-react-ts/ # React TypeScript template
β β βββ template-vue-ts/ # Vue TypeScript template
β βββ core/ # Core utilities (to be expanded)
βββ apps/ # Application examples (to be expanded)
βββ package.json # Root configuration
βββ pnpm-workspace.yaml # pnpm workspace config
βββ turbo.json # Turborepo configuration
βββ tsconfig.json # TypeScript configuration
βββ eslint.config.mjs # ESLint configuration
Plugin-based command registration mechanism powered by Commander.js:
// Command registry
registerCommand(create) // Create project
registerCommand(build) // Build project
registerCommand(serve) // Start server
registerCommand(info) // View infoTwo template loading modes supported:
- Local Templates: Quick copy from built-in
templatesdirectory - Remote Templates: Fetch latest templates from GitHub using
giget
// Local template loading
await loadLocalTemplate({ projectName, template })
// Remote template loading
await loadRemoteTemplate({ projectName })Friendly user interaction powered by Prompts:
const { framework } = await prompts({
type: 'select',
choices: [
{ title: 'Vue', value: 'vue' },
{ title: 'React', value: 'react' }
],
message: 'What is your framework?'
})Auto-detect user's package manager (pnpm/npm) and choose appropriate commands:
const command = hasPnpm() ? 'pnpm' : 'npm'
const params = hasPnpm() ? ['dev'] : ['run', 'dev']- Node.js >= 18
- pnpm >= 10
# 1. Clone the repository
git clone <repository-url>
# 2. Install dependencies
pnpm install
# 3. Development mode (with hot reload)
pnpm dev
# 4. Build
pnpm build
# 5. Lint check
pnpm lint
# 6. Type check
pnpm typecheck
# 7. Dependency graph
pnpm graphDuring development, you can debug using:
# Link globally
cd packages/cli
pnpm link --global
# Use it
simple create test-app- pnpm workspace for multi-package dependency management
- Turborepo for parallel builds and incremental caching
- Support for cross-package references and unified version management
- ESLint: Automatic code standard checking
- Prettier: Unified code formatting
- TypeScript: Strict type checking
- Husky + Lint-staged: Pre-commit automatic checks
Integrated Commitizen for interactive commits:
pnpm commitAnalyze module dependencies using Madge:
pnpm graph- Plugin-based Command System: New commands only need to implement standard interfaces and register
- Decoupled Template System: Support for dynamically adding new framework templates
- Configuration-driven: Manage all templates through
templates.tsconfiguration file
- Friendly Error Messages: Highlight key information using picocolors
- Progress Feedback: Display loading states using ora
- Smart Defaults: Support both interactive selection and command-line arguments
- Lazy Loading: Dynamic import of command modules
- Parallel Building: Intelligent scheduling by Turborepo
- Incremental Compilation: Hot reload support with tsup watch mode
- Support more framework templates (Svelte, Solid, Nuxt, Next.js)
- Add plugin system for third-party templates
- Implement template marketplace with online browsing and downloading
- Integrate AI-assisted configuration (smart template recommendations based on requirements)
- Support project upgrade and migration commands
- Add performance monitoring and usage statistics
- Provide VSCode extension support
- Architecture Design: Monorepo architecture + modular design with clear code organization, easy to maintain and extend
- Engineering Capabilities: Complete frontend engineering toolchain including build, test, standard checks, and commit conventions
- TypeScript Practices: Comprehensive TypeScript usage demonstrating type safety and code quality awareness
- CLI Development Experience: Proficient use of Commander, Prompts and other CLI frameworks for excellent user experience
- Performance Optimization: Efficient Monorepo builds powered by Turborepo
- Best Practices: Following frontend engineering best practices with clean, readable code
ISC
Author: flexibility2
Use Cases: Enterprise frontend project initialization, team template management, rapid prototyping