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 all running projects |
comphub stop <hash> | Stop a specific project |
comphub stop --all | Stop all projects |
comphub kill | Shut down all services |
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 |
| --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 everything. Run comphub again to restart.
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.