Skip to content

praba230890/gitode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitode

gitode snapshot browser gitode TUI view

AI agentic versioning on top of git. gitode stores parallel metadata for prompts, ideas, specs, design, todos, implementation, testing, review, and comments per snapshot, and lets you browse them via CLI or TUI.

Key Features

  • Branching model - Git-style branches for parallel exploration
  • Snapshot lifecycle - Draft → Staged → Committed/Rejected workflow
  • Agent metadata - Track which AI model/tool created each snapshot
  • Conversation storage - Store full chat history (JSON or Markdown)
  • Flexible sections - Standard sections + arbitrary custom sections
  • Test integration - Run cargo test and capture results
  • TUI browser - Interactive terminal UI for exploring snapshots

Quick Start

# Initialize in a git repository
gitode init

# Create a snapshot with agent info
gitode snapshot --message "Initial design" \
    --section prompt="Build a REST API" \
    --section design="Use axum framework" \
    --agent claude-3 \
    --tool vscode-copilot

# Stage for review
gitode stage 0001

# Approve after review
gitode approve 0001

# Run tests and save results
gitode test --save 0001

Commands

Snapshots

# Create a snapshot
gitode snapshot --message "Description" \
    --section prompt="Your prompt" \
    --section spec="Specification" \
    --section-file design=@design.md \
    --agent <model-name> \
    --tool <tool-name> \
    --task "#42" \
    --tags "feature,wip" \
    --conversation conversation.json

# Git commit + snapshot in one step
gitode commit --message "Implement feature" --section todos="Add tests"

# List snapshots
gitode log                    # Current branch
gitode log --all              # All branches  
gitode log --graph            # DAG visualization
gitode log --status staged    # Filter by status
gitode log --branch feature   # Specific branch

# Show snapshot details
gitode show 0001

# Compare snapshots
gitode diff 0001 0002

# Export snapshot
gitode checkout 0001 --out ./export
gitode checkout 0001 --apply-git  # Also checkout git commit

Branching

# Create a new branch (inherits from current)
gitode branch experiment-auth

# Switch branches
gitode switch experiment-auth

# List all branches
gitode branches

Merging

# Preview what would be merged (dry run)
gitode merge feature-branch --preview

# Merge with auto-accept (no prompts)
gitode merge feature-branch --auto

# Interactive merge with side-by-side diff
gitode merge feature-branch --interactive

Interactive Merge Controls:

  • ↑/↓ or j/k: Navigate changes
  • s: Accept source (incoming) change
  • t: Keep target (current) value
  • b: Accept both (creates merge markers)
  • a: Accept all from source
  • Enter: Confirm merge
  • q or Esc: Cancel
  • ?: Toggle help

Merge Preview Output:

╔══════════════════════════════════════════════════════════════════╗
║                      MERGE PREVIEW                               ║
╠══════════════════════════════════════════════════════════════════╣
║  Source: feature-auth                                            ║
║  Target: main                                                    ║
╠══════════════════════════════════════════════════════════════════╣
║  📥 New snapshots:      2                                        ║
║  📝 Modified snapshots: 1                                        ║
║  ⚠️  Conflicts:          1                                        ║
╚══════════════════════════════════════════════════════════════════╝

Lifecycle Management

# Workflow: Draft → Staged → Committed

# Stage a draft for review
gitode stage 0001

# Approve (human review passed)
gitode approve 0001

# Reject with reason
gitode reject 0001 --reason "Needs more tests"

Testing

# Run cargo test
gitode test

# Run and save results to snapshot
gitode test --save 0001

Conversations

# Add conversation from JSON file
gitode conversation add 0001 chat.json

# Add from Markdown
gitode conversation add 0001 session.md

# View conversation
gitode conversation show 0001

TUI

# Open interactive browser
gitode tui

TUI Controls:

  • Up/Down: select snapshot
  • Left/Right: change section
  • /: search
  • x: clear search
  • d: toggle diff mode
  • b: set diff base
  • r: reload
  • q: quit

