Documentation
¶
Overview ¶
Package git provides local Git repository tools for the GitHub MCP Server.
This code is adapted from git-mcp-go by Gero Posmyk-Leinemann and contributors. Original source: https://github.com/geropl/git-mcp-go Copyright (c) Gero Posmyk-Leinemann <gero@gitpod.io>
Index ¶
- Variables
- func Add(t translations.TranslationHelperFunc) inventory.ServerTool
- func AddWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
- func AllGitTools(t translations.TranslationHelperFunc) []inventory.ServerTool
- func ApplyPatchFile(t translations.TranslationHelperFunc) inventory.ServerTool
- func ApplyPatchString(t translations.TranslationHelperFunc) inventory.ServerTool
- func Checkout(t translations.TranslationHelperFunc) inventory.ServerTool
- func Commit(t translations.TranslationHelperFunc) inventory.ServerTool
- func ContextWithGitDeps(ctx context.Context, deps ToolDependencies) context.Context
- func CreateBranch(t translations.TranslationHelperFunc) inventory.ServerTool
- func Diff(t translations.TranslationHelperFunc) inventory.ServerTool
- func DiffStaged(t translations.TranslationHelperFunc) inventory.ServerTool
- func DiffUnstaged(t translations.TranslationHelperFunc) inventory.ServerTool
- func Init(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
- func ListWorktrees(t translations.TranslationHelperFunc) inventory.ServerTool
- func LockWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
- func Log(t translations.TranslationHelperFunc) inventory.ServerTool
- func PruneWorktrees(t translations.TranslationHelperFunc) inventory.ServerTool
- func Pull(t translations.TranslationHelperFunc) inventory.ServerTool
- func Push(t translations.TranslationHelperFunc) inventory.ServerTool
- func RemoveWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
- func Reset(t translations.TranslationHelperFunc) inventory.ServerTool
- func Show(t translations.TranslationHelperFunc) inventory.ServerTool
- func Status(t translations.TranslationHelperFunc) inventory.ServerTool
- func UnlockWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
- type ToolDependencies
Constants ¶
This section is empty.
Variables ¶
var ErrGitDepsNotInContext = errors.New("ToolDependencies not found in context; use ContextWithGitDeps to inject")
ErrGitDepsNotInContext is returned when ToolDependencies is not found in context.
var ToolsetMetadataLocalGit = inventory.ToolsetMetadata{
ID: "local_git",
Description: "Local Git repository operations - work with git repositories on your local machine (status, diff, commit, push, pull, branches, etc.)",
Icon: "git-branch",
}
ToolsetMetadataLocalGit defines the local git toolset metadata
Functions ¶
func Add ¶
func Add(t translations.TranslationHelperFunc) inventory.ServerTool
Add creates a tool to add files to staging area
func AddWorktree ¶ added in v0.2.0
func AddWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
AddWorktree creates a tool to add a new worktree
func AllGitTools ¶
func AllGitTools(t translations.TranslationHelperFunc) []inventory.ServerTool
AllGitTools returns all git tools
func ApplyPatchFile ¶
func ApplyPatchFile(t translations.TranslationHelperFunc) inventory.ServerTool
ApplyPatchFile creates a tool to apply a patch from a file
func ApplyPatchString ¶
func ApplyPatchString(t translations.TranslationHelperFunc) inventory.ServerTool
ApplyPatchString creates a tool to apply a patch from a string
func Checkout ¶
func Checkout(t translations.TranslationHelperFunc) inventory.ServerTool
Checkout creates a tool to switch branches
func Commit ¶
func Commit(t translations.TranslationHelperFunc) inventory.ServerTool
Commit creates a tool to commit changes
func ContextWithGitDeps ¶
func ContextWithGitDeps(ctx context.Context, deps ToolDependencies) context.Context
ContextWithGitDeps returns a new context with the ToolDependencies stored in it. This is used to inject dependencies at request time rather than at registration time, avoiding expensive closure creation during server initialization.
func CreateBranch ¶
func CreateBranch(t translations.TranslationHelperFunc) inventory.ServerTool
CreateBranch creates a tool to create a new branch
func Diff ¶
func Diff(t translations.TranslationHelperFunc) inventory.ServerTool
Diff creates a tool to show differences between branches or commits
func DiffStaged ¶
func DiffStaged(t translations.TranslationHelperFunc) inventory.ServerTool
DiffStaged creates a tool to show staged changes
func DiffUnstaged ¶
func DiffUnstaged(t translations.TranslationHelperFunc) inventory.ServerTool
DiffUnstaged creates a tool to show unstaged changes
func Init ¶
func Init(t translations.TranslationHelperFunc) inventory.ServerTool
Init creates a tool to initialize a new repository
func ListRepositories ¶
func ListRepositories(t translations.TranslationHelperFunc) inventory.ServerTool
ListRepositories creates a tool to list all available repositories
func ListWorktrees ¶ added in v0.2.0
func ListWorktrees(t translations.TranslationHelperFunc) inventory.ServerTool
ListWorktrees creates a tool to list all worktrees
func LockWorktree ¶ added in v0.2.0
func LockWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
LockWorktree creates a tool to lock a worktree
func Log ¶
func Log(t translations.TranslationHelperFunc) inventory.ServerTool
Log creates a tool to show commit logs
func PruneWorktrees ¶ added in v0.2.0
func PruneWorktrees(t translations.TranslationHelperFunc) inventory.ServerTool
PruneWorktrees creates a tool to prune worktree information
func Pull ¶
func Pull(t translations.TranslationHelperFunc) inventory.ServerTool
Pull creates a tool to pull changes from remote
func Push ¶
func Push(t translations.TranslationHelperFunc) inventory.ServerTool
Push creates a tool to push changes to remote
func RemoveWorktree ¶ added in v0.2.0
func RemoveWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
RemoveWorktree creates a tool to remove a worktree
func Reset ¶
func Reset(t translations.TranslationHelperFunc) inventory.ServerTool
Reset creates a tool to unstage changes
func Show ¶
func Show(t translations.TranslationHelperFunc) inventory.ServerTool
Show creates a tool to show commit contents
func Status ¶
func Status(t translations.TranslationHelperFunc) inventory.ServerTool
Status creates a tool to show the working tree status
func UnlockWorktree ¶ added in v0.2.0
func UnlockWorktree(t translations.TranslationHelperFunc) inventory.ServerTool
UnlockWorktree creates a tool to unlock a worktree
Types ¶
type ToolDependencies ¶
type ToolDependencies interface {
GetGitOps() gitops.GitOperations
GetRepoPaths() []string
}
ToolDependencies defines the dependencies needed by git tools
func MustGitDepsFromContext ¶
func MustGitDepsFromContext(ctx context.Context) ToolDependencies
MustGitDepsFromContext extracts ToolDependencies from context. Panics if deps are not found - callers must ensure ContextWithGitDeps was called.