Install and publish
The base package includes the Python client and CLI. Optional extras add clipboard, MCP, or server dependencies.
npx (no install)
npx htmlship publish report.html
npx htmlship publish report.html --password "demo-pass" --title "Demo" --expires-in 60
npx htmlship deploy ./my-app # build + ship a compiled app
npx htmlship deploy ./my-app --password "demo-pass" --title "Demo" --expires-in 60
npx htmlship get <slug>
npx htmlship update <slug> report.html
npx htmlship delete <slug>
npx htmlship list-mine
Deploy built apps
# single-page app (Vite/CRA) -> one inlined sandboxed page
npx htmlship deploy ./my-app
# multi-file site (Next.js auto-detected) -> view.htmlship.com/{slug}/
npx htmlship deploy ./my-next-app
npx htmlship deploy --site --out dist # force multi-file (Astro, etc.)
# add a title, password, and TTL — works for both kinds
npx htmlship deploy ./my-app --title "Demo" --password "demo-pass" --expires-in 60
# the build runs locally (never on the server). Each slug renders
# in its own isolated, opaque origin (no cookies, no cross-site
# access, no network egress) via a sandboxed CSP.
Python
pip install htmlship
import htmlship
page = htmlship.publish(
"<h1>Hello</h1>",
title="Demo",
password="demo-pass",
expires_in=60, # minutes
)
print(page.url, page.owner_key)
htmlship.update(
page.slug,
"<h1>Updated</h1>",
owner_key=page.owner_key,
)
htmlship.get(page.slug)
htmlship.delete(page.slug, owner_key=page.owner_key)
CLI (pip)
pip install htmlship
htmlship publish report.html
cat report.html | htmlship publish -
htmlship publish report.html --password "demo-pass" --title "Demo" --expires-in 60
htmlship deploy ./my-app # build + ship a compiled app
htmlship deploy ./my-app --password "demo-pass" --title "Demo" --expires-in 60
htmlship get <slug>
htmlship update <slug> report.html
htmlship delete <slug>
htmlship list-mine
cURL
# publish (password gates view access, optional)
curl -X POST https://api.htmlship.com/api/v1/pages \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello</h1>","title":"Demo","password":"demo-pass"}'
# update — only owner_key (returned at publish) can mutate
curl -X PATCH https://api.htmlship.com/api/v1/pages/<slug> \
-H "Content-Type: application/json" \
-H "X-Owner-Key: ws_..." \
-d '{"html":"<h1>Updated</h1>"}'
# delete
curl -X DELETE https://api.htmlship.com/api/v1/pages/<slug> \
-H "X-Owner-Key: ws_..."
MCP (Claude Desktop, Cursor, ...)
{
"mcpServers": {
"htmlship": {
"command": "npx",
"args": ["-y", "htmlship", "mcp"],
"env": {
"HTMLSHIP_API_URL": "https://api.htmlship.com"
}
}
}
}
publish_html args:
{"html":"<h1>Hello</h1>","title":"Demo","password":"demo-pass"}
deploy_project args (build + ship; multi-file Next.js auto-detected):
{"dir":"./my-app","password":"demo-pass"}
update_html args (owner_key is the publisher-only secret):
{"slug":"<slug>","html":"<h1>Updated</h1>","owner_key":"ws_..."}