CLI Commands
Kimesh provides the km CLI for development, building, and layer management.
km dev
Start the development server with hot module replacement.
bash
km dev
km dev --port 3001
km dev --host 0.0.0.0
km dev --open| Option | Alias | Default | Description |
|---|---|---|---|
--port | -p | 3000 | Dev server port |
--host | -h | localhost | Dev server host |
--open | -o | false | Open browser on start |
--root | -r | . | Project root directory |
--config | -c | Auto | Path to config file |
--verbose | -v | false | Enable verbose output |
Alias: km start is an alias for km dev.
km build
Build the application for production.
bash
km build
km build --analyze
km build --sourcemap| Option | Alias | Default | Description |
|---|---|---|---|
--root | -r | . | Project root directory |
--config | -c | Auto | Path to config file |
--analyze | — | false | Open bundle analysis report |
--sourcemap | — | false | Generate source maps |
--verbose | -v | false | Enable verbose output |
km prepare
Generate the .kimesh/ directory with TypeScript configurations, route types, and auto-import declarations.
bash
km prepare
km prepare --verbose| Option | Alias | Default | Description |
|---|---|---|---|
--root | -r | . | Project root directory |
--config | -c | Auto | Path to config file |
--verbose | -v | false | Enable verbose output |
Generated Files
| File | Description |
|---|---|
.kimesh/tsconfig.json | TypeScript path aliases |
.kimesh/routes.gen.ts | Generated route definitions |
.kimesh/auto-imports.d.ts | Auto-import type declarations |
.kimesh/components.d.ts | Component type declarations |
.kimesh/context.d.ts | Kimesh context types |
.kimesh/modules.ts | Module metadata |
.kimesh/plugins.mjs | Runtime plugin registration |
When to Run
- After cloning a project
- After installing/updating dependencies
- After modifying
kimesh.config.ts - After adding new layers or modules
- When switching branches
Recommended package.json
json
{
"scripts": {
"prepare": "km prepare",
"postinstall": "km prepare",
"dev": "km dev",
"build": "km build"
}
}km generate
Generate specific build artifacts.
bash
km generate
km generate --root ./my-app| Option | Alias | Default | Description |
|---|---|---|---|
--root | -r | . | Project root directory |
--config | -c | Auto | Path to config file |
--verbose | -v | false | Enable verbose output |
km init
Initialize a new Kimesh project (alternative to create-kimesh).
bash
km init my-app
km init my-app --template minimal| Option | Alias | Default | Description |
|---|---|---|---|
--template | -t | minimal | Template to use |
km layer
Layer management commands.
km layer list
List all discovered layers and their priorities.
bash
km layer list
km layer list --verbosekm layer info
Show detailed information about a specific layer.
bash
km layer info my-layerkm layer create
Scaffold a new layer.
bash
km layer create my-layer
km layer create my-layer --dir ./layerskm layer validate
Validate a layer's structure and configuration.
bash
km layer validate my-layer
km layer validate ./layers/my-layerGlobal Options
These options are available for all commands:
| Option | Alias | Description |
|---|---|---|
--root | -r | Project root directory |
--config | -c | Path to config file |
--verbose | -v | Enable verbose logging |
--help | — | Show help |
--version | — | Show version |