leganux-lux-cli v1.0.2
Lux CLI
A powerful CLI tool for generating MEVN (MongoDB, Express, Vue 3, Node.js) stack projects, views, and API modules. This tool helps you quickly scaffold new projects and generate modules with AI-powered code generation.
Features
- š Generate complete MEVN stack projects
- š§© Create individual blocks with frontend and backend components
- š¦ Generate backend-only modules
- šØ Create frontend-only microfrontends
- š Generate website pages with dual UI framework support
- ā” Execute module generation from JSON definitions
- š¤ AI-powered code generation (OpenAI or Deepseek)
- šÆ TypeScript support out of the box
- š Vue 3 Composition API
- š MongoDB with Mongoose
Installation
# Install globally
npm install -g leganux-lux-cli
____________________________________________
OR
_______________________________________
# Clone the repository
git clone https://github.com/yourusername/lux-cli.git
# Navigate to the directory
cd leganux-lux-cli
# Install dependencies
npm install
# Link the CLI globally
npm link
Commands
Configure AI Provider
Set up your AI provider (OpenAI or Deepseek) for code generation:
lux configure
This will:
- Create a .lux directory in your home folder
- Store your AI provider preference and API key
- Use these settings for all future code generation
Generate Complete Project
Create a new MEVN stack project with both frontend and backend:
lux generate-project
This will:
- Create frontend and backend directories
- Download and set up Vue 3 microfrontends template
- Download and set up Express TypeScript backend template
- Generate AI-powered module definitions
- Create all necessary modules and components
Generate Block
Create a new block with both frontend and backend components:
lux generate-block
This will:
- Generate a module configuration based on your description
- Create backend API module with TypeScript and Mongoose
- Create frontend Vue 3 component with TypeScript
- Set up all necessary files and configurations
Generate Backend Module
Create a new backend-only module:
lux generate-module
This will:
- Generate a module configuration based on your description
- Create a complete backend module with:
- TypeScript interfaces
- Mongoose model
- Express controller
- API routes
- Swagger documentation
Generate Frontend Microfrontend
Create a new frontend-only microfrontend:
lux generate-microfrontend
This will:
- Generate a module configuration based on your description
- Create a complete Vue 3 microfrontend with:
- TypeScript interfaces
- Vue 3 components (Bootstrap and Fomantic UI)
- Vuex store
- API service
- Configuration
Generate Website Page
Create a new website page with both Bootstrap and Fomantic UI versions:
lux generate-website-microfrontend
This will:
- Ask for project root path
- Get module name and view name
- Take a description of the desired page
- Create proper directory structure in frontend/src/_frontends/website/
- Generate config.ts with proper routing setup
- Use AI to generate:
- Bootstrap version of the page
- Fomantic UI version of the page
- Follow Vue 3 Composition API best practices
- Include TypeScript support
- Set up proper routing configuration
The generated website pages will include:
- Responsive design
- Semantic HTML structure
- Proper component organization
- Scoped styling
- TypeScript type definitions
- Framework-specific UI components and classes
Execute from JSON
Generate modules from an existing JSON definition:
lux executor
This will:
- Read your JSON module definition
- Generate backend and/or frontend code based on your choice
- Support for custom module definitions
Interactive File Modifier
Modify existing files using AI-powered suggestions:
lux interact
This will:
- Ask for the full path of a file to modify
- Verify the file exists
- Take a description of the desired changes
- Use AI to modify the file according to your description
- Save the changes automatically
- Continue asking for more files to modify
- Type 'exit' when you're done
The interactive modifier helps you:
- Make targeted changes to existing files
- Leverage AI for code modifications
- Maintain code structure and style
- Make multiple changes in one session
- Preserve existing imports and dependencies
Project Structure
Generated projects follow this structure:
your-project/
āāā frontend/ # Vue 3 frontend
ā āāā src/
ā āāā _frontends/
ā āāā dashboard/ # Dashboard microfrontends
ā āāā website/ # Website pages
āāā backend/ # Express backend
ā āāā src/
ā āāā modules/ # API modules
āāā generated_runners/ # Generated JSON configurations
Development
To contribute to the CLI:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
ISC
TODO
- Add support for additional frontend frameworks
- Enhance AI-powered code generation
- Add testing utilities