comp-hub
comp-hub
CLI for comp-hub — a component sharing platform supporting Vue and React. Start a local dev server to preview, manage, and share components.
Languages: Full docs are also available in 简体中文 · 繁體中文 on our documentation site.
Website: https://www.comphub.cn · Docs: https://docs.comphub.cn
Requirements
- Node.js >= 16.0.0
- npm >= 8.0.0
Installation
Global (recommended)
npm install comp-hub@latest -g
Local
npm install comp-hub@latest -D
Quick Start
Run in your project directory:
comphub
Once started, open the URL shown in the terminal (default http://localhost:5478).
Without installing — npx fetches the CLI on demand:
npx comp-hub
The CLI is published with three binary names —
comphub,chandcomp-hub— all identical. Every command below works with any of them, e.g.ch status,comp-hub -p 8080.
CLI Options
comphub [options]
| Option | Alias | Type | Default | Description |
|---|---|---|---|---|
--port |
-p |
number | 5478 | Server port |
--dir |
-d |
path | "./" |
Component directory |
--version |
-v |
— | — | Show version |
--help |
-h |
— | — | Show help |
Examples:
comphub -p 8080 # Custom port
comphub -d ./src # Custom component directory
Management Commands
| Command | Description |
|---|---|
comphub |
Start dev server |
comphub status |
List all running projects |
comphub stop <hash> |
Stop a specific project |
comphub stop --all |
Stop all projects |
comphub kill |
Shut down all services |
Examples:
# Check running projects
comphub status
# Stop a specific project
comphub stop 94525912
# Stop all projects
comphub stop --all
# Shut down everything
comphub kill
Multi-Project
Run multiple projects simultaneously on separate ports:
cd /path/to/project-a && comphub
cd /path/to/project-b && comphub
comphub status # List all
Configuration
Create .comphub.json or .comphub.js in your project root:
{
"dir": "./src",
"allowDebug": false
}
module.exports = {
dir: './src',
allowDebug: false
}
| Option | Type | Default | Description |
|---|---|---|---|
dir |
string | "./" |
Component root directory |
allowDebug |
boolean | false | Enable debug mode |
proxy |
object | — | Custom proxy rules |
Priority: CLI flags > config file > defaults
Component Specs
- Upload components as folders — folder name is the component name
- Entry point:
index.vue(Vue) orindex.jsx/index.tsx(React) - Include a
README.mddescribing usage comp.jsonis generated by the platform and holds only__id__,nameandversion— dependencies are detected from your sourceimportstatements, not declared here- Optional
demo/directory for preview configs
Links
- Website: https://www.comphub.cn
- Docs (English · 简体中文 · 繁體中文): https://docs.comphub.cn
License
Related Packages
An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as...
Version History
| Version | Released | License |
|---|---|---|
| 0.47.2 | ||
| 0.47.1 | ||
| 0.47.0 | ||
| 0.46.22 | ||
| 0.45.22 | ||
| 0.44.22 | ||
| 0.44.12 | ||
| 0.44.11 | ||
| 0.43.11 | ||
| 0.43.10 | ||
| 0.43.9 | ||
| 0.42.9 | ||
| 0.42.8 | ||
| 0.42.7 | ||
| 0.42.6 | ||
| 0.42.5 | ||
| 0.42.4 | ||
| 0.42.3 | ||
| 0.42.2 | ||
| 0.41.2 | ||
| 0.31.2 | ||
| 0.31.1 | ||
| 0.30.1 | ISC | |
| 0.29.9 | ISC | |
| 0.29.8 | ISC | |
| 0.29.7 | ISC | |
| 0.28.7 | ISC | |
| 0.28.6 | ISC | |
| 0.28.5 | ISC | |
| 0.28.4 | ISC |
Showing the latest 30 of 112. See every release on npm