This release is a pre-release and may not be stable for production use.
Grit
Session-based Git profile manager — right identity, every commit.
What is Grit?
Grit is a cross-platform background daemon that manages multiple Git identities — name, email, GPG signing key, SSH key — across all your repositories. It uses session-based memory to automatically apply the right profile per repository, prompting you just-in-time when a new repository is first encountered.
No more wrong-account commits. No global git config juggling. Grit handles it silently in the background.
Features
- Session memory — remembers your active profile per repository for a configurable TTL (default 8 hours)
- Auto-detection —
.gritfile in the repo root, path glob patterns (~/work/*), or remote URL patterns select the right profile automatically - Git hook integration — installs a
pre-commithook that applies the correct identity before every commit - System tray — live profile indicator with one-click profile switching
- VS Code extension — active profile in the status bar, switch profiles from the command palette
- GPG signing — per-profile commit signing key, configured automatically
- SSH keys — per-profile
core.sshCommandconfigured viassh -i <key> - HTTP credentials — per-profile GitHub username routing for HTTPS remotes
- Up to 5 profiles — free tier, no account required, fully offline
Installation
pip install grit-cli
The distribution is published as
grit-clion PyPI (thegritname was already taken), but it still installs thegritcommand you use everywhere below.
Requirements: Python 3.8+, Git 2.x
Optional extras:
pip install "grit-cli[ui-qt]" # PyQt6 profile picker dialog
pip install "grit-cli[linux-keyring]" # keyring integration on Linux
pip install "grit-cli[windows]" # pywin32 for Windows Credential Manager
Quick Start
# First-time setup (creates config, first profile, installs autostart)
grit setup
# Add more profiles
grit profile add
# Activate a profile in the current repository
grit session set Work
# See which profile is active here
grit session show
# List all profiles (active one is highlighted)
grit profile list
How It Works
git commit
└─▶ .git/hooks/pre-commit
└─▶ grit hook pre-commit --repo <path>
└─▶ IPC → daemon
└─▶ SessionEngine.resolve()
├─ session cache hit → apply profile → done
├─ auto-detect (.grit / path pattern / remote) → create session → apply
└─ no match → prompt user via popup / tray
Profile data is written directly to the repository's local git config — no wrapper scripts, no shims.
Auto-detection priority
.gritfile in the repo root (profile = Work)- Path pattern match (
~/work/*→ Work profile) - Remote URL pattern match (
github.com/my-company/*→ Work profile) - Prompt — one-time selection, then remembered for the session TTL
Commands
Profiles
grit profile add # create a profile (interactive wizard)
grit profile add -n Work -e work@company.com --gpg-key ABC123
grit profile list # list all profiles; active one marked
grit profile show <name> # show full details
grit profile edit <name> --email new@email.com
grit profile delete <name>
Sessions
grit session show # active profile in this repo
grit session set <profile> # activate a profile in this repo
grit session list # all active sessions
grit session clear # end the session for this repo
Daemon
grit daemon start # start background daemon
grit daemon start --foreground # run in foreground (development)
grit daemon stop
grit daemon status
grit daemon restart
Setup & Info
grit setup # first-run wizard
grit about # version, plan, contact
grit upgrade # feature comparison: Free / Pro / Enterprise
Configuration
Config is stored in the platform-specific user directory:
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/grit/ |
| Linux | ~/.config/grit/ |
| Windows | %APPDATA%\grit\ |
Override with the GRIT_CONFIG_DIR environment variable (useful for testing).
Key settings (grit config set <key> <value>):
| Key | Default | Description |
|---|---|---|
session_ttl_hours |
8 |
How long a session stays active |
auto_detect |
true |
Enable profile auto-detection |
cloud_sync_enabled |
false |
Enable cloud sync (Pro) |
Data Files
| File | Contents |
|---|---|
profiles.json |
Your Git identity profiles |
sessions.json |
Active sessions per repository |
config.json |
App configuration |
grit.pid |
Daemon PID |
grit.sock |
IPC socket (macOS / Linux) |
All writes are atomic (.tmp → os.replace()).
Platform Support
| Feature | macOS | Linux | Windows |
|---|---|---|---|
| Core daemon + CLI | ✓ | ✓ | ✓ |
| System tray | ✓ | ✓ (X11) | ✓ |
| Autostart | LaunchAgent | XDG / systemd user | Registry Run key |
| IPC | Unix socket | Unix socket | TCP loopback |
| GPG signing | ✓ | ✓ | ✓ |
| SSH key routing | ✓ | ✓ | ✓ |
| Windows Credential Manager | — | — | ✓ |
Development
git clone <repo>
cd grit
pip install -e ".[dev]"
# Run tests
pytest tests/unit/ # fast unit tests
pytest tests/unit/ --cov=grit # with coverage
pytest -m integration # requires real git binary
pytest -m e2e --timeout=60 # full end-to-end (CI only)
# Code quality
ruff check src/ tests/
ruff format src/ tests/
mypy src/
Grit Pro — Coming Soon
Grit Pro adds:
- Unlimited profiles (free tier: 5)
- Cloud sync — profiles and sessions across all your machines
- Team profiles — org-wide read-only profiles pushed from your admin dashboard
- Enterprise SSO — OIDC and SAML 2.0 login
- Audit logs — SIEM-ready append-only log of every profile switch
- Compliance reporting — hook inventory, GPG enforcement, SSO compliance
Grit Pro is not yet available. Pre-register to be notified at launch:
kandeepasundaram+GRIT@gmail.com
Release Notes
Full changelogs for every release are on the GitHub Releases page.
| Version | Highlights |
|---|---|
| 0.1.0a3 | Auto-generated release notes; fully automated release pipeline |
| 0.1.0a2 | Platform-specific tray threading; headless Linux display guard |
| 0.1.0a1 | Tray icon wired; pre-commit profile application fixed |
| 0.1.0a0 | Initial release |
License
MIT — see LICENSE.
Made with grit.
Metadata
Release files for grit-cli 0.1.0a4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grit_cli-0.1.0a4.tar.gz | 1.5 MB | With provenance | Details for grit_cli-0.1.0a4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grit_cli-0.1.0a4-py3-none-any.whl | Python 3 | none | any | Details for grit_cli-0.1.0a4-py3-none-any.whl |
Total release size: 1.6 MB
Release files / grit_cli-0.1.0a4.tar.gz
| Download URL | grit_cli-0.1.0a4.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
182c0d1e59ea5509a587925a92fa62e8042f955010ab43a2465b445ec7780a99
|
|
BLAKE2b-256 checksum How to use checksums |
a1d5a9585dac46e42b368cfac2cc64890c5890f0ae40e43a9807d2a6b79019e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logRelease files / grit_cli-0.1.0a4-py3-none-any.whl
| Download URL | grit_cli-0.1.0a4-py3-none-any.whl |
|---|---|
| Size | 76.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a1c3b0b421d56f2f81dbbf5a48427eb418e73a235545abadc7e0b630907683b
|
|
BLAKE2b-256 checksum How to use checksums |
d0369af9a9ef758c5982caa63badf7a93ac8f34667778c651140572d621ceee7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logSecurity for grit-cli 0.1.0a4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for grit_cli-0.1.0a4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.