Snapshot Lifecycle

┌──────────┐
│  Draft   │  ← Agent creates snapshot
└────┬─────┘
     │ gitode stage <id>
     ▼
┌──────────┐
│  Staged  │  ← Human reviews
└────┬─────┘
     │ gitode approve <id>  OR  gitode reject <id>
┌────┴────┐
▼         ▼
┌──────────┐  ┌──────────┐
│Committed │  │ Rejected │
└──────────┘  └──────────┘

Storage Layout

.gitode/
├── state.json              # Current branch, branch list
├── branches/
│   ├── main.json           # Snapshots on main branch
│   └── feature.json        # Snapshots on feature branch
├── sections/
│   ├── prompt/
│   │   ├── 0001.md
│   │   └── 0002.md
│   ├── design/
│   ├── spec/
│   └── ...
├── conversations/
│   ├── 0001.json
│   └── 0002.json
└── versions.json           # Legacy format (backwards compat)

Conversation Formats

JSON Format

[
  {"role": "user", "content": "Build a REST API for user management"},
  {"role": "assistant", "content": "I'll create an API using axum..."},
  {"role": "user", "content": "Add authentication"}
]

Markdown Format

## User
Build a REST API for user management

## Assistant
I'll create an API using axum with the following endpoints...

## User
Add authentication

Sections

Standard sections:

  • prompt - The user's request/prompt
  • ideas - Brainstorming and alternatives
  • spec - Formal specification
  • design - Architecture decisions
  • todos - Task list
  • implementation - Code notes
  • testing - Test strategy
  • review - Review comments
  • comments - General notes

Custom sections:

gitode snapshot --section my-custom-section="Custom content"

Agent Metadata

Track which AI contributed:

gitode snapshot \
    --agent "claude-3-opus" \
    --tool "vscode-copilot" \
    --task "AUTH-123"

Snapshot stores:

  • agent.name - Model name
  • agent.tool - IDE/tool used
  • task_ref - Issue/task reference
  • tags - Arbitrary labels

Integration Ideas

VS Code Extension

Export Copilot Chat sessions to JSON, then import:

gitode conversation add 0001 copilot-session.json

MCP Server (Future)

gitode as an MCP server that agents can write to directly.

CI/CD

# In CI pipeline
gitode test --save $SNAPSHOT_ID
gitode approve $SNAPSHOT_ID  # If tests pass

Migration

If you have existing gitode data from an older version:

gitode migrate

This will:

  • Convert inline section data to file-based storage
  • Normalize all file paths to be repo-relative
  • Create per-branch storage files
  • Build parent-child chains for snapshots
  • Preserve backwards compatibility with versions.json

Status Icons

In gitode log output:

  • 📝 Draft - New snapshot, not yet reviewed
  • 📋 Staged - Ready for human review
  • ✅ Committed - Approved and finalized
  • ❌ Rejected - Did not pass review

Example Workflow

# 1. Agent creates a snapshot while working
gitode snapshot \
    --message "Implement user authentication" \
    --section prompt="Add JWT-based auth to the API" \
    --section design="Use RS256 signing, 1hr expiry" \
    --section todos="1. Add middleware\n2. Create login endpoint" \
    --agent claude-3 \
    --tool vscode-copilot \
    --task "AUTH-42"

# 2. Import the conversation that led to this
gitode conversation add 0001 ./auth-discussion.json

# 3. Run tests
gitode test --save 0001

# 4. Human reviews and stages
gitode show 0001
gitode stage 0001

# 5. After review, approve or reject
gitode approve 0001
# or: gitode reject 0001 --reason "Missing error handling"

# 6. Create a branch for experimental approach
gitode branch auth-oauth
gitode switch auth-oauth
gitode snapshot --message "Try OAuth instead" --section design="Use OAuth 2.0"

Building

cargo build --release

Running Tests

cargo test

License

MIT

About

A git based version control for modern agent assisted software development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages