Skip to content

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

CommandDescription
comphubStart dev server for the current project
comphub statusView all running projects
comphub stop <hash>Stop a specific project
comphub stop --allStop all projects
comphub killShut down all services

comphub — Start Server

Run in the project directory to start the dev server and preview components in the browser.

bash
comphub

Options:

OptionShortTypeDefaultDescription
--port-pnumber5478Service port
--dir-dpath"./"Resource directory relative path

| --version | -v | - | - | Show version | | --help | -h | - | - | Show help |

Examples:

bash
# Start with default port
comphub

# Use a custom port
comphub -p 8080

# Specify directory
comphub -d ./src

After 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.

bash
comphub status

Example 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 running

comphub stop — Stop Projects

Stop one or all running projects without affecting others.

bash
# Stop a specific project (use status to find the hash)
comphub stop <hash>

# Stop all projects
comphub stop --all

Examples:

bash
# Stop project with hash 94525912
comphub stop 94525912

# Stop all projects at once
comphub stop --all

comphub kill — Shut Down All Services

Shut down all projects and services.

bash
comphub kill

This terminates everything. Run comphub again to restart.


Running Multiple Projects

You can run different projects at the same time:

bash
# 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 status

Each project gets its own port and is accessed via a different URL.

Components uploaded by users are open source