gzhcligitforge

package module
v0.0.0-...-3a8f516 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 2 Imported by: 0

README

gzh-cli-gitforge

Bulk-first Git operations CLI (gz-git) + Go library

Go Version Version CI License GoDoc

gzh-cli-gitforge provides:

  • gz-git (CLI): scan directories and run safe Git operations across many repositories in parallel.
  • Go library: reusable packages under pkg/ for repository operations, bulk workflows, and forge sync.

CLI Highlights (gz-git)

  • Bulk operations with --scan-depth and --parallel: status, fetch, pull, push, update, diff, commit, switch
  • Bulk clone: clone --url ... / clone --file ... (+ --update)
  • Repo sync:
    • sync forge (GitHub/GitLab/Gitea org/group/user)
    • sync run (YAML config)
  • Maintenance: cleanup branch (dry-run by default)
  • Monitoring: watch (default/compact/json/llm)
  • Insights: history (stats/contributors/file/blame), info, merge detect
  • Tag/stash helpers: tag, stash

Quick Start

Install
go install github.com/gizzahub/gzh-cli-gitforge/cmd/gz-git@latest
gz-git --version
Common Workflows
# Bulk status (current directory + 1 level)
gz-git status

# Fetch everything under ~/projects (2 levels deep)
gz-git fetch -d 2 ~/projects

# Update repos (pull --rebase), continuously
gz-git update --watch --interval 5m -d 2 ~/projects

# Bulk commit (preview → apply)
gz-git commit -d 2 ~/projects
gz-git commit --yes -d 2 ~/projects

# Switch branch across repos (create if missing)
gz-git switch feature/foo --create -d 2 ~/projects

# Bulk clone into ~/projects
gz-git clone ~/projects --url https://github.com/user/repo1.git --url https://github.com/user/repo2.git

# Sync all repos from a GitHub org
gz-git sync forge --provider github --org myorg --target ./repos --token $GITHUB_TOKEN

Requirements

  • Git 2.30+
  • Go 1.25.1+ (building from source / using as a library)

Documentation


License

MIT. See LICENSE.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the current library version following semantic versioning.
	// Format: vMAJOR.MINOR.PATCH[-PRERELEASE].
	Version = "0.4.2"

	// GitCommit is the git commit SHA of the build.
	// This is set during the build process.
	GitCommit = "unknown"

	// BuildDate is the date when the binary was built.
	// This is set during the build process.
	BuildDate = "unknown"
)

Version information. These values can be overridden at build time using -ldflags.

Example:

go build -ldflags "-X github.com/gizzahub/gzh-cli-gitforge.GitCommit=$(git rev-parse HEAD)"

Functions

func FullVersion

func FullVersion() string

FullVersion returns the version with 'v' prefix.

Example:

fmt.Println(gzhcligitforge.FullVersion())
// Output: v0.1.0-alpha

func ShortVersion

func ShortVersion() string

ShortVersion returns just the version number without prefix.

Example:

fmt.Println(gzhcligitforge.ShortVersion())
// Output: 0.1.0-alpha

func VersionInfo

func VersionInfo() map[string]string

VersionInfo returns detailed version information as a map.

The returned map contains:

  • version: The library version (e.g., "0.1.0-alpha")
  • gitCommit: The git commit SHA (e.g., "a1b2c3d")
  • buildDate: The build date (e.g., "2025-11-30")
  • goVersion: The Go version used for building (e.g., "go1.24.0")

Example:

info := gzhcligitforge.VersionInfo()
fmt.Printf("Version: %s\n", info["version"])
fmt.Printf("Commit: %s\n", info["gitCommit"])

func VersionString

func VersionString() string

VersionString returns a formatted version string.

Format: "gzh-cli-gitforge version v0.1.0-alpha (commit: a1b2c3d, built: 2025-11-30)"

Example:

fmt.Println(gzhcligitforge.VersionString())
// Output: gzh-cli-gitforge version v0.1.0-alpha (commit: unknown, built: unknown)

Types

This section is empty.

Directories

Path Synopsis
cmd
gz-git command
Package main is the entry point for the gz-git CLI application.
Package main is the entry point for the gz-git CLI application.
gz-git/cmd
Package cmd implements the CLI commands for gz-git.
Package cmd implements the CLI commands for gz-git.
examples
basic command
branch command
clone command
history command
merge command
internal
gitcmd
Package gitcmd provides Git command execution and output handling.
Package gitcmd provides Git command execution and output handling.
testutil/builders
Package builders provides fluent test fixture builders for git operations.
Package builders provides fluent test fixture builders for git operations.
pkg
config
Package config provides configuration management for gz-git CLI.
Package config provides configuration management for gz-git CLI.
tag
tui
wizard
Package wizard provides interactive setup wizards for gz-git commands.
Package wizard provides interactive setup wizards for gz-git commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL