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

FieldValue
Command/brewdoc:publish <content> [--ttl N] [--entry filename]
ArgumentsText, file path, directory path, or .zip path
Modelhaiku
ToolsRead, 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

InputDetected typeEndpoint
Plain text or markdown stringHTMLPOST /api/html?format=markdown
Starts with { or [JSONPOST /api/json
Existing local file pathFILEPOST /api/files (multipart)
Directory or .zip fileSITEPOST /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

  1. 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.

  2. 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.

  3. 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}.

  4. 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.

  5. 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.

  6. Return result

    Prints the public URL (and file count for sites). On error, prints Publish failed. — check .claude/brewpage-history.md for 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

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.