@missionfabric-js/enzyme-cli
v1.0.0
Published
Enterprise CLI scaffolding tool for the Enzyme React framework
Maintainers
Readme
Enzyme CLI
Official command-line interface for scaffolding Enzyme React projects.
Note: This is the standalone CLI tool for Enzyme. For the main Enzyme framework, see enzyme.
Installation
npm install -g @missionfabric-js/enzyme-cliUsage
Create a New Project
enzyme new <project-name> [options]Options
-t, --template <name>- Template to use (minimal, standard, enterprise, full) [default: standard]-pm, --package-manager <manager>- Package manager (npm, yarn, pnpm, bun) [default: npm]--git- Initialize git repository [default: true]--no-git- Skip git initialization--install- Install dependencies after generation [default: true]--no-install- Skip dependency installation-f, --features <features>- Comma-separated list of features-o, --output <dir>- Output directory [default: current directory]
Examples
Create a standard project with npm:
enzyme new my-appCreate an enterprise project with pnpm:
enzyme new my-app --template enterprise --package-manager pnpmCreate a minimal project without git:
enzyme new my-app --template minimal --no-gitCreate a project with specific features:
enzyme new my-app --features auth,state,routing,monitoringTemplates
Minimal
A lightweight starter with basic enzyme setup.
Features:
- Theme support
- Single route
- Minimal dependencies
Use case: Small projects, prototypes, learning enzyme
Standard (Default)
Production-ready setup with essential features.
Features:
- File-system routing
- State management (Zustand)
- Server state (React Query)
- Theme system
- Basic error handling
Use case: Most projects, SPA applications
Enterprise
Advanced setup for large-scale applications.
Features:
- All standard features plus:
- Authentication with RBAC
- Feature flags
- Performance monitoring
- Real-time data (WebSocket)
- Full error boundaries
- API client setup
Use case: Enterprise applications, complex systems
Full
Complete showcase with all enzyme features and demo pages.
Features:
- Everything enzyme offers
- Demo pages for each feature
- Comprehensive documentation
- Best practices examples
Use case: Learning, documentation, reference projects
Features
Available features that can be enabled with --features:
auth- Authentication and authorization (RBAC)state- State management (Zustand + React Query)routing- File-system routingrealtime- Real-time data synchronization (WebSocket)monitoring- Performance monitoring (Core Web Vitals)theme- Theme system with dark mode
Project Structure
Generated projects follow this structure:
my-app/
├── public/ # Static assets
├── src/
│ ├── routes/ # Route components
│ ├── components/ # Reusable components
│ ├── config/ # Configuration files
│ ├── providers/ # Provider orchestration
│ ├── store/ # State management (if enabled)
│ ├── lib/ # Feature-specific code
│ │ ├── auth/ # Auth logic (if enabled)
│ │ ├── monitoring/ # Monitoring (if enabled)
│ │ └── realtime/ # Real-time (if enabled)
│ ├── App.tsx # Root component
│ ├── main.tsx # Entry point
│ └── index.css # Global styles
├── .env.example # Environment variables template
├── .gitignore
├── eslint.config.js # ESLint configuration
├── index.html
├── package.json
├── postcss.config.js
├── prettier.config.json
├── README.md
├── tailwind.config.ts # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── vite.config.ts # Vite configurationCommands
enzyme new
Create a new enzyme project.
enzyme new <project-name> [options]Alias: enzyme create
enzyme generate
Generate components, routes, and other files.
enzyme generate <type> <name> [options]Alias: enzyme g
Types:
component- React componentroute- Route componentstore- Zustand storeservice- Service layer
enzyme config
Manage Enzyme configuration.
# Initialize configuration
enzyme config init [--format json|yaml|js] [--force] [--interactive]
# Get configuration value
enzyme config get <key> [--format json|value]
# Set configuration value
enzyme config set <key> <value> [--create]
# List all configuration
enzyme config list [--format json|table|tree] [--no-source]
# Validate configuration
enzyme config validate [--fix]enzyme add
Add a feature to an existing project.
enzyme add <feature> [options]
# List available features
enzyme add:listOptions:
--dry-run- Preview changes without applying--skip-install- Skip dependency installation--skip-config- Skip configuration update
Available features:
auth- Authentication and authorizationstate- State management with Zustandrouting- Advanced routing with React Routerrealtime- Real-time subscriptions and WebSocketmonitoring- Performance monitoring and observabilitytheme- Theming and dark mode supportflags- Feature flags for A/B testing
enzyme remove
Remove a feature from the project.
enzyme remove <feature> [options]Options:
--dry-run- Preview changes without applying--force- Force removal without confirmation--skip-uninstall- Skip dependency uninstallation--keep-files- Keep generated files
enzyme analyze
Analyze project for issues and optimizations.
enzyme analyze [options]Options:
--verbose- Verbose output--format <format>- Output format (json, console)--include-tests- Include test files in analysis
Analysis includes:
- Feature detection and usage
- Unused imports and dependencies
- Deprecated patterns
- Performance suggestions
- Code quality issues
- Project statistics
enzyme migrate
Migrate project to a newer Enzyme version.
enzyme migrate [options]Options:
--to <version>- Target version--dry-run- Preview migrations without applying--no-backup- Skip backup creation
enzyme upgrade
Upgrade Enzyme to the latest version with compatibility checks.
# Check for upgrades
enzyme upgrade:check
# Upgrade to latest
enzyme upgrade [options]Options:
--to <version>- Target version--dry-run- Preview without applying--force- Force upgrade despite compatibility issues--skip-migrations- Skip running migrations--skip-tests- Skip running tests after upgrade
enzyme validate
Validate generated code against Enzyme standards.
enzyme validate [files...] [options]Options:
--fix- Auto-fix issues where possible--rules <rules>- Comma-separated list of rules to check
Validation rules:
- Component naming conventions (PascalCase)
- Hook naming (must start with "use")
- Required exports
- TypeScript types
- Import organization
- React hooks rules
- Test file existence
- Accessibility checks
- Code complexity
enzyme doctor
Check project health with comprehensive diagnostics.
enzyme doctor [options]Options:
--fix- Auto-fix issues where possible--verbose- Verbose output
Health checks:
- Environment (Node.js, npm, Git)
- Dependencies (installed, versions, compatibility)
- Configuration (valid, TypeScript setup)
- Code quality (ESLint, Prettier, TypeScript compilation)
- Performance (build output, bundle size)
Generated Files
Configuration Files
package.json- Dependencies based on selected featurestsconfig.json- Strict TypeScript configurationvite.config.ts- Vite build configurationtailwind.config.ts- Tailwind CSS themeeslint.config.js- ESLint rules.prettierrc- Code formatting rulespostcss.config.js- PostCSS plugins
Source Files
src/main.tsx- Application entry point with performance monitoringsrc/App.tsx- Root component with provider setupsrc/index.css- Global styles and Tailwind directivessrc/vite-env.d.ts- Vite type definitionssrc/config/index.ts- Application configurationsrc/providers/index.tsx- Provider orchestration
Route Files (Template-specific)
Generated routes vary by template:
Standard:
src/routes/Home.tsxsrc/routes/About.tsx
Enterprise/Full (additional routes):
src/routes/Login.tsxsrc/routes/Dashboard.tsxsrc/routes/Monitoring.tsxsrc/routes/Features.tsx(Full only)
Package Managers
The CLI supports multiple package managers:
- npm (default)
- yarn
- pnpm
- bun
The CLI will auto-detect your package manager from lock files, or you can specify one explicitly:
enzyme new my-app --package-manager pnpmDependencies
Base Dependencies
All projects include:
@missionfabric-js/enzyme- Core frameworkreact&react-dom- React runtimevite- Build tooltypescript- Type checkingtailwindcss- Stylingeslint&prettier- Code quality
Feature Dependencies
Additional dependencies based on selected features:
- routing:
react-router-dom - state:
zustand,@tanstack/react-query - monitoring:
web-vitals
Next Steps
After generating a project:
Navigate to project directory:
cd my-appStart development server:
npm run devBuild for production:
npm run buildPreview production build:
npm run preview
Development
To develop the CLI locally:
# Clone repository
git clone https://github.com/harborgrid-justin/enzyme-cli.git
cd enzyme-cli
# Install dependencies
npm install
# Build CLI
npm run build
# Link globally (for testing)
npm link
# Now you can use `enzyme` command
enzyme new test-appContributing
Contributions are welcome! Please read our Contributing Guide for details.
License
MIT © Defendr Team
