Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emanuele-web04/dpcode/llms.txt

Use this file to discover all available pages before exploring further.

The git methods expose a full set of repository operations over the WebSocket API. All methods use the git.* namespace and follow the same request/response format. Most git methods require a cwd field that identifies the repository to operate on.

git.status

Retrieve the current status of a git repository, including the working tree, upstream tracking, and associated pull request.

Parameters

cwd
string
required
Absolute path to the repository working directory.

Response

branch
string | null
required
Current branch name, or null if the repository is in detached HEAD state.
hasWorkingTreeChanges
boolean
required
Whether there are uncommitted changes.
workingTree
object
required
hasUpstream
boolean
required
Whether the current branch has a remote tracking branch.
upstreamBranch
string | null
required
Name of the remote tracking branch, e.g. "origin/main".
aheadCount
number
required
Number of local commits not yet pushed to upstream.
behindCount
number
required
Number of upstream commits not yet pulled locally.
pr
object | null
required
Associated pull request, if any.

git.readWorkingTreeDiff

Read the raw unified diff for the current working tree.

Parameters

cwd
string
required
Absolute path to the repository.
scope
string
default:"\"workingTree\""
Which diff to read. One of: "workingTree" (all unstaged + staged), "unstaged", "staged", "branch".

Response

patch
string
required
Unified diff string.

git.summarizeDiff

Generate a natural-language summary of a diff patch using an AI text-generation model.

Parameters

cwd
string
required
patch
string
required
The unified diff patch to summarize.
textGenerationModel
string
default:"\"codex-mini-latest\""
Model to use for summarization.
codexHomePath
string
Optional override for the Codex home path.
providerOptions
object
Optional per-provider start options.

Response

summary
string
required
AI-generated summary of the diff.

git.pull

Pull the latest changes from the remote tracking branch.

Parameters

cwd
string
required

Response

status
"pulled" | "skipped_up_to_date"
required
Whether a pull was performed or the branch was already up to date.
branch
string
required
Current branch name after the pull.
upstreamBranch
string | null
required
Remote tracking branch, if any.

git.listBranches

List all local and remote branches in a repository.

Parameters

cwd
string
required

Response

branches
object[]
required
isRepo
boolean
required
Whether the directory is inside a git repository.
hasOriginRemote
boolean
required
Whether an origin remote is configured.

git.createBranch

Create a new branch, optionally publishing it to the remote.

Parameters

cwd
string
required
branch
string
required
Name of the branch to create.
publish
boolean
If true, push the new branch to the remote immediately.

Response

Returns void on success.

git.checkout

Checkout an existing branch.

Parameters

cwd
string
required
branch
string
required
Branch name to checkout.

Response

Returns void on success.

git.stashAndCheckout

Stash any working-tree changes and then checkout a different branch.

Parameters

cwd
string
required
branch
string
required
Branch name to checkout after stashing.

Response

Returns void on success.

git.stashDrop

Drop the most recent stash entry.

Parameters

cwd
string
required

Response

Returns void on success.

git.stashInfo

Retrieve information about the most recent stash entry.

Parameters

cwd
string
required

Response

cwd
string
required
branch
string | null
required
Branch the stash was created from.
stashRef
string
required
Stash reference, e.g. "stash@{0}".
message
string
required
Stash message.
files
string[]
required
List of file paths included in the stash.

git.createWorktree

Create a linked worktree for an existing branch.

Parameters

cwd
string
required
branch
string
required
Branch to check out in the new worktree.
newBranch
string
If provided, create a new branch with this name in the worktree.
path
string | null
required
Path where the worktree should be created, or null for an auto-generated path.

Response

worktree
object
required

git.createDetachedWorktree

Create a linked worktree in detached HEAD state at a specific ref.

Parameters

cwd
string
required
ref
string
required
Commit SHA, tag, or other git ref to checkout.
path
string | null
required
Destination path, or null for auto-generated.

