publish
它能做什么
这项技能把知识库中的页面制作成一个独立的网页,方便你分享。页面默认用密码保护,并且会先删除私密细节。
适用场景
- ✓当你想与知识库之外的人分享一个知识库页面时。
- ✓当你想以链接形式发送交易备忘录、简报或研究内容时。
- ✓当你想分享旅行计划或数据分析,又不想暴露整个知识库时。
技能链接
https://github.com/garrytan/gbrain/blob/master/plugin/skills/publish/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的交易备忘录做成一个有密码保护的网页,方便我发给我的合伙人。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会移除来源和内部链接等私密细节,然后在浏览器中对内容进行加密。最终结果是一个不需要服务器的单独 HTML 文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Publish Skill
Share brain pages as beautiful, self-contained HTML documents. Optionally password-protected with client-side AES-256-GCM encryption. No server needed.
This is a code + skill pair: the deterministic code (gbrain publish) does
the stripping, encrypting, and HTML generation. This skill tells you when and
how to use it. See Thin Harness, Fat Skills
for the architecture philosophy.
Contract
- Published HTML is fully self-contained: no external dependencies, no server needed.
- All private metadata (frontmatter, source citations, confirmation numbers, brain cross-links, timeline) is stripped before publishing.
- Password protection uses AES-256-GCM with PBKDF2 key derivation; plaintext never appears in the encrypted HTML file.
- Default is always encrypted unless the user explicitly requests "open", "no password", or "public".
- External URLs (
https://...) are preserved; only internal brain paths are stripped.
When to Publish
- User asks to share a brain page, create a shareable link, or says "give me a page"
- User wants to send a deal memo, person briefing, or research to someone external
- User asks to publish a data room analysis or trip plan
- Any time brain content needs to leave the brain without exposing the whole system
Default: ALWAYS ENCRYPT
Brain content is private. Default to password-protected unless the user explicitly says "open", "no password", or "public".
If no password is specified, auto-generate one. Share the password via a different channel than the URL.
Quick Reference
# Basic publish (outputs local HTML file)
gbrain publish brain/companies/acme.md
# Password protected (auto-generate password)
gbrain publish brain/companies/acme.md --password
# Password protected (specific password)
gbrain publish brain/companies/acme.md --password "secret123"
# Custom title
gbrain publish brain/companies/acme.md --password --title "Acme -- Deal Analysis"
# Custom output path
gbrain publish brain/companies/acme.md --out /tmp/acme-share.html
What Gets Stripped
The publish command automatically removes all private/internal data:
| Stripped | Example | Why |
|---|---|---|
| YAML frontmatter | title:, type:, tags: |
Internal metadata |
[Source: ...] citations |
All formats | Provenance is internal |
| Confirmation numbers | ABC123DEF -> "on file" |
PII/booking data |
| Brain cross-links | [Jane](../people/jane.md) -> Jane |
Internal paths |
| Timeline section | Everything below --- / ## Timeline |
Raw evidence log |
| "See also" lines | Internal references | Brain navigation |
Preserved: external URLs (https://...), all other content.
Sharing Workflows
Option A: Local file (simplest)
gbrain publish brain/people/jane-doe.md --password --out ~/Desktop/jane-briefing.html
Share the HTML file via email, Slack, Airdrop. Share the password separately.
Option B: Upload to cloud storage
# Publish locally first
gbrain publish brain/companies/acme.md --password "secret" --out /tmp/acme.html
# Upload to Supabase Storage
gbrain files upload /tmp/acme.html --page shares/acme
# Get a signed URL (1-hour expiry)
gbrain files signed-url shares/acme/acme.html
Share the signed URL + password. URL expires in 1 hour. Re-generate as needed.
Option C: Static hosting (Render, Netlify, S3)
Upload the HTML file to any static hosting service. The file is self-contained, no server logic needed. Password-protected files work entirely client-side via Web Crypto API.
Option D: GitHub Pages / Gist
gbrain publish brain/trips/japan-2026.md --out trip.html
# Upload to a GitHub Gist or Pages repo
Password Protection Details
- Algorithm: AES-256-GCM
- Key derivation: PBKDF2 with 100K iterations, SHA-256
- Salt: Random 16 bytes per encryption
- IV: Random 12 bytes per encryption
- Decryption: Client-side via Web Crypto API (SubtleCrypto)
- No server auth needed -- the HTML file is self-contained
- "Remember on this device" -- saves password in localStorage
When encrypted, the published HTML contains ONLY ciphertext. The plaintext is not present anywhere in the file.
Updating a Published Page
Re-run the publish command with the same output path:
gbrain publish brain/companies/acme.md --password "same-password" --out shares/acme.html
Same file, same URL (if hosted), updated content
常见问题
页面是加密的吗?
是的。它使用 AES-256-GCM 加密,纯文本不会出现在文件中。
我能不设密码就发布吗?
只有在你明确要求公开页面时才可以。
我的知识库链接会显示在页面上吗?
不会。内部知识库路径和私密元数据会在发布之前被移除。
详情
作者的原始描述
Share brain pages as beautiful password-protected HTML with zero LLM calls
repo: garrytan/gbrain
热度
- GitHub 星标
- 31k
- 排名
- #9307
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …