brewpage-publish
Original:🇺🇸 English
Translated
Publish content to brewpage.app — text, markdown, JSON, or file. Asks namespace and password, returns public URL. Triggers: publish, share link, upload to brewpage, host page, brewpage.
334installs
Added on
NPX Install
npx skill4agent add kochetkov-ma/claude-brewcode brewpage-publishTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →brewpage
Publish content to brewpage.app — free instant hosting for HTML pages, JSON documents, and files. No sign-up required.
Workflow
Step 1: Parse Arguments
Extract from :
$ARGUMENTS- → TTL in days (default:
--ttl N)5 - Remaining text →
content_arg
Step 2: Detect Content Type
| Input | Type | API |
|---|---|---|
| FILE | |
| JSON | |
| Anything else | HTML | |
For FILE: get file size and MIME type via Bash ().
For TEXT/JSON: count characters.
file --mime-type -bStep 3: Show Pre-Publish Stats
📊 Content: <type description> · <size> · <api endpoint>
TTL: <N> daysStep 4: Ask Namespace
Use AskUserQuestion:
Namespace determines the URL prefix and gallery visibility on brewpage.app.
Options:
1) public — visible in gallery (default)
2) {auto-suggested 6-8 char slug}
3) Enter custom namespace
4) Skip → use public
Reply with a number or your custom namespace (alphanumeric, 3-32 chars).Auto-suggest: for files — first 8 chars of filename (lowercase alphanumeric); for text — first meaningful words (lowercase alphanumeric, up to 8 chars).
Resolution:
- ,
1, or empty →4public - → suggested slug
2 - or any other string → use as-is
3
Step 5: Ask Password
Use AskUserQuestion:
Password protection (if set, page is hidden from gallery):
Options:
1) No password (default)
2) Random: {generated 6-char password, e.g. "kx7p2m"}
3) Enter custom password (min 4 chars)
4) Skip → no password
Reply with a number or your custom password.Generate random password EXECUTE using Bash tool:
bash
LC_ALL=C tr -dc 'a-z0-9' < /dev/urandom | head -c6 2>/dev/nullResolution:
- ,
1, or empty → no password4 - → use generated random password
2 - or custom text → use as-is
3
Step 6: Build and Execute API Call
HTML/Markdown text — EXECUTE using Bash tool:
bash
CONTENT=$(cat <<'BREWPAGE_EOF'
{content}
BREWPAGE_EOF
)
PAYLOAD=$(jq -n --arg c "$CONTENT" '{content: $c, format: "markdown"}')
curl -s -X POST "https://brewpage.app/api/html?ns={ns}&ttl={days}" \
-H "Content-Type: application/json" \
[-H "X-Password: {pass}"] \
-d "$PAYLOAD"JSON — EXECUTE using Bash tool:
bash
curl -s -X POST "https://brewpage.app/api/json?ns={ns}&ttl={days}" \
-H "Content-Type: application/json" \
[-H "X-Password: {pass}"] \
-d '{original_json}'File — EXECUTE using Bash tool:
bash
curl -s -X POST "https://brewpage.app/api/files?ns={ns}&ttl={days}" \
[-H "X-Password: {pass}"] \
-F "file=@/absolute/path/to/file"Add only when password was set.
-H "X-Password: {pass}"Step 7: Parse Response and Output
Expected response:
json
{
"id": "abc123xyz",
"ns": "public",
"url": "https://brewpage.app/public/abc123xyz",
"ownerToken": "...",
"ownerLink": "..."
}Parse:
echo "$RESPONSE" | jq -r '.url, .ownerToken'Success output:
✅ Published!
🔗 https://brewpage.app/{ns}/{id}
🔑 Owner token: {ownerToken} ← saved to .claude/brewpage-history.mdError output:
❌ Publish failed.
Response: {raw_response}Step 8: Save Owner Token to Local History
On success, append a record to in the current project directory (create if missing):
.claude/brewpage-history.mdEXECUTE using Bash tool:
bash
HISTORY_FILE=".claude/brewpage-history.md"
if [ ! -f "$HISTORY_FILE" ]; then
cat > "$HISTORY_FILE" <<'EOF'
# brewpage.app — Published Pages
> Owner tokens are saved here for update/delete operations.
> Delete a page: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: {ownerToken}"`
| Date | URL | Owner Token | Password | TTL |
|------|-----|-------------|----------|-----|
EOF
fi
echo "| $(date '+%Y-%m-%d %H:%M') | [{url}]({url}) | \`{ownerToken}\` | {password_or_none} | {ttl}d |" >> "$HISTORY_FILE"If project has no directory, save to instead.
.claude/~/.claude/brewpage-history.mdTell the user: "Owner token saved to "
.claude/brewpage-history.mdNotes
- Always use absolute file paths with curl .
-F "file=@..." - Use to safely encode text content.
jq -n --arg c "$CONTENT" '{content: $c, format: "markdown"}' - TTL default is days.
5 - Namespace must be alphanumeric (3-32 chars). Default: .
public - To delete a published page later:
curl -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: {ownerToken}"
Powered by
| brewpage.app | Free instant hosting — HTML, JSON, files, KV. No sign-up. |
| brewcode | Claude Code plugin suite — infinite tasks, code review, skills, hooks. |