Packages
Search packages... ⌘K
Go Package
gitcli
Git CLI wrapper — branch operations, commit, status, diff with structured output
Go Ready SI
Git Operations
$ g := gitcli.NewGit("/workspace/shredbx")
$ status, _ := g.Status(ctx)
[git] branch: feature/packages-page
[git] staged: 3 files
[git] modified: 2 files
[git] untracked: 1 file
$ result, _ := g.Commit(ctx, "feat: add package detail view")
[git] commit: a3f2b9c feat: add package detail view
[git] 3 files changed, 142 insertions(+), 8 deletions(-)
About
Wraps the git CLI binary with typed Go functions that return structured output instead of raw text. Handles branch creation, status parsing, diff generation, and commit operations with proper error classification.
Public API
| Name | Kind | Signature |
|---|---|---|
| Git | type | type Git struct |
| NewGit | func | func NewGit(repoPath string) *Git |
| Status | func | func (g *Git) Status(ctx context.Context) (*StatusResult, error) |
| Commit | func | func (g *Git) Commit(ctx context.Context, msg string, opts ...CommitOption) (*CommitResult, error) |
| Branch | func | func (g *Git) Branch(ctx context.Context, name string, opts ...BranchOption) error |
| Diff | func | func (g *Git) Diff(ctx context.Context, opts ...DiffOption) (*DiffResult, error) |
Dependencies
Related Packages
worktree Go Ready
Git worktree manager — create, list, remove worktrees with Docker integration
git-worktreeisolationdocker-integrationparallel-dev
5 exports 2 deps
external Go Ready
External process runner — exec.Command wrapper with timeout, output capture, error handling
execprocess-runnertimeoutoutput-capture
5 exports 7 deps
Source
github.com/shredbx/sbx-core/pkg/gitcli
gitcli-wrapperstructured-outputbranch-ops