@shellui/cli
ShellUI CLI - Command-line tool for ShellUI
Installation
npm install -g @shellui/cli
Or install as a dev dependency:
npm install --save-dev @shellui/cli
Usage
shellui start [path/to/project]
shellui build [path/to/project]
Commands
start
Start the ShellUI development server
shellui start
shellui start ./my-project
build
Build the ShellUI application for production
shellui build
shellui build ./my-project
Project Structure
The CLI is organized for maintainability with a clear separation of concerns:
src/
├── cli.js # Main CLI orchestrator
├── commands/ # All commands in separate files
│ ├── index.js # Command registry
│ ├── start.js # Start command implementation
│ └── build.js # Build command implementation
└── utils/ # Utility functions
├── index.js # Utilities export
├── config.js # Configuration loading
└── vite.js # Vite-specific utilities
Development
Adding a New Command
- Create a new file in
src/commands/(e.g.,new-command.js) - Export a command function:
export async function newCommandCommand(args) {
// Command implementation
}
- Register it in
src/cli.js:
import { newCommandCommand } from './commands/index.js';
cli
.command('new-command [args]', 'Description')
.action(newCommandCommand);
- Export it from
src/commands/index.js:
export { newCommandCommand } from './new-command.js';