cmd

package
v0.0.0-...-c92907e Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cmd provides the command-line interface for the Got CLI tool. It implements Cobra commands for git repository management operations including pull, fetch, and status commands that can operate on single repositories or recursively across directory trees.

Index

Constants

View Source
const (
	ErrorWalkingMessage = "error walking filepath [%s]"
	SkippingMessage     = "Skipping [%s]"
	SuccessMessage      = "[%s]:  Success"
	ErrorMessage        = "[%s]: ERROR %v"
)

Constants for commonly used logging messages

View Source
const (
	RecursiveFlagName = "recursive"
)

Constants for commonly used strings

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "got",
	Short: "Git repository management tool",
	Long: `Got is a CLI tool for managing multiple Git repositories.

It allows you to perform git operations (pull, fetch, status) across single 
repositories or recursively across directory trees containing multiple git 
repositories. Use the --recursive flag to operate on all repositories found 
in subdirectories.

Configuration (.got.yaml in your home directory):
  skipList: ["custom_dir", "temp"]           # Custom directories to skip
  useDefaultSkips: true                      # Include defaults (node_modules, vendor, .git)

By default, common directories (node_modules, vendor, .git) are automatically 
skipped. Set useDefaultSkips: false to disable this behavior.`,
}

RootCmd represents the base command when called without any subcommands

View Source
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}

SpinnerFrames provides spinner animation frames

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func SetGitCommandRunner

func SetGitCommandRunner(runner git.CommandRunner) git.CommandRunner

SetGitCommandRunner sets the git command runner (for testing)

func SimpleProgressBar

func SimpleProgressBar(current, total int, width int) string

SimpleProgressBar creates a simple inline progress bar for single operations

Types

type ProgressTracker

type ProgressTracker struct {
	// contains filtered or unexported fields
}

ProgressTracker manages progress display for operations

func NewProgressTracker

func NewProgressTracker() *ProgressTracker

NewProgressTracker creates a new progress tracker

func (*ProgressTracker) Finish

func (pt *ProgressTracker) Finish()

Finish completes the progress tracking

func (*ProgressTracker) GetGitRepoCount

func (pt *ProgressTracker) GetGitRepoCount() int

GetGitRepoCount returns the number of git repositories found

func (*ProgressTracker) GetProcessedCount

func (pt *ProgressTracker) GetProcessedCount() int

GetProcessedCount returns the number of directories processed

func (*ProgressTracker) SetTotal

func (pt *ProgressTracker) SetTotal(total int)

SetTotal sets the total number of items to process

func (*ProgressTracker) ShowMessage

func (pt *ProgressTracker) ShowMessage(message string)

ShowMessage temporarily displays a message without disrupting progress

func (*ProgressTracker) Start

func (pt *ProgressTracker) Start()

Start begins progress tracking

func (*ProgressTracker) Update

func (pt *ProgressTracker) Update(path string, isGitRepo bool)

Update updates the progress with current path

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

Spinner manages a simple spinner animation

func NewSpinner

func NewSpinner() *Spinner

NewSpinner creates a new spinner

func (*Spinner) Next

func (s *Spinner) Next() string

Next returns the next spinner frame

Jump to

Keyboard shortcuts

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