CLI Reference
Installation
npm install -g my-cliCommands
init
Initialize a new project.
my-cli init [project-name]Options:
| Flag | Description |
|---|---|
--template <name> | Use a specific template |
--skip-install | Skip dependency installation |
-y, --yes | Skip prompts, use defaults |
Example:
my-cli init my-project --template typescriptdev
Start development server.
my-cli devOptions:
| Flag | Description |
|---|---|
--port <number> | Port to listen on (default: 3000) |
--host <string> | Host to bind to (default: localhost) |
--open | Open browser automatically |
build
Build for production.
my-cli buildOptions:
| Flag | Description |
|---|---|
--outdir <path> | Output directory (default: dist) |
--minify | Minify output |
--sourcemap | Generate sourcemaps |
generate
Generate code from templates.
my-cli generate <type> <name>Types:
component- UI componentpage- Page componentapi- API routemodel- Data model
Example:
my-cli generate component Buttonmy-cli generate page Aboutmy-cli generate api usersConfiguration
Create cli.config.js in your project root:
export default { port: 3000, outdir: 'dist', templates: './templates',};