Local HTTP Server Manager
Project description
๐จ๐ณ ไธญๆ ยท ๐ฌ๐ง English
http-server-cli
Forget ports. Just preview.
Based on
python3 -m http.server, zero external dependencies. Jusths . -oto preview your project.
- Zero External Dependencies โ Only requires macOS (lsof/open) and Python 3.7+ (
pip install http-server-cli) - Auto Port Allocation + Preview โ Default 8080, auto-increment on conflict (
hs . -o) - Smart Homepage โ Auto-redirect to most recently modified HTML file when no index.html
- Custom Index Page โ Specify default HTML file with
-i/--index - Project Tracking โ Persistent project path โ port mapping (
hs list) - Process Resource Monitoring โ Real-time CPU, memory usage and runtime (
hs list) - Multiple Launch Modes โ Daemon background or foreground (
-ddaemon /-fforeground) - JSON Output โ All commands support
--jsonfor API/MCP consumption - Web Dashboard โ
hs dashboard -oGUI management for HTTP services - MCP Server โ
hs mcpAI Agent integration (SSE/stdio, 6 tools) - Managed Registry โ Infrastructure services isolated from user services
Why hs
When developing multiple frontend projects, you constantly switch between "Which port did A use?" and "Who's occupying 8080?".
hs closes the loop: Start โ Track โ List โ Kill โ auto-find free ports, remember which project uses which port, view and close anytime.
Comparison
| Scenario | Before | With hs |
|---|---|---|
| Start server | python3 -m http.server 8080 + manually open browser |
hs . -o โ auto-find free port, open browser |
| View servers | lsof -i :8080, then ps to see path |
hs list |
| Switch projects | Kill old one, start new (or conflict) | hs ../project-b |
| Kill server | lsof to find PID โ kill |
hs kill 8080 |
Installation
pip install http-server-cli
# Upgrade to latest version
pip install --upgrade http-server-cli
Verify:
hs version # โ http-server-cli v1.0.x
hs . -o # Start in current directory + open browser
Usage
Daily Workflow
# 1. Preview your project
cd ~/project-alpha
hs . -o # Auto-find free port, open browser
# 2. Check running servers
hs list
# โ
http://localhost:8080 โ ~/project-alpha
# โ
http://localhost:8081 โ ~/project-beta (daemon)
# 3. Kill unwanted servers
hs kill 8080 # By port
hs kill ~/project-alpha # By path
hs kill-all # Kill all
All Commands
| Command | Description |
|---|---|
hs . [-o] [-d] [-f] |
Shortcut, equivalent to hs start . |
hs start [path] [-o] [-d] [-f] [-i <file>] |
Start server (path defaults to .; -o open browser; -d daemon; -f foreground; -i custom index) |
hs list |
List all running servers |
hs list --json |
JSON format list |
hs status [port|path] |
Query single server status |
hs status --json [port|path] |
JSON format status |
hs kill <port|path> |
Kill specified server |
hs dashboard [-p PORT] [-o] [--json] |
Web dashboard (default port 8180) |
hs dashboard stop|status|restart|help |
Dashboard management subcommands |
hs mcp [--transport stdio|sse] [--port PORT] |
MCP Server for AI Agent integration |
hs mcp stop|status|restart|help |
MCP management subcommands |
hs kill-all |
Kill all servers |
hs config |
Show configuration |
hs config --json |
JSON format configuration |
hs set port <num> |
Set default port (default 8080) |
hs set domain <str> |
Set bind domain (default localhost) |
Tips
hs . -o=hs start . -o, faster to typehs . -d: daemon mode, runs in background, check withhs lisths . -f: foreground mode, Ctrl+C to stophswithout args =hs start .(start in current directory)hs . -i app.html: useapp.htmlas the index page
Data Directory
~/.http-server-cli/
โโโ config.json # Default port/domain configuration
โโโ registry.json # port โ {path, pid, domain, daemon, foreground, started_at}
โโโ registry-managed.json # Infrastructure services (dashboard, MCP SSE)
โโโ logs/{port}.log # http.server logs
Platform Requirements
Currently only supports macOS (requires lsof command). Linux/Windows support in development.
Local Development
git clone git@github.com:imjaden/http-server-cli.git
cd http-server-cli
pip install -e .
python3 -m pytest tests/
Is This Reinventing the Wheel?
| Tool | Start Server | Auto Port | Track ProjectโPort | List All | Kill by Name | Open Browser |
|---|---|---|---|---|---|---|
python3 -m http.server |
โ | โ | โ | โ | โ | โ |
http-server (npm) |
โ | โ | โ | โ | โ | โ |
serve (npm) |
โ | โ | โ | โ | โ | โ |
live-server |
โ | โ | โ | โ | โ | โ |
portless (npm) |
โ | โ | โ | โ | โ | โ |
kill-port-cli (npm) |
โ | โ | โ | โ | โ | โ |
lsof / netstat |
โ | โ | โ | Manual | Manual | โ |
http-server-cli |
โ | โ | โ | โ | โ | โ |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file http_server_cli-1.0.7.tar.gz.
File metadata
- Download URL: http_server_cli-1.0.7.tar.gz
- Upload date:
- Size: 53.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c14d9f3e03f263ee2ed834658f3f4cd15f8a14bb09a6dbbeeb0776a2b08f1f55
|
|
| MD5 |
d95766aa5b39d49a424a8d29e275b175
|
|
| BLAKE2b-256 |
dee31959f28ac22bced105d2e669e90f906bf2bf092eb9ab4aa39e29174a5ec8
|
File details
Details for the file http_server_cli-1.0.7-py3-none-any.whl.
File metadata
- Download URL: http_server_cli-1.0.7-py3-none-any.whl
- Upload date:
- Size: 38.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d04113406ca8bf3b59d9aa57b8c364ba8441250ccf20572c24a72985e2e8a5bf
|
|
| MD5 |
f7b8912aaa1552e75401a2d20f699979
|
|
| BLAKE2b-256 |
38b5aa6e73e19172fe6638b1cd1519f2e950702bedd96fc60f3251baa2032b72
|