Skip to main content

git_status

Get git status for the current project. Returns current branch, staged files, unstaged changes, and untracked files.

Parameters

project_id
string
Project ID (auto-detected from working directory if omitted)

Returns

Returns a JSON object with git status information.
branch
string
Current branch name
staged
array
Array of staged files with status and path
unstaged
array
Array of unstaged changes with status and path
untracked
array
Array of untracked files with status and path
staged_count
integer
Number of staged files
unstaged_count
integer
Number of unstaged changes
untracked_count
integer
Number of untracked files
clean
boolean
True if working directory is clean

Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "git_status",
    "arguments": {}
  }
}
Response:
{
  "branch": "main",
  "staged": [
    {"status": "M", "path": "src/App.tsx"},
    {"status": "A", "path": "src/components/Button.tsx"}
  ],
  "unstaged": [
    {"status": "M", "path": "README.md"}
  ],
  "untracked": [
    {"status": "?", "path": "temp.log"}
  ],
  "staged_count": 2,
  "unstaged_count": 1,
  "untracked_count": 1,
  "clean": false
}

git_diff

Get git diff output. Shows unstaged changes by default, or staged changes with staged=true.

Parameters

project_id
string
Project ID (auto-detected from working directory if omitted)
file_path
string
Specific file to diff (relative to project root)
staged
boolean
Show staged changes instead of unstaged (default: false)

Returns

Returns the git diff output as text, or a message if no changes are found.

Example

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "git_diff",
    "arguments": {
      "file_path": "src/App.tsx",
      "staged": true
    }
  }
}
Response:
diff --git a/src/App.tsx b/src/App.tsx
index 1234567..abcdefg 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -10,7 +10,7 @@ function App() {
   return (
     <div className="App">
-      <h1>Hello World</h1>
+      <h1>Hello CodeFire</h1>
     </div>
   );
 }

git_log

Get recent git commit history. Returns commit hash, message, author, and relative date.

Parameters

project_id
string
Project ID (auto-detected from working directory if omitted)
count
integer
Number of commits to show (default: 15, max: 50)
file_path
string
Show only commits affecting this file

Returns

Returns a JSON object with an array of commits.
commits
array
Array of commit objects
sha
string
Full commit hash
short_sha
string
Abbreviated commit hash
message
string
Commit message
author
string
Commit author name
date
string
Relative date (e.g. “2 hours ago”)
count
integer
Number of commits returned

Example

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "git_log",
    "arguments": {
      "count": 5
    }
  }
}
Response:
{
  "commits": [
    {
      "sha": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
      "short_sha": "a1b2c3d",
      "message": "Add dark mode support",
      "author": "Jane Developer",
      "date": "2 hours ago"
    },
    {
      "sha": "b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0a1",
      "short_sha": "b2c3d4e",
      "message": "Fix navigation bug",
      "author": "John Developer",
      "date": "1 day ago"
    }
  ],
  "count": 2
}

git_stage

Stage files for commit. Stage a specific file or all changes.

Parameters

project_id
string
Project ID (auto-detected from working directory if omitted)
file_path
string
File to stage (relative to project root). Omit to stage all changes.

Returns

Confirmation message indicating what was staged.

Example

{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "git_stage",
    "arguments": {
      "file_path": "src/App.tsx"
    }
  }
}
Response:
Staged: src/App.tsx

git_unstage

Unstage files from the staging area. Unstage a specific file or all staged changes.

Parameters

project_id
string
Project ID (auto-detected from working directory if omitted)
file_path
string
File to unstage (relative to project root). Omit to unstage all.

Returns

Confirmation message indicating what was unstaged.

Example

{
  "jsonrpc": "2.0",
  "id": 5,
  "method": "tools/call",
  "params": {
    "name": "git_unstage",
    "arguments": {}
  }
}
Response:
Unstaged: all staged changes

git_commit

Create a git commit with the currently staged changes.

Parameters

message
string
required
Commit message
project_id
string
Project ID (auto-detected from working directory if omitted)

Returns

Git commit output or confirmation message.

Example

{
  "jsonrpc": "2.0",
  "id": 6,
  "method": "tools/call",
  "params": {
    "name": "git_commit",
    "arguments": {
      "message": "Add dark mode support with user preference toggle"
    }
  }
}
Response:
[main a1b2c3d] Add dark mode support with user preference toggle
 2 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 src/components/ThemeToggle.tsx

Notes

  • All git operations run directly against the project’s git repository
  • The project_id parameter is auto-detected from the working directory for most commands
  • Git must be installed and the project must be a git repository
  • Git operations do not require CodeFire GUI to be running

Build docs developers (and LLMs) love