app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package app builds the gt command tree and its injected dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DraftPath

func DraftPath(err error) string

DraftPath returns the file that holds the unsubmitted text of a failed command, or "".

func Execute

func Execute(ctx context.Context, deps Dependencies, args []string) error

Execute expands aliases and executes the fresh root without printing errors.

func Explain

func Explain(ctx context.Context, deps Dependencies, err error) error

Explain words a command failure for people. It adds the next step to refusals Gitea explains, and words rejected credentials, unreachable servers and expired timeouts. Exit codes are unchanged.

func ManualCommands

func ManualCommands(page *cobra.Command) []*cobra.Command

ManualCommands lists the subcommands that get a page in the manual: the available commands, without the generated help command, and the help topics such as environment and exit-codes.

func ManualDate

func ManualDate(getenv func(string) string) time.Time

ManualDate dates man pages from SOURCE_DATE_EPOCH, falling back to a fixed date so the manual stays reproducible when the variable is unset.

func NewRoot

func NewRoot(deps Dependencies) *cobra.Command

NewRoot builds fresh commands. Construction performs no disk, network, or Git IO.

Types

type Dependencies

type Dependencies struct {
	Browser       terminal.Browser
	Editor        terminal.Editor
	Pager         terminal.Pager
	Executable    func() (string, error)
	Git           git.Runner
	Now           func() time.Time
	Settings      *settings.Store
	Credentials   *auth.Store
	Streams       terminal.Streams
	Prompter      terminal.Prompter
	IssueForm     terminal.IssueForm
	IssueEditForm terminal.IssueEditForm
	PullForm      terminal.PullForm
	ReviewForm    terminal.ReviewForm
	MergeForm     terminal.MergeForm
	MilestoneForm terminal.MilestoneForm
	Getenv        func(string) string
	LookupEnv     func(string) (string, bool)
	Client        func(string, string, bool) *transport.Client
}

Dependencies supplies external boundaries for a fresh CLI invocation.

func System

func System() Dependencies

System connects the CLI to the current environment and terminal.

Jump to

Keyboard shortcuts

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