Post any content — summaries, plans, reports, pitches, logs — to GitHub Gist and share the URL. A lightweight way for agents to publish rich context that humans and other agents can read from anywhere.
Agents communicate through messages, but messages disappear into scroll. A gist is:
When an agent needs to hand off context to a human, another agent, or a future session — a gist beats a wall of chat text.
You need a GitHub Personal Access Token (PAT) with the gist scope.
openclaw-gistgist scope (that's all you need)gh CLIOpenClaw uses the gh CLI to post gists. Set your token as an environment variable for the session:
export GITHUB_TOKEN=ghp_yourTokenHere
Or add it permanently to your shell profile (~/.bashrc, ~/.zshrc, etc.):
echo 'export GITHUB_TOKEN=ghp_yourTokenHere' >> ~/.zshrc
source ~/.zshrc
gh auth status
You should see your account and gist listed under token scopes.
Use the exec tool to call gh gist create:
gh gist create --public --desc "Your description here" --filename "your-file.md" - << 'EOF'
Your content here.
Supports **markdown** formatting.
EOF
Replace --public with --secret if the content shouldn't be publicly indexed.
gh gist create \
--public \
--desc "DESCRIPTION" \
--filename "FILENAME.md" - << 'GISTEOF'
# TITLE
CONTENT GOES HERE
GISTEOF
The command returns the gist URL on success:
✓ Created public gist FILENAME.md
https://gist.github.com/USERNAME/HASH
--public for sharing freely, --secret for targeted sharinggh gist create via execgh gist create --public --desc "Q2 Roadmap Summary" --filename "q2-roadmap.md" - << 'EOF'
# Q2 Roadmap Summary
## Phase 1 — Foundation (April)
- Complete ClawDash MVP
- Ship ClawCanvas v1
## Phase 2 — Expansion (May)
- Launch ClawText beta
- Begin ClawTomation integration
## Phase 3 — Scale (June)
- Public launch of suite
- Partner integrations go live
EOF
.md extension for GitHub to render markdowngh gist edit GIST_ID — gists are editable if you need to revisegh gist list shows recent gists with their IDs and URLs| Problem | Fix |
|---|---|
| --- | --- |
gh: command not found | Install via brew install gh (macOS) or apt install gh (Linux) |
HTTP 401 Unauthorized | Token missing or expired — re-run setup |
Token missing gist scope | Regenerate the PAT with gist scope checked |
gh auth status shows invalid token | Run gh auth login and follow the prompts |
Gists: the simplest way for a claw to leave a note the world can read.
共 1 个版本