CLI Reference
The comp-hub CLI provides a set of commands to manage your local dev server. Multiple projects can run simultaneously, each with its own port.
Command Overview
| Command | Description |
|---|---|
comphub | Start dev server for the current project |
comphub status | View master status and all running projects |
comphub stop <hash> | Stop a specific project |
comphub stop --all | Stop all projects |
comphub kill | Shut down master process |
comphub fix | Fix common issues (stale runtime file, etc.) |
comphub — Start Server
Run in the project directory to start the dev server and preview components in the browser.
comphubOptions:
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--port | -p | number | 5478 | Service port |
--dir | -d | path | "./" | Resource directory relative path |
--log-level | -l | string | "error" | Log level: debug, info, warn, error |
| --version | -v | - | - | Show version | | --help | -h | - | - | Show help |
Examples:
# Start with default port
comphub
# Use a custom port
comphub -p 8080
# Specify directory
comphub -d ./srcAfter a successful start, you'll see the project info and access URL:
✅ comp-hub v0.27.20
📦 Project registered (hash: 94525912)
Version 0.27.20
Project D:\project\housing\vue2
Hash 94525912
Port 5002
Access http://localhost:5002/94525912/main/Open the access URL in your browser to enter the platform.
comphub status — View Status
See which projects are currently running.
comphub statusExample output:
🔍 Querying master status...
Master Status: ok
Version: 0.27.20
Uptime: 120s
Projects: 2
Registered Projects:
----------------------------------------------------------
hash: 94525912
cwd: D:\project\housing\vue2
port: 5003
url: http://localhost:5002/94525912/main/
----------------------------------------------------------
hash: a3f82109
cwd: D:\project\housing\vue3
port: 5005
url: http://localhost:5002/a3f82109/main/
----------------------------------------------------------If no service is running:
❌ Master service is not runningcomphub stop — Stop Projects
Stop one or all running projects without affecting others.
# Stop a specific project (use status to find the hash)
comphub stop <hash>
# Stop all projects
comphub stop --allExamples:
# Stop project with hash 94525912
comphub stop 94525912
# Stop all projects at once
comphub stop --allcomphub kill — Shut Down All Services
Shut down all projects and services.
comphub killThis terminates the master process and all registered projects. Run comphub again to restart.
comphub fix — Fix Common Issues
Clean up stale runtime files and fix other common problems:
comphub fixThis is useful when:
- A previous shutdown left a stale process file that prevents a new startup
- You need to reset the local runtime state
Running Multiple Projects
You can run different projects at the same time:
# Terminal 1: Start project A
cd /path/to/project-a
comphub
# Terminal 2: Start project B
cd /path/to/project-b
comphub
# Check all running projects
comphub statusEach project gets its own port and is accessed via a different URL.