Git Module

Complete git operations via libgit2

Available Tools

  • git_status - Repository status with staged/unstaged/untracked files
  • git_diff - View changes with patch format
  • git_commit - Create commits
  • git_branch - List, create, or delete branches
  • git_checkout - Switch branches or commits
  • git_blame - Show line-by-line authorship
  • git_log - View commit history
  • git_tag - Manage tags (lightweight and annotated)

Example: Check Repository Status

{
  "name": "git_status",
  "arguments": {
    "path": "."
  }
}

Returns information about staged, unstaged, and untracked files in the repository.

Example: Create a Commit

{
  "name": "git_commit",
  "arguments": {
    "message": "feat: add new feature",
    "author_name": "Developer",
    "author_email": "dev@example.com"
  }
}

Example: View Diff

{
  "name": "git_diff",
  "arguments": {
    "path": ".",
    "staged": false
  }
}

Example: Manage Branches

List branches

{
  "name": "git_branch",
  "arguments": {
    "action": "list"
  }
}

Create branch

{
  "name": "git_branch",
  "arguments": {
    "action": "create",
    "branch_name": "feature/new-feature"
  }
}

Delete branch

{
  "name": "git_branch",
  "arguments": {
    "action": "delete",
    "branch_name": "old-feature"
  }
}

Example: View Commit History

{
  "name": "git_log",
  "arguments": {
    "path": ".",
    "limit": 10
  }
}

Example: Blame File

{
  "name": "git_blame",
  "arguments": {
    "path": "src/main.rs"
  }
}

Example: Create Tag

{
  "name": "git_tag",
  "arguments": {
    "action": "create",
    "tag_name": "v1.0.0",
    "message": "Release version 1.0.0",
    "annotated": true
  }
}

Features

  • Full libgit2 integration for reliable git operations
  • Support for both lightweight and annotated tags
  • Detailed blame information with commit hashes and timestamps
  • Patch format diff output for easy parsing
  • Branch management with create, delete, and list operations