Features
🔒 Zero-Config HTTPS
Auto-generates self-signed TLS certificates. No setup required — just run ht-serve serve.
🔁 WebSocket Live Reload
Edit HTML, CSS, or JS and your browser reloads instantly via WebSocket push on port 8001.
🛣️ API Routing
Define dynamic API endpoints with a Flask-like decorator syntax. Supports GET, POST, PUT, PATCH, DELETE with path parameters.
🌐 CORS & SPA Support
Enable cross-origin API access with --cors and single-page app fallback with --spa.
📦 Project Scaffolding
Bootstrap new projects instantly: static, api, or fullstack templates via ht-serve init.
🤖 AI Agent Suite
AgentScope-powered agents for content management, SEO, analytics, marketing, support, and deployment.
Quick Start
Install
pip install ht-serve
Scaffold a Project
ht-serve init ./mysite -t fullstack -n "My App"
Serve with Live Reload
cd mysite
ht-serve serve --cors --open-browser
API Routing
Create a routes.py in your project directory. HT-Serve auto-discovers it on startup.
from ht_serve.routing import Router, Request
router = Router()
@router.get("/api/hello")
def hello(request: Request):
return {"message": "Hello, world!"}
@router.get("/api/users/{user_id}")
def get_user(request: Request):
uid = request.path_params["user_id"]
return {"user_id": uid, "name": f"User {uid}"}
@router.post("/api/echo")
def echo(request: Request):
return {"received": request.json}
Built-in endpoints are always available:
GET /healthz— Server health checkGET /api/routes— List all registered API routes
Project Scaffolding
Static Site
ht-serve init ./site -t static
Multi-page HTML/CSS/JS website with navigation, contact form, and responsive design.
API Only
ht-serve init ./api -t api
REST API project with example CRUD routes and a README documenting endpoints.
Full-Stack
ht-serve init ./app -t fullstack
Static frontend + API backend combined — pages that fetch from your own endpoints.
AI Agent Suite
HT-Serve integrates AgentScope to provide autonomous AI agents for managing every aspect of your online presence.
| Agent | Role | Responsibilities |
|---|---|---|
| ContentManager | content | Create, edit, and organise website pages and copy |
| SEOSpecialist | seo | Audit site structure, generate meta tags, optimise for search |
| AnalyticsMonitor | analytics | Check server health, analyse site structure and performance |
| MarketingStrategist | marketing | Draft campaigns, landing pages, and promotional content |
| CustomerSupport | support | Maintain FAQ pages, knowledge base, and help-centre content |
| DeploymentEngineer | deployment | Deploy builds, manage SSL certificates, verify server health |
# Run a single agent
ht-serve agents run seo "Audit the homepage meta tags"
# Run a collaborative pipeline
ht-serve agents pipeline "Launch the new product page" --roles content,seo,deployment
CLI Reference
| Command | Description |
|---|---|
ht-serve serve | Start the HTTPS server with live reload, CORS, and SPA support |
ht-serve init | Scaffold a new static, api, or fullstack project |
ht-serve check | Verify that required ports are available |
ht-serve reset-demo | Regenerate the built-in demo site |
ht-serve about | Display feature summary and usage examples |
ht-serve agents list | List available AI agent roles |
ht-serve agents run | Dispatch a task to a specific agent |
ht-serve agents pipeline | Run a sequential agent pipeline |
ht-serve agents config | Show or update LLM / agent configuration |
ht-serve agents status | Show agent initialisation status |