$ cat ~/map/pi-share-hf.md
pi-share-hf
Collect, redact, and publish Pi session traces to a Hugging Face dataset.
officialtools✓ Oct 16
Facts
- repository
- github.com/badlogic/pi-share-hf ↗
- GitHub Stars
- ★ 258
- Forks
- 23
- license
- —
- npm / mo
- —
- last push
- Apr 13, 2026
install
npm install -g pi-share-hf## TL;DR
Official pipeline from Pi's author for publishing pi coding agent sessions of one OSS project to a Hugging Face dataset — collect, redact secrets, scan with TruffleHog, run LLM review, and upload only sessions that pass every check.
## Key points
- $Incremental six-stage pipeline: collect changed/new sessions for one project, redact exact secrets from the env file and --secret inputs, reject sessions matching --deny patterns, scan redacted output with TruffleHog, run LLM review, then upload only sessions that pass all checks.
- $Deterministic redaction only replaces exact secret values (from --env-file, default ~/.zshrc, plus repeatable --secret file/literal inputs); TruffleHog then scans the redacted output and any finding — verified, unverified, or unknown — blocks the session automatically.
- $LLM review sees the project context files plus a plain-text transcript of the redacted session and answers about_project, shareable, and missed_sensitive_data; review sidecars land in .pi/hf-sessions/review/, and changing provider, model, or thinking level changes the review cache key.
- $The .pi/hf-sessions/ workspace keeps state, so repeated runs only process what changed; pi-share-hf init maps a project directory to a Hugging Face dataset repo in a personal or --organization namespace, and the same workspace can be used from multiple machines.
- $Command set: init, collect, review, reject, list --uploadable, grep (searches only the uploadable set), and upload with --dry-run; upload uses a built-in TypeScript Hugging Face client, and auth works via HF_TOKEN or ~/.cache/huggingface/token.
## FAQ
Q Does it need the Hugging Face CLI?
No. upload pushes through a built-in TypeScript Hugging Face client — no huggingface-cli is needed. Create a Hugging Face write token and either export HF_TOKEN or save it to ~/.cache/huggingface/token.
Q How do I make sure something never gets published?
Add one regex per line to deny.txt and pass it with --deny to block whole names, topics, or projects; reject individual sessions with pi-share-hf reject <session>.jsonl. Before uploading, audit the set with list --uploadable and grep, and run upload --dry-run for counts without pushing.
## References
## Related entries
$ CCompactor
Turns finished coding-agent sessions — Pi, Claude Code, Codex — into compact, verified, provenance-linked handoff artifacts, in TypeScript.
$ Pi Chat
Minimal local browser chat for pi: streaming replies, persistent sessions, and in-pi launching via /pi-chat-start.
$ Pi Session Manager
A local-first desktop workbench for browsing, searching, and resuming Pi sessions.
## Guides
Last updated: Aug 31, 2026