Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions gitforge/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "GitForge MCP IDE",
"image": "mcr.microsoft.com/devcontainers/rust:1-bullseye",
"features": {
"ghcr.io/devcontainers/features/node:1": { "version": "20.18" },
"ghcr.io/devcontainers/features/rust-debugger": {}
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"tauri-apps.tauri-vscode",
"Vue.volar",
"ms-vscode.vscode-json"
]
}
},
"forwardPorts": [1420, 6767]
}
39 changes: 39 additions & 0 deletions gitforge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Rust / Cargo
/target
**/*.rs.bk
Cargo.lock

# Tauri
src-tauri/target
src-tauri/gen

# Node / frontend
node_modules
dist
.vite
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# IDE / editor
.vscode
.idea
*.swp
*.swo
.DS_Store

# Local runtime data
*.db
*.db-shm
*.db-wal
*.sqlite
*.sqlite3
*.log
.env
.env.*

# Test/temp artifacts
coverage
*.lcov
/tmp
26 changes: 26 additions & 0 deletions gitforge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "gitforge"
version = "2.0.0"
edition = "2021"
description = "Forge your Git workflow — MCP Git IDE + AI Agent"

[[bin]]
name = "gitforge"
path = "src/bin/gitforge.rs"
Comment on lines +7 to +9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add src-tauri main binary to Cargo targets

The manifest declares only one binary target (src/bin/gitforge.rs), so Cargo will not build src-tauri/src/main.rs where mcp_call, voice_process, and the MCP backend wiring live. In this state, the shipped binary cannot run the Tauri/MCP backend code from this commit, and the src-tauri tests are also excluded from normal cargo test runs.

Useful? React with 👍 / 👎.


[dependencies]
tauri = { version = "2.0", features = ["api-all", "webview"] }
git2 = "0.18"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio-tungstenite = { version = "0.23", features = ["rustls-tls-webpki-roots"] }
tokio = { version = "1.0", features = ["full"] }
async-tungstenite = "0.23"
rusqlite = { version = "0.31", features = ["bundled"] }
redb = "1.1"
clap = { version = "4.0", features = ["derive"] }
anyhow = "1.0"
futures-util = "0.3"

[build-dependencies]
tauri-build = "2.0"
67 changes: 67 additions & 0 deletions gitforge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# GitForge

> Forge your Git workflow — MCP-native desktop IDE with local AI agent and terminal-first flow.

GitForge is a compact desktop Git workspace that combines editor, terminal, PR management, browser panel, and MCP server in one app. The goal is to reduce context switching between VS Code, terminal, Git hosting UI, and AI assistant tools.

## Repository Description (for GitHub)

**Short description:**

`MCP-native Git IDE (Tauri + Vue) with libgit2 terminal workflow, local voice agent, and 5-panel workspace.`

## Core Features

- **MCP JSON-RPC server** for Claude/Cursor/GPT integrations (`tools/list`, `git_status`, `git_commit`, PR/worktree methods).
- **Terminal Terminator direction**: git operations routed through `libgit2` backend APIs.
- **5-panel workspace UI**: Files, Editor, Terminal, PR panel, Browser panel.
- **Local BPGT agent memory** backed by `redb`.
- **SQLite metadata layer** for PRs and worktree tracking.

## Tech Stack

- **Desktop shell:** Tauri (Rust)
- **Backend:** Rust + git2 + rusqlite + redb + tokio/tungstenite
- **Frontend:** Vue 3
- **Protocol:** MCP-style JSON-RPC over WebSocket

## Current Status

This repository is at **MVP foundation** stage:

- backend MCP methods are implemented for core git/pr/worktree flows;
- UI is implemented as an interactive MVP shell;
- production hardening (security, full E2E, packaging/release pipeline) is still in progress.

## Local Development

### Prerequisites

- Rust toolchain (stable)
- Node.js 20+
- npm

### Quick start

```bash
# frontend deps
cd gitforge
npm install

# rust format check
cargo fmt --all -- --check

# tests (when crates.io access is available)
cargo test
```

## High-priority Next Steps

1. Wire Vue panels to real Tauri `invoke` calls (remove mock data paths).
2. Add MCP contract/integration tests for all methods and edge-cases.
3. Implement secure command execution policy for terminal routing.
4. Add release pipeline with signed builds and staged rollout.

## License

TBD (set before public release).
1 change: 1 addition & 0 deletions gitforge/REPOSITORY_DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GitForge — MCP-native Git IDE built with Tauri + Vue: 5-column workspace (Files, Monaco, Terminal, PR, Browser), libgit2-powered terminal workflow, local BPGT voice agent, and JSON-RPC MCP server for Claude/Cursor/GPT integration.
17 changes: 17 additions & 0 deletions gitforge/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "gitforge-ui",
"version": "2.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build"
},
"dependencies": {
"vue": "^3.4.0",
"xterm": "^5.5.0",
"xterm-addon-fit": "^0.10.0"
},
"devDependencies": {
"vite": "^5.0.0"
}
}
103 changes: 103 additions & 0 deletions gitforge/src-tauri/src/agent/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
use redb::{Database, ReadableTable, TableDefinition};
use serde::{Deserialize, Serialize};

const MEMORY_TABLE: TableDefinition<&str, &str> = TableDefinition::new("agent_memory");

pub struct BpgtAgent {
db: Database,
model: Option<String>,
}

#[derive(Serialize, Deserialize)]
pub struct AgentMemory {
pub context: String,
pub last_commands: Vec<String>,
pub repo_state: String,
}

#[derive(Debug, Clone, Copy)]
enum VoiceIntent {
Status,
Commit,
CreatePr,
ToolsList,
}

impl BpgtAgent {
pub fn new(db_path: &str) -> Self {
let db = Database::create(db_path).expect("failed to create redb db");
{
let write_txn = db.begin_write().expect("failed to begin write transaction");
{
let _ = write_txn
.open_table(MEMORY_TABLE)
.expect("failed to open memory table");
}
write_txn.commit().expect("failed to commit memory table creation");
}

Self { db, model: None }
}

pub async fn process_voice(&self, text: &str) -> Result<String, String> {
let _active_model = self.model.as_deref().unwrap_or("bgpt-fallback");
let intent = self.parse_intent(text);
let method = match intent {
VoiceIntent::Status => "git_status",
VoiceIntent::Commit => "git_commit",
VoiceIntent::CreatePr => "git_create_pr",
VoiceIntent::ToolsList => "tools/list",
};

self.persist_last_command(method)?;
Ok(method.to_string())
}

fn parse_intent(&self, text: &str) -> VoiceIntent {
let lowered = text.to_lowercase();
if lowered.contains("статус") || lowered.contains("status") {
VoiceIntent::Status
} else if lowered.contains("коммит") || lowered.contains("commit") {
VoiceIntent::Commit
} else if lowered.contains("пулреквест") || lowered.contains("pr") {
VoiceIntent::CreatePr
} else {
VoiceIntent::ToolsList
}
}

fn persist_last_command(&self, command: &str) -> Result<(), String> {
let write_txn = self
.db
.begin_write()
.map_err(|e| format!("failed to begin write transaction: {e}"))?;
{
let mut table = write_txn
.open_table(MEMORY_TABLE)
.map_err(|e| format!("failed to open memory table: {e}"))?;
table
.insert("last_command", command)
.map_err(|e| format!("failed to save memory: {e}"))?;
}
write_txn
.commit()
.map_err(|e| format!("failed to commit memory: {e}"))
}

pub fn last_command(&self) -> Result<Option<String>, String> {
let read_txn = self
.db
.begin_read()
.map_err(|e| format!("failed to begin read transaction: {e}"))?;
let table = read_txn
.open_table(MEMORY_TABLE)
.map_err(|e| format!("failed to open memory table: {e}"))?;

let value = table
.get("last_command")
.map_err(|e| format!("failed to read memory: {e}"))?
.map(|v| v.value().to_string());

Ok(value)
}
}
43 changes: 43 additions & 0 deletions gitforge/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use std::sync::Arc;

mod agent;
mod mcp {
pub mod server;
}

use agent::BpgtAgent;
use mcp::server::GitForgeMcp;

#[tauri::command]
async fn mcp_call(method: String, params: serde_json::Value, repo_path: String) -> Result<serde_json::Value, String> {
let server = GitForgeMcp::new(repo_path)?;
let request = mcp::server::McpRequest {
jsonrpc: "2.0".to_string(),
id: serde_json::json!(1),
method,
params,
};

let response = {
let server = Arc::new(server);
server.execute_mcp_for_tauri(&request).await
};

match response.error {
Some(err) => Err(err.message),
None => Ok(response.result.unwrap_or_default()),
}
}

#[tauri::command]
async fn voice_process(text: String, db_path: String) -> Result<String, String> {
let agent = BpgtAgent::new(&db_path);
agent.process_voice(&text).await
}

fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![mcp_call, voice_process])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Loading
Loading