Publish pi coding agent sessions from one OSS project to a Hugging Face dataset.
It is an incremental pipeline for:
--secret--denyUse it if you want to:
It keeps state in a workspace, so repeated runs only process what changed (updated sessions, new sessions).
npm install -g pi-share-hf
npm install -g @mariozechner/pi-coding-agent
Install TruffleHog:
brew install trufflehog
For Linux and Windows, use the upstream install instructions:
For Hugging Face auth, create a write token and either:
export HF_TOKEN=hf_xxx
or save it to:
~/.cache/huggingface/token
The CLI checks startup requirements and exits with install or auth instructions if something is missing.
Use one workspace per OSS project. In your OSS project directory:
.pi/hf-sessions/ to .gitignorepi-share-hf init oncepi-share-hf collect to gather changed and new sessions, redact known secrets, filter by --deny, scan with TruffleHog, and run LLM reviewpi-share-hf list --uploadable, pi-share-hf grep, and the images folder if images are enabledpi-share-hf uploadThe workspace is incremental. It keeps the collected state so repeated runs only process what changed.
You can use pi-share-hf on multiple machines for the same project.
Inside your OSS project:
cd /path/to/my-project
echo ".pi/hf-sessions/" >> .gitignore
Initialize once:
# personal namespace
pi-share-hf init --repo myuser/my-project-sessions
# or org namespace
pi-share-hf init --repo my-project-sessions --organization myorg
Collect sessions:
pi-share-hf collect \
--secret secrets.txt \
--deny deny.txt \
--provider openai-codex --model gpt-5.4 --thinking medium \
--parallel 4 \
README.md AGENTS.md
Recommended inputs:
secrets.txt: one known secret per line. Generate it just before collect, do not commit it, and delete it after use.deny.txt: one regex per line for names, topics, or projects that should never be publishedREADME.md AGENTS.md: project context for the LLM review so it can distinguish OSS work from unrelated workYou can also repeat flags directly:
--secret <file> or --secret <literal>--deny <file> or --deny <regex>If you do not want a secrets file on disk, pass repeated --secret <literal> values instead.
Check what would be uploaded:
pi-share-hf list --uploadable
Search only the uploadable set:
pi-share-hf grep -i 'my-private-project|counterparty-name|finance'
Reject anything you do not want published:
pi-share-hf reject 2026-01-16T11-03-04-216Z_b8b30402-d134-4f0d-9e6e-e2f72ada5a2f.jsonl
Upload:
pi-share-hf upload --dry-run
pi-share-hf upload
It only knows exact secret values.
Sources:
--env-file (default: ~/.zshrc)--secret <file> with one secret per line--secret <literal>This is deliberate. Exact values are high precision. Generic token regexes are noisy. TruffleHog handles generic secret detection after redaction.
TruffleHog scans the redacted output, not the original raw session.
That means:
Any TruffleHog finding blocks the session automatically.
That includes:
verifiedunverifiedunknownSo you do not need to manually inspect TruffleHog hits to decide whether a session is uploadable. The reports are there for debugging, auditing, and understanding why a session was blocked.
Per-session TruffleHog reports are stored in:
.pi/hf-sessions/reports/<session>.trufflehog.json
Example:
{
"file": "...jsonl",
"redacted_hash": "sha256:...",
"findings": [
{
"detector": "NpmToken",
"status": "verified",
"line": 132,
"raw_sha256": "sha256:...",
"masked": "npm_tnl0***x4eE",
"verification_from_cache": false
}
],
"summary": {
"findings": 1,
"verified": 1,
"unverified": 0,
"unknown": 0,
"top_detectors": ["NpmToken"]
}
}
The LLM sees project context files plus a plain-text transcript of the redacted session.
It answers:
Review output includes:
about_project: yes | no | mixedshareable: yes | no | manual_reviewmissed_sensitive_data: yes | no | maybeflagged_partssummaryReview files are stored in:
.pi/hf-sessions/review/<session>.review.json
Changing provider, model, or thinking level changes the review cache key. The key includes the redacted session hash, context file hashes, provider, model, thinking level, deny-pattern hash, prompt version, and chunk size. If you rerun review with different settings, existing review sidecars for those sessions are replaced.
upload doesupload pushes only sessions that passed deterministic checks, TruffleHog, and LLM review.
It skips sessions that are manually rejected, missing review data, failed review, or already unchanged on the remote dataset.
Use upload --dry-run first if you want counts without pushing anything.
Before uploading, inspect what is currently uploadable:
pi-share-hf list --uploadable
Useful checks:
pi-share-hf grepdeny.txt and rerun collect if you discover a new never-publish topic.pi/hf-sessions/images/ when image preservation is enabled.pi/hf-sessions/reports/*.trufflehog.json only if you want to debug or audit why a session was blocked by TruffleHogpi-share-hf rejectTypical grep checks:
pi-share-hf grep -i 'private-project|counterparty|finance|agreement|royalt'
pi-share-hf grep -i 'gmail|calendar|drive|slack'
initCreates .pi/hf-sessions/, writes workspace.json, and records which project directory maps to which Hugging Face dataset repo.
By default it uses:
--cwd.pi/hf-sessions as --workspacepi-share-hf init --repo user/dataset
pi-share-hf init --repo dataset-name --organization myorg
Main options:
--cwd <dir> project directory to map to pi session storage--repo <id> HF dataset repo--organization <name> optional namespace when --repo is a bare name--workspace <dir> workspace dir, default .pi/hf-sessions--no-images strip embedded images from redacted outputcollectCollects sessions for the configured project, redacts literal secrets, runs TruffleHog on changed redacted files, and runs the LLM review to write or update review sidecars.
By default it uses:
.pi/hf-sessions as --workspace~/.zshrc as --env-fileREADME.md and AGENTS.md as context files when presentpi-share-hf collect [context-files...]
Main options:
--workspace <dir> workspace, default .pi/hf-sessions--env-file <path> secret source file, default ~/.zshrc--secret <file>|<text> repeatable--force reprocess all sessions--provider <name> review provider override--model <id> review model override--thinking <level> review thinking override--parallel <n> concurrent LLM reviews--deny <file>|<regex> reject sessions matching this pattern--session <file> process one session onlyreviewReruns only the LLM review step on already-redacted sessions in the workspace.
By default it uses:
.pi/hf-sessions as --workspaceREADME.md and AGENTS.md as context files when presentpi-share-hf review [context-files...]
Uses the same review-related flags as collect.
rejectMarks a session as never uploadable by adding it to reject.txt.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf reject <session.jsonl|image.png>
If you pass an extracted image path, the owning session is rejected.
listLists sessions from the workspace.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf list --uploadable
grepSearches only the currently uploadable sessions.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf grep -i 'finance|counterparty|private-project'
uploadUploads the current uploadable sessions and updates the remote dataset manifest.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf upload --dry-run
pi-share-hf upload
Uses the built-in TypeScript Hugging Face client. No huggingface-cli is needed.
.pi/hf-sessions/
workspace.json
manifest.local.jsonl
remote-manifest.jsonl
manifest.jsonl
redacted/ public candidate files
reports/ private deterministic + TruffleHog reports
review/ private LLM review sidecars
review-chunks/ private transcript chunks
images/ extracted preserved images for uploadable sessions
reject.txt
manifest.jsonl
<session>.jsonl
Each uploaded *.jsonl file is a redacted pi session.
Session format docs:
npm run check
33 commits
2 commits
TypeScript
98.2%
JavaScript
1.8%
Publish pi coding agent sessions from one OSS project to a Hugging Face dataset.
It is an incremental pipeline for:
--secret--denyUse it if you want to:
It keeps state in a workspace, so repeated runs only process what changed (updated sessions, new sessions).
npm install -g pi-share-hf
npm install -g @mariozechner/pi-coding-agent
Install TruffleHog:
brew install trufflehog
For Linux and Windows, use the upstream install instructions:
For Hugging Face auth, create a write token and either:
export HF_TOKEN=hf_xxx
or save it to:
~/.cache/huggingface/token
The CLI checks startup requirements and exits with install or auth instructions if something is missing.
Use one workspace per OSS project. In your OSS project directory:
.pi/hf-sessions/ to .gitignorepi-share-hf init oncepi-share-hf collect to gather changed and new sessions, redact known secrets, filter by --deny, scan with TruffleHog, and run LLM reviewpi-share-hf list --uploadable, pi-share-hf grep, and the images folder if images are enabledpi-share-hf uploadThe workspace is incremental. It keeps the collected state so repeated runs only process what changed.
You can use pi-share-hf on multiple machines for the same project.
Inside your OSS project:
cd /path/to/my-project
echo ".pi/hf-sessions/" >> .gitignore
Initialize once:
# personal namespace
pi-share-hf init --repo myuser/my-project-sessions
# or org namespace
pi-share-hf init --repo my-project-sessions --organization myorg
Collect sessions:
pi-share-hf collect \
--secret secrets.txt \
--deny deny.txt \
--provider openai-codex --model gpt-5.4 --thinking medium \
--parallel 4 \
README.md AGENTS.md
Recommended inputs:
secrets.txt: one known secret per line. Generate it just before collect, do not commit it, and delete it after use.deny.txt: one regex per line for names, topics, or projects that should never be publishedREADME.md AGENTS.md: project context for the LLM review so it can distinguish OSS work from unrelated workYou can also repeat flags directly:
--secret <file> or --secret <literal>--deny <file> or --deny <regex>If you do not want a secrets file on disk, pass repeated --secret <literal> values instead.
Check what would be uploaded:
pi-share-hf list --uploadable
Search only the uploadable set:
pi-share-hf grep -i 'my-private-project|counterparty-name|finance'
Reject anything you do not want published:
pi-share-hf reject 2026-01-16T11-03-04-216Z_b8b30402-d134-4f0d-9e6e-e2f72ada5a2f.jsonl
Upload:
pi-share-hf upload --dry-run
pi-share-hf upload
It only knows exact secret values.
Sources:
--env-file (default: ~/.zshrc)--secret <file> with one secret per line--secret <literal>This is deliberate. Exact values are high precision. Generic token regexes are noisy. TruffleHog handles generic secret detection after redaction.
TruffleHog scans the redacted output, not the original raw session.
That means:
Any TruffleHog finding blocks the session automatically.
That includes:
verifiedunverifiedunknownSo you do not need to manually inspect TruffleHog hits to decide whether a session is uploadable. The reports are there for debugging, auditing, and understanding why a session was blocked.
Per-session TruffleHog reports are stored in:
.pi/hf-sessions/reports/<session>.trufflehog.json
Example:
{
"file": "...jsonl",
"redacted_hash": "sha256:...",
"findings": [
{
"detector": "NpmToken",
"status": "verified",
"line": 132,
"raw_sha256": "sha256:...",
"masked": "npm_tnl0***x4eE",
"verification_from_cache": false
}
],
"summary": {
"findings": 1,
"verified": 1,
"unverified": 0,
"unknown": 0,
"top_detectors": ["NpmToken"]
}
}
The LLM sees project context files plus a plain-text transcript of the redacted session.
It answers:
Review output includes:
about_project: yes | no | mixedshareable: yes | no | manual_reviewmissed_sensitive_data: yes | no | maybeflagged_partssummaryReview files are stored in:
.pi/hf-sessions/review/<session>.review.json
Changing provider, model, or thinking level changes the review cache key. The key includes the redacted session hash, context file hashes, provider, model, thinking level, deny-pattern hash, prompt version, and chunk size. If you rerun review with different settings, existing review sidecars for those sessions are replaced.
upload doesupload pushes only sessions that passed deterministic checks, TruffleHog, and LLM review.
It skips sessions that are manually rejected, missing review data, failed review, or already unchanged on the remote dataset.
Use upload --dry-run first if you want counts without pushing anything.
Before uploading, inspect what is currently uploadable:
pi-share-hf list --uploadable
Useful checks:
pi-share-hf grepdeny.txt and rerun collect if you discover a new never-publish topic.pi/hf-sessions/images/ when image preservation is enabled.pi/hf-sessions/reports/*.trufflehog.json only if you want to debug or audit why a session was blocked by TruffleHogpi-share-hf rejectTypical grep checks:
pi-share-hf grep -i 'private-project|counterparty|finance|agreement|royalt'
pi-share-hf grep -i 'gmail|calendar|drive|slack'
initCreates .pi/hf-sessions/, writes workspace.json, and records which project directory maps to which Hugging Face dataset repo.
By default it uses:
--cwd.pi/hf-sessions as --workspacepi-share-hf init --repo user/dataset
pi-share-hf init --repo dataset-name --organization myorg
Main options:
--cwd <dir> project directory to map to pi session storage--repo <id> HF dataset repo--organization <name> optional namespace when --repo is a bare name--workspace <dir> workspace dir, default .pi/hf-sessions--no-images strip embedded images from redacted outputcollectCollects sessions for the configured project, redacts literal secrets, runs TruffleHog on changed redacted files, and runs the LLM review to write or update review sidecars.
By default it uses:
.pi/hf-sessions as --workspace~/.zshrc as --env-fileREADME.md and AGENTS.md as context files when presentpi-share-hf collect [context-files...]
Main options:
--workspace <dir> workspace, default .pi/hf-sessions--env-file <path> secret source file, default ~/.zshrc--secret <file>|<text> repeatable--force reprocess all sessions--provider <name> review provider override--model <id> review model override--thinking <level> review thinking override--parallel <n> concurrent LLM reviews--deny <file>|<regex> reject sessions matching this pattern--session <file> process one session onlyreviewReruns only the LLM review step on already-redacted sessions in the workspace.
By default it uses:
.pi/hf-sessions as --workspaceREADME.md and AGENTS.md as context files when presentpi-share-hf review [context-files...]
Uses the same review-related flags as collect.
rejectMarks a session as never uploadable by adding it to reject.txt.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf reject <session.jsonl|image.png>
If you pass an extracted image path, the owning session is rejected.
listLists sessions from the workspace.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf list --uploadable
grepSearches only the currently uploadable sessions.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf grep -i 'finance|counterparty|private-project'
uploadUploads the current uploadable sessions and updates the remote dataset manifest.
By default it uses .pi/hf-sessions as --workspace.
pi-share-hf upload --dry-run
pi-share-hf upload
Uses the built-in TypeScript Hugging Face client. No huggingface-cli is needed.
.pi/hf-sessions/
workspace.json
manifest.local.jsonl
remote-manifest.jsonl
manifest.jsonl
redacted/ public candidate files
reports/ private deterministic + TruffleHog reports
review/ private LLM review sidecars
review-chunks/ private transcript chunks
images/ extracted preserved images for uploadable sessions
reject.txt
manifest.jsonl
<session>.jsonl
Each uploaded *.jsonl file is a redacted pi session.
Session format docs:
npm run check
33 commits
2 commits
TypeScript
98.2%
JavaScript
1.8%