HT-Serve

Build static websites, dynamic APIs, and full-stack apps — all served over HTTPS with live reload.

🔒 Auto TLS 🔁 Live Reload 🛣️ API Routing 📦 Scaffolding 🤖 AI Agents
pip install ht-serve
ht-serve init ./myapp -t fullstack
cd myapp && ht-serve serve --cors --open-browser

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

1

Install

pip install ht-serve
2

Scaffold a Project

ht-serve init ./mysite -t fullstack -n "My App"
3

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:

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.

AgentRoleResponsibilities
ContentManagercontentCreate, edit, and organise website pages and copy
SEOSpecialistseoAudit site structure, generate meta tags, optimise for search
AnalyticsMonitoranalyticsCheck server health, analyse site structure and performance
MarketingStrategistmarketingDraft campaigns, landing pages, and promotional content
CustomerSupportsupportMaintain FAQ pages, knowledge base, and help-centre content
DeploymentEngineerdeploymentDeploy 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

CommandDescription
ht-serve serveStart the HTTPS server with live reload, CORS, and SPA support
ht-serve initScaffold a new static, api, or fullstack project
ht-serve checkVerify that required ports are available
ht-serve reset-demoRegenerate the built-in demo site
ht-serve aboutDisplay feature summary and usage examples
ht-serve agents listList available AI agent roles
ht-serve agents runDispatch a task to a specific agent
ht-serve agents pipelineRun a sequential agent pipeline
ht-serve agents configShow or update LLM / agent configuration
ht-serve agents statusShow agent initialisation status