Response

worktree
object
required

git.removeWorktree

Remove a linked worktree.

Parameters

cwd
string
required
path
string
required
Absolute path of the worktree to remove.
force
boolean
Force removal even if the worktree has uncommitted changes.

Response

Returns void on success.

git.runStackedAction

Streaming. Run a stacked git action (commit, push, create PR, or combinations). Progress events are streamed as the action proceeds through phases. The server also pushes events on the git.actionProgress channel.

Parameters

actionId
string
required
Unique identifier for this action. Used to correlate progress events.
cwd
string
required
action
string
required
One of: "commit", "push", "create_pr", "commit_push", "commit_push_pr".
commitMessage
string
Commit message. Max 10,000 characters. Required when the action includes a commit step.
featureBranch
boolean
Whether to create a feature branch for the commit.
filePaths
string[]
Specific file paths to stage. If omitted, all changes are staged.
textGenerationModel
string
default:"\"codex-mini-latest\""
Model to use if AI-assisted commit message generation is triggered.
codexHomePath
string
Optional Codex home path override.
providerOptions
object
Optional per-provider start options.

Stream items (GitActionProgressEvent)

Each streamed item has a kind field:
kindAdditional fields
action_startedphases: string[] — list of phases that will run
phase_startedphase, label
hook_startedhookName
hook_outputhookName, stream: "stdout" | "stderr", text
hook_finishedhookName, exitCode, durationMs
action_finishedresult — final GitRunStackedActionResult
action_failedphase, message
All items also carry actionId, cwd, and action.

Final result (action_finished)

result
object
required

git.resolvePullRequest

Resolve a pull request reference (number, URL, or branch name) to full PR metadata.

Parameters

cwd
string
required
reference
string
required
PR number (e.g. "42"), URL, or branch name.

Response

pullRequest
object
required

git.preparePullRequestThread

Resolve a pull request and prepare the branch or worktree needed to work on it, returning the resolved PR, the branch name, and the worktree path if applicable.

Parameters

cwd
string
required
reference
string
required
PR reference (number, URL, or branch name).
mode
"local" | "worktree"
required
Whether to check out locally or in a linked worktree.

Response

pullRequest
object
required
Resolved PR (same structure as git.resolvePullRequest).
branch
string
required
Branch name to use for the thread.
worktreePath
string | null
required
Worktree path if mode is "worktree", otherwise null.

git.removeIndexLock

Remove a stale .git/index.lock file. Use this to recover when git commands fail because a lock file was left behind.

Parameters

cwd
string
required

Response

Returns void on success.

git.init

Initialize a new git repository in a directory.

Parameters

cwd
string
required
Directory to initialize as a git repository.

Response

Returns void on success.

git.handoffThread

Prepare a thread handoff by resolving the target environment (local branch or worktree) and transferring any uncommitted changes.

Parameters

cwd
string
required
targetMode
"local" | "worktree"
required
currentBranch
string | null
required
worktreePath
string | null
required
associatedWorktreePath
string | null
required
associatedWorktreeBranch
string | null
required
associatedWorktreeRef
string | null
required
preferredLocalBranch
string | null
required
preferredWorktreeBaseBranch
string | null
required
preferredNewWorktreeName
string | null
required

Response

targetMode
"local" | "worktree"
required
branch
string | null
required
worktreePath
string | null
required
associatedWorktreePath
string | null
required
associatedWorktreeBranch
string | null
required
associatedWorktreeRef
string | null
required
changesTransferred
boolean
required
Whether uncommitted changes were successfully transferred.
conflictsDetected
boolean
required
Whether merge conflicts were detected during transfer.
message
string | null
required
Human-readable status message.

Complete example: status then commit/push

{
  "id": "req-git-1",
  "body": {
    "_tag": "git.status",
    "cwd": "/home/user/my-project"
  }
}

Build docs developers (and LLMs) love