Key Components
| Directory | Purpose |
|---|---|
src/commands/ | CLI command handlers |
src/core/ | Git internals: objects, refs, index, merge, diff |
src/core/protocol/ | Smart HTTP, packfile read/write |
src/server/ | Hono server, Git HTTP endpoints |
src/api/trpc/ | tRPC routers for the platform API |
src/db/ | Drizzle schema and data models |
src/ai/ | AI agent and tools |
src/ui/ | Terminal UI, web UI, graph rendering |
How Git Storage Works
wit stores data the same way Git does:- Objects (blobs, trees, commits, tags) are content-addressed by SHA-1 hash
- Refs (branches, tags) are files containing commit hashes
- Index tracks staged files for the next commit
- Packfiles bundle objects for network transfer
.wit/objects/, refs in .wit/refs/.
Network Protocol
wit implements Git Smart HTTP for clone/fetch/push:- Client discovers refs via
GET /info/refs - Client/server exchange packfiles via
POST /git-upload-packor/git-receive-pack
Platform
The hosting platform adds:- PostgreSQL for users, orgs, repos, PRs, issues
- tRPC API for the web app and CLI commands like
wit pr - React web app for browsing repos and managing PRs
Detailed Documentation
For comprehensive architecture documentation, see:System Overview
Complete system architecture with diagrams
Core Git
Git implementation details
AI System
AI agents, tools, and workflows
Server
HTTP, SSH, and API architecture
Database
PostgreSQL schema and models
Events System
Event-driven architecture
CLI
Command structure and patterns
Primitives
Git-backed building blocks