StaticHub is a static hosting platform for front-end projects. It supports fast anonymous deploys, named project deploys with auth, deployment history, and rollback.
Install CLI:
curl -sSL https://raw.githubusercontent.com/Patrick0308/statichub/main/scripts/install.sh | shDeploy a directory:
statichub deploy ./distDeploy a single HTML file:
statichub deploy ~/Downloads/page.htmlOutput:
📦 Collecting files from /Users/patrick/Downloads/page.html...
Found 1 files
🚀 Deploying to https://statichub.dev...
✅ Deploy successful!
URL: http://b7kr7b.statichub.dev
Subdomain: b7kr7b
Login and deploy to a named project:
statichub login
statichub deploy ./dist --name my-appstatichub deploy <path> [--name <project>] [--config statichub.yaml]
statichub login
statichub logout
statichub list
statichub info <project>
statichub rollback <project> <version>
statichub apikey create <name>
statichub apikey list
statichub apikey revoke <id>STATICHUB_API_KEY:
- If set,
deploy --name,list,info, androllbackuse it as auth and do not requirestatichub login. apikeymanagement commands still requirestatichub login.
This repository includes a reusable skill at skills/statichub for agents that need to deploy AI-generated static output safely.
Install with npx skills:
npx skills add Patrick0308/statichub --skill statichubGlobal install:
npx skills add Patrick0308/statichub --skill statichub -gCheck installed skills:
npx skills lsSkill behavior summary:
- Requires explicit deploy path:
statichub deploy <path> - Accepts only a non-empty directory or non-empty
.htmlfile - Stops on validation failure and returns repair commands
- Uses named deploy when
--nameis present, anonymous otherwise
Real output example:
✅ Deploy successful!
URL: http://b7kr7b.statichub.dev
Subdomain: b7kr7b
The URL value is the live page URL.
clean_urls: true
spa: true
redirects:
- from: /old-path
to: /new-path
status: 301
headers:
- path: /*
headers:
X-Frame-Options: DENY
directory_index:
- index.htmlCreate .env values and start server:
cp .env.example .env
statichub-server db init
statichub-server serveImportant env vars:
STATICHUB_PORTSTATICHUB_ALLOWED_DOMAINSSTATICHUB_DATABASE_URLSTATICHUB_STORAGE_PATH
Optional auth env vars (required only when auth is enabled):
STATICHUB_JWT_SECRETSTATICHUB_GOOGLE_CLIENT_IDSTATICHUB_GOOGLE_CLIENT_SECRETSTATICHUB_GOOGLE_REDIRECT_URL
Quick local startup behavior:
- If
STATICHUB_GOOGLE_CLIENT_IDandSTATICHUB_GOOGLE_CLIENT_SECRETare both set, auth is enabled (existing behavior). - If either one is missing, server starts in auth-disabled local mode.
- In auth-disabled local mode:
/auth/*returns503- authenticated management APIs return
503 - anonymous deploy and static serving remain available
- Base domain (for example
statichub.io) serves the built-in product homepage. - Subdomains serve deployed static files for projects (for example
my-app.statichub.io). - Built-in homepage assets are reserved under
/__home/*.
Run tests:
cargo test --workspaceProject layout:
cli/ # CLI binary
server/ # API server and static serving
shared/ # shared types
skills/ # reusable agent skills
docs/ # docs and plans