AdapterGit (agit) — A TUI-free Git implementation that never hangs. Designed for automation, scripting, CI/CD, and shared computer environments.
- AI agents get stuck when Git opens a TUI editor
- Installing Git on every school lab machine is tedious
- Git commands unexpectedly launch interactive interfaces in scripts
- Native Git behaves unpredictably in non-TTY environments
agit solves all of these.
- Zero TUI blocking — safe for AI agents
- Structured JSON output, machine-readable
- Automatic
[AI-committed]tagging - Dangerous operation guards to prevent AI misoperations
agit ships in two editions. Both implement Git core logic natively from scratch in Rust with zero external Git dependencies:
| Full Edition | Lite Edition | |
|---|---|---|
| Format | Installable application package | Single-file portable binary |
| Installation | One-click installer (.msi / .deb / .dmg) | Download and run, no install needed |
| Size | ~20MB installer | ~10MB single file |
| Use case | Personal dev machines, enterprise deployment | AI agents, CI/CD, temporary environments, USB drives |
| System integration | PATH registration, context menu, file associations | Zero footprint, no system traces |
| Git core | Native Rust implementation | Native Rust implementation |
Both editions share the same native Rust Git core (SHA-1, zlib, Blob/Tree/Commit objects, refs, index, network protocols) — only the distribution format differs.
- Automatically skips all editors
- Intelligently converts interactive commands
- Non-TTY friendly
- Zero-configuration in CI/CD environments
- Works with existing Git repositories and workflows
- Supports a common subset of Git commands
- Gradual replacement of
gitcommands - Transparent fallback mechanism
# Linux / macOS
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-linux-x86_64 -o agit
chmod +x agit
./agit --help
# Windows (PowerShell)
Invoke-WebRequest -Uri https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-windows-x86_64.exe -OutFile agit.exe
.\agit.exe --help
# Run directly — no installation required
./agit init# Linux (.deb)
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-linux-x86_64.deb
sudo dpkg -i agit-full-linux-x86_64.deb
# macOS — download .tar.gz and extract
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-macos-x86_64.tar.gz
tar -xzf agit-full-macos-x86_64.tar.gz
sudo cp agit /usr/local/bin/
# Windows (.zip) — download and extract to PATH# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Clone and enter the repo
git clone https://github.com/bit-torch/AdapterGit.git
cd AdapterGit
# Full edition (TLS + AI)
cargo build --release --all-features
# Lite edition (no TLS, no AI)
cargo build --release --no-default-features -F tag
# Build specific crate
cargo build -p agit-core
cargo build -p agit-cli
# Static build (recommended for deployment)
cargo build --release --target x86_64-unknown-linux-musl --all-featuresagit init
agit add .
agit commit -m "feat: add new feature"
agit push origin main# AI invocation — never stuck in an editor
agit commit --ai "fix: login bug"
# Structured JSON output
{
"status": "success",
"command": "commit",
"commit_hash": "abc123def456",
"message": "fix: login bug\n\n[AI-committed]",
"timestamp": "2024-01-01T00:00:00Z"
}# Anywhere, no installation needed
cd /tmp/some-project
/path/to/agit add -A
/path/to/agit commit -m "work from public computer"# Temporarily replace git
alias git=agit
# Or only for specific scenarios
alias gai='agit --ai'# Via cargo
cargo install agit --features lite
# Or download the single binary directly
curl -L https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-lite-linux-x86_64 -o agit
chmod +x agit
sudo mv agit /usr/local/bin/ # optional, add to PATH# Via cargo
cargo install agit
# Linux (deb)
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-linux-x86_64.deb
sudo dpkg -i agit-full-linux-x86_64.deb
# macOS
curl -LO https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-macos-x86_64.tar.gz
tar -xzf agit-full-macos-x86_64.tar.gz && sudo cp agit /usr/local/bin/
# Windows
Invoke-WebRequest -Uri https://github.com/bit-torch/AdapterGit/releases/latest/download/agit-full-windows-x86_64.zip -OutFile agit-full.zip
Expand-Archive agit-full.zip
# Windows — winget (coming soon)
# winget install bit-torch.agit-full
# Windows — Chocolatey (coming soon)
# choco install agit-full- Download the appropriate release from GitHub Releases
- Lite:
chmod +x agitand run directly - Full: run the installer or add execute permission and move to a PATH directory
| Feature | agit Full | agit Lite | Native Git |
|---|---|---|---|
| AI-safe (no TUI hang) | Yes | Yes | No |
| Distribution | Installer (.msi/.deb/.dmg) | Single binary (~10MB) | Full installation required |
| Single-file portable | No (requires install) | Yes | No |
| System integration | PATH / context menu / file associations | Zero footprint | Full integration |
| Structured output | JSON / YAML | JSON / YAML | Plain text only |
| Zero-config run | Yes | Yes | No (requires git config) |
| Native Git core | Pure Rust | Pure Rust | C |
| Interactive operations | Not supported | Not supported | Full support |
| Scenario | Recommended Edition |
|---|---|
| Personal dev machine daily use | Full |
| Enterprise batch deployment | Full |
| AI Agent / automation scripts | Lite |
| CI/CD pipelines | Lite |
| Docker containers | Lite |
| USB drive / public computers | Lite |
| Context menu integration needed | Full |
| Quick use in temporary environments | Lite |
agit is purpose-built for AI agents:
agit commit --ai "fix login issue"
# Commit message automatically includes: [AI-committed]# agit automatically converts these dangerous commands
git commit -> agit commit -m "[AI] auto-commit"
git rebase -i -> agit rebase --no-edit
git add -p -> agit add -A
git mergetool -> Rejectedagit log --json
agit status --json
agit diff --json┌─────────────────────────────────────────┐
│ AI Agent / Script │
└─────────────────┬───────────────────────┘
│ JSON / Structured Output
┌─────────────────▼───────────────────────┐
│ agit (Adapter Layer) │
│ ┌───────────────────────────────────┐ │
│ │ TUI Elimination │ Portability │ AI Safety │ │
│ └─────────────────┬─────────────────┘ │
└─────────────────┬───────────────────────┘
│ Pure Rust Native Implementation
┌─────────────────▼───────────────────────┐
│ Native Git Core (Pure Rust) │
│ ┌───────────────────────────────────┐ │
│ │ Object Store │ Refs │ Diff Algorithm │ │
│ │ Pack Files │ Protocol │ Index System │ │
│ └───────────────────────────────────┘ │
└─────────────────┬───────────────────────┘
│ Unified Core → Dual Distribution
┌─────────────────▼───────────────────────┐
│ Distribution Layer │
│ ┌─────────────────┬─────────────────┐ │
│ │ Full Edition │ Lite Edition │ │
│ │ .msi/.deb/.dmg │ Single Binary │ │
│ │ Installer │ Download & Run │ │
│ └─────────────────┴─────────────────┘ │
└─────────────────────────────────────────┘
Full and Lite share the same native Rust Git core — only the distribution format differs.
We explicitly chose to reimplement Git in pure Rust rather than wrap libgit2 or shell out to the git binary. The core problem with both alternatives is that they were designed for an interactive developer at a terminal — not for long-running AI agents.
The FFI overhead and blocking issue. libgit2 is a battle-tested C library, but invoked through libgit2-sys it carries assumptions baked into its API: blocking I/O, single-threaded usage of internal buffers, and refresh hooks that expect an interactive TTY. For agents, this means a rebase mid-flight can hang waiting for input that will never arrive, and a long-running process that touches the same repo from multiple threads corrupts internal state. We need deterministic, non-blocking plumbing that an agent can SIGKILL without leaving a half-written index behind.
Shelling out is a security and portability liability. std::process::Command to launch git inherits the calling process's environment, so $GIT_DIR, SSH_AUTH_SOCK, and credential helpers leak across concurrent agent threads running in the same sandbox. It also forces a real Git install: awkward in stripped-down distroless Docker images, and a non-starter in Windows school labs where installing Git is not an option. The git binary itself is ~40MB of C and shell scripts we cannot audit.
Performance via zero-copy. Implementing the Git protocol and packfile format directly in Rust lets us parse into Rust structs without crossing the FFI boundary — no C-to-Rust translation per object, no refcounting on git_object, and O(1) OID lookups via borrowed slices over the packfile.
Positioning vs gitoxide. Unlike gitoxide, which aims to be a complete, user-facing git replacement (porcelain), agit is narrower. It ignores interactive commands and complex rebase UIs to focus exclusively on the automation layer (plumbing) required by agents.
Static linking. The Lite edition compiles to a true static binary of ~10MB with no libssl.so or libz.so dependency — drop it on any Linux box or Windows machine and run.
init— Initialize a repositoryadd— Stage filescommit— Commit changespush/pull— Remote operationsstatus— Show working tree statuslog— Show commit historyclone— Clone a repository
branch— Branch managementcheckout— Switch branchesmerge— Merge branchesstash— Stash changes
rebase -i(interactive rebase)add -p(interactive patching)git mergetool(merge tool)- All other TUI-interactive commands
# Force AI mode
export AGIT_AI_MODE=1
# Set output format
export AGIT_OUTPUT_FORMAT=json # json, yaml, text
# Disable color
export AGIT_NO_COLOR=1~/.config/agit/config.toml
[ai]
auto_tag = true
tag_format = "suffix" # prefix, suffix, trailer
[output]
format = "json"
color = true
[safety]
prevent_force_push = true
max_commit_length = 100- name: Checkout with agit
uses: bit-torch/agit-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}COPY --from=ghcr.io/bit-torch/AdapterGit:latest /agit /usr/local/bin/
RUN agit clone https://github.com/user/repo.gitimport subprocess
result = subprocess.run(
["agit", "commit", "--ai", "Auto-commit by AI"],
capture_output=True,
text=True
)
print(result.stdout) # JSON outputContributions are welcome! agit is open source and we appreciate all forms of contribution.
# 1. Fork and clone the repository
git clone https://github.com/bit-torch/AdapterGit.git
cd AdapterGit
# 2. Install Rust
rustup toolchain install stable
# 3. Build (workspace: agit-core + agit-ai + agit-cli)
cargo build --all-features
# 4. Run tests (178 tests)
cargo testagit follows Conventional Commits:
feat:— New featurefix:— Bug fixdocs:— Documentation updatetest:— Test relatedrefactor:— Code refactoring
agit/ # Workspace root
├── Cargo.toml # Workspace definition
├── agit-core/ # Pure-Rust Git core library
│ └── src/
│ ├── objects/ # Blob, Tree, Commit, Tag
│ ├── storage.rs # Loose object R/W
│ ├── refs.rs # References (HEAD, branches, tags)
│ ├── index.rs # DIRC v2 staging area
│ ├── protocol.rs # Git smart-HTTP
│ ├── merge.rs # 3-way merge
│ └── checkout.rs # Branch switch / tree restore
├── agit-ai/ # AI mode (optional, feature-gated)
│ └── src/
│ └── lib.rs # AI auto-tagging, safety guards
├── agit-cli/ # CLI binary
│ └── src/
│ ├── main.rs # Entry point
│ ├── commands/ # One file per subcommand
│ └── output/ # JSON / YAML / no-color output
└── tests/ # Integration tests
This project is licensed under Apache-2.0.
- Fully native implementation — Git core protocols and algorithms implemented from scratch in Rust, with zero external Git library dependencies
- Inspired by GitButler and gitui
- Thanks to every developer who has been frustrated by Git on shared machines
Found a bug or have an idea?
A Git tool designed for the AI era — never hang, ready out of the box.