How justmeetpatel/zit works
zit is a Rust terminal UI for safely managing Git repositories, GitHub workflows, and optional AI-assisted guidance. The principal flow is: a user launches the TUI, navigates a routed view, performs a Git or GitHub operation, and receives refreshed repository state or guidance. Git domain modules delegate native commands to the Git runner, while AI requests carry repository context through a provider client to the optional Lambda/Bedrock backend. The tree and excerpts establish the major capabilities, but some feature wiring is inferred only from documented structure.
Main entry points: app.rs App Orchestrator · runner.rs Git Runner · main.rs Terminal Entry · config.rs Config Loader
Components 21
TUI Runtime
- Terminal Entry
src/main.rs - App Orchestrator
src/app.rs - Feature Views
src/ui
Git Operations
- Git Runner
src/git/runner.rs - Repository State
- Stage Commit
src/git/diff.rs - History Recovery
src/git/log.rs - Branch Operations
src/git/branch.rs - Merge Workflows
src/git/merge.rs - Stash Manager
src/git/stash.rs - Advanced Git
src/git/bisect.rs
AI Assistance
- AI Client
src/ai/client.rs - AI Providers
src/ai/provider.rs - Mentor Lambda
aws/lambda/handler.py
GitHub Integration
- GitHub Operations
src/git/github_auth.rs
Configuration Security
- Config Loader
src/config.rs - OS Keychain
src/keychain.rs - Secret Scanner
src/git/secrets.rs
Other components
- Git User
- GitHub Service
- Amazon Bedrock
Connections 27
- Git User → Terminal Entry: launches
- Terminal Entry → App Orchestrator: runs loop
- Terminal Entry → Feature Views: renders views
- Terminal Entry → App Orchestrator: dispatches input
- App Orchestrator → Stage Commit: handles staging
- App Orchestrator → Branch Operations: handles branches
- App Orchestrator → History Recovery: handles history
- App Orchestrator → Merge Workflows: handles merges
- App Orchestrator → Stash Manager: handles stashes
- App Orchestrator → Advanced Git: runs workflows
- App Orchestrator → GitHub Operations: handles GitHub
- App Orchestrator → Secret Scanner: scans commits
- Stage Commit → Git Runner: runs git
- Branch Operations → Git Runner: runs git
- History Recovery → Git Runner: runs git
- Merge Workflows → Git Runner: runs git
- Stash Manager → Git Runner: runs git
- Advanced Git → Git Runner: runs git
- Git Runner → Repository State: reads writes
- App Orchestrator → AI Client: requests guidance
- AI Client → AI Providers: selects provider
- AI Providers → Mentor Lambda: sends context
- Mentor Lambda → Amazon Bedrock: invokes model
- GitHub Operations → GitHub Service: calls API
- Config Loader → OS Keychain: migrates secrets
- Terminal Entry → Config Loader: loads settings
- App Orchestrator → Config Loader: uses settings