publish — share content, get link
Caution
Your content stays local until you explicitly run this skill. The skill asks for namespace and password interactively — nothing is uploaded until you confirm both prompts. Owner tokens (needed for deletion) are stored only in .claude/brewpage-history.md and never printed to conversation.
Tip
brewpage.app is free instant hosting: HTML pages, JSON documents, files, and multi-file sites. Default TTL is 15 days — override with --ttl N. For the public gallery, visit brewpage.app.
Companion tools
brewpage-mcp
Official MCP server for BrewPage Sites API (v1.2.0, multi-file support). Install: claude mcp add brewpage npx -- -y brewpage-mcp
OpenAPI Spec
Full API contract, Scalar UI. Use when building custom integrations or calling the API directly.
REST API
Direct REST access — no client needed. Base URL: https://brewpage.app/api
Quick reference
| Field | Value |
|---|---|
| Command | /brewdoc:publish <content> [--ttl N] [--entry filename] |
| Arguments | Text, file path, directory path, or .zip path |
| Model | haiku |
| Tools | Read, Bash, AskUserQuestion, Glob |
When to use
- Share a report instantly —
/brewdoc:publish report.md→ public link in seconds - Host a JSON dataset —
/brewdoc:publish '{"status":"ok","count":42}'→ browseable JSON page - Upload any file —
/brewdoc:publish screenshot.png --ttl 1→ direct download link, expires in 1 day - Deploy a static site —
/brewdoc:publish ./dist/ --entry index.html→ full multi-file site with routing - Password-protect a page — set a password at the interactive prompt; page is hidden from gallery
Examples
# Publish inline text or markdown
/brewdoc:publish "Hello, world!"
/brewdoc:publish report.md
# Publish a JSON literal
/brewdoc:publish '{"status": "ok", "count": 42}'
# Publish a file (any MIME type)
/brewdoc:publish screenshot.png --ttl 1
# Deploy a multi-file site from a directory
/brewdoc:publish ./dist/ --entry index.html
# Upload a pre-zipped site archive
/brewdoc:publish site.zip --ttl 14
Modes
| Input | Detected type | Endpoint |
|---|---|---|
| Plain text or markdown string | HTML | POST /api/html?format=markdown |
Starts with { or [ | JSON | POST /api/json |
| Existing local file path | FILE | POST /api/files (multipart) |
Directory or .zip file | SITE | POST /api/sites (archive upload) |
SITE is checked first — directories and .zip files would otherwise match the FILE branch.
Entry file detection for sites: --entry flag → index.html if present → first .html alphabetically.
Flow
- Parse arguments
Extracts
—ttl N(default: 15 days),—entry filename(site mode), and the content argument. For a directory, counts HTML files and detects the entry file. - Detect content type
Classifies the input as SITE, FILE, JSON, or HTML — in that order. Computes size and shows a pre-publish summary before any interaction.
- Ask namespace
Interactive prompt offers:
public(gallery-visible), an auto-suggested meaningful slug, or a custom value (3–32 alphanumeric chars + hyphens). The slug becomes the URL prefix:brewpage.app/{namespace}/{id}. - Ask password
Choose: no password, a generated 6-char random password, or your own (min 4 chars). Password-protected pages are hidden from the gallery.
- Upload via API
Calls the appropriate endpoint. For sites, zips the directory to a temp file, POSTs the archive, then removes the temp file. The owner token returned by the API is never printed — only appended to
.claude/brewpage-history.md. - Return result
Prints the public URL (and file count for sites). On error, prints
Publish failed.— check.claude/brewpage-history.mdfor context.
Internals
Security — owner token: The ownerToken field from the API response is captured inside the Bash block and written directly to .claude/brewpage-history.md. The LLM only sees OK {url} or FAILED: ... — never the token value.
History file format:
| Date | URL | Owner Token | TTL | Type |
|------|-----|-------------|-----|------|
| 2026-04-17 12:00 | https://brewpage.app/my-ns/abc123 | `tok_...` | 5d | html |Delete a published page:
curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" \
-H "X-Owner-Token: TOKEN"For sites use /api/sites/{ns}/{id}.
Namespace rules: lowercase alphanumeric + hyphens, 3–32 chars. Auto-suggestion is content-derived (api-docs, report-q2) — never a random string or truncated filename.
Site uploads: directory → zipped to mktemp /tmp/brewpage-site-XXXXXX.zip → POSTed as archive=@$TMPZIP → temp file removed. User-Agent: ClaudeCode/1.0 header included.
md-to-pdf
Convert markdown to PDF before publishing — combine with publish for shareable PDFs.
GitHub source
Source code, SKILL.md, and API integration details.
Brewdoc overview
All brewdoc skills — auto-sync, memory, my-claude, and more.
Updating plugins
/brewtools:plugin-update to check and update the brewcode plugin suite in one command.
See the FAQ for details.