gitmode ships as an npm package with two entry points for different use cases:
Server — gitmode/server
Full git server for Cloudflare Workers. Smart HTTP transport, 29-endpoint REST API, R2 chunk storage, Durable Objects with SQLite. Uses the 865KB WASM module with libgit2.
Lightweight git primitives for any JS runtime. SHA-1 hashing, zlib compression, delta encoding. Uses the 83KB WASM module — no server deps, no libgit2.
npx gitmode init scaffolds a complete Worker project. Or import directly into your existing Worker for git protocol + REST API routing.
Full Git Protocol
Smart HTTP transport and SSH-to-HTTP proxy. Works with standard git clone, git push, git fetch over both HTTP and SSH.
REST API
29 endpoints for programmatic access. Init repos, commit files, create branches, merge, cherry-pick, revert — all via JSON.
Zig WASM + SIMD128
SHA-1, zlib, packfile parsing, delta encoding — all in Zig compiled to WASM with SIMD acceleration. Two modules: 865KB server, 83KB client.
Durable Objects + R2
Each repo is a Durable Object with embedded SQLite for refs and metadata. Git objects bundled into ~2MB R2 chunks, indexed via SQLite for O(1) lookups.
Security Hardened
Path traversal protection, git refname validation, packfile size limits, varint bounds checks, input validation on all REST endpoints.
Every repository maps to a single Durable Object instance. The DO’s embedded SQLite stores refs (branches, tags, HEAD), metadata, and an object chunk index. Git objects are bundled into ~2MB R2 chunks for efficient batch reads. Two Zig WASM modules handle binary operations: the server module (865KB) for full git ops, and a core module (83KB) for client-side SHA-1, zlib, and delta encoding.