PGit CLI

Git-Native Private Tracking for AI-Assisted Devs

Keep local configs, plans, and private notes visible to AI agents without staging them into shared Git history.

$ pgit add .codex/ .claude/ todo.md
✔ Successfully tracked 3 paths in private config
ℹ Created private store snapshot at ~/.pgit/private-config/my-project
ℹ Automatically installed pre-commit & pre-push hooks
$ git add .
$ git commit -m "feat: implement logic"
⚙ PGit Pre-Commit Hook: Action Blocked
✖ [SECURITY BLOCK] Found private tracked path staged for commit: "todo.md"
💡 Use "pgit drop todo.md" to clear local changes before committing
$ pgit status
PGit Configuration Sync Status:
Path Local Status Sync Status
---------------------------------------------------
.codex/ [exists] up-to-date
.claude/ [modified] modified-locally
todo.md [exists] up-to-date
specs/architecture [missing] missing-repo (available in private-store)
$ pgit push .
Syncing paths to private store...
✔ Pushed local changes for ".claude/" to store
✔ Pushed local changes for "todo.md" to store
✔ Sync completed. Private store up-to-date
$ pgit drop .
⚠ Removing 3 tracked path(s) from working tree...
✔ Safely removed local copy of ".codex/"
✔ Safely removed local copy of ".claude/"
✔ Safely removed local copy of "todo.md"
💡 Your private copies are still safe in ~/.pgit/private-config/
$ git status
nothing to commit, working tree clean

Designed for Agent Workflows

Keep your workspace discoverable for tools while ensuring repository hygiene.

In-Place File Tracking

Tracked files stay as real files in their exact repository paths. No complex symlinks or directories that break tool discovery or IDE indexing.

📁 src/
📄 cli.ts
📄 config.ts
📁 .claude/ Tracked Private
📄 todo.md Agent Visible
📄 package.json

Failsafe Git Hooks

Auto-installed pre-commit and pre-push hooks safeguard your workflow. If an agent tries to stage a tracked private configuration, PGit blocks the action immediately.

Private Configuration Store

Canonical copies are stored in your user directory (~/.pgit/private-config). They link to your repository automatically via stable, normalized git remote identities.

Zero-Noise Pull Requests

Clean up your workspace with a single command before submitting your code. Drop local private artifacts instantly, commit your changes, and restore them when returning to work.

Standard Workflow (Accidental Leak)
$ git status
Changes to be committed:
modified: .claude/todo.md
new file: .codex/plan.md
PGit Workflow (Clean & Protected)
$ pgit drop . && git status
Changes to be committed:
modified: src/cli.ts
nothing else staged (private files protected)

The Three-Step Lifecycle

Integrated directly into your local CLI shell. Zero complexity.

01

Track Local Files

Add directories and configuration files to the PGit tracking manifest. They remain accessible as real local files in your working directory.

pgit add .claude/ todo.md
02

Synchronize State

Sync your modifications safely to your user-level private config database. Keep your backups secure and synchronized across multiple projects.

pgit push .
03

Clean Your Workspace

Drop your working copies to perform review and commit operations. Once done, restore your workspace back to its agent-ready state.

pgit drop . && pgit pull .

Secure Architecture

Local first: Your private workspace configuration remains strictly on your machine.

📁

Working Repo

Your active git directory containing your code and agent directories. Files are actual local files.

pgit push / pull
🔒

User Config Directory

Canonical copies are stored out-of-repo at ~/.pgit/private-config/ in project-specific directories.

Command Reference

Simple CLI vocabulary built to complement standard Git practices.

Common Questions

Answers to common design and integration queries.

No. PGit does not touch .gitignore or .git/info/exclude by default. It relies on the pre-commit and pre-push hooks to verify staging safety, keeping your configuration fully transparent to your IDE and local agents.

Your local configuration store resides outside the repository in your system home folder under ~/.pgit/private-config/<project-id>/. It keeps files separated by normalized repository remote URLs to sync across workspaces safely.

To avoid accidental loss, PGit prevents overwrites if the local copy and private store copy have both diverged. Supplying the --force flag allows you to bypass the check, which automatically creates a backup of the overwritten file inside your config directory.

Yes. PGit supports shared configurations. You can use pgit preset add --global <name> <paths...> to establish a system-wide preset pattern. Applying it to any new workspace is simple using pgit preset apply <name>.

Get Started Today

Ready to secure your local workspace? Installation takes seconds.

npm install -g pgit-cli