Help us shape the future of Go! Take the 2026 Go Developer Survey

workspace

package
v0.0.0-...-a92561a Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package workspace owns repository and workspace context used by the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdditionalDirContext

func AdditionalDirContext(dir string) (absolutePath, contextBlock string, err error)

AdditionalDirContext validates a directory and formats its AGENTS.md instructions for inclusion in a conversation.

func BranchSummary

func BranchSummary() string

BranchSummary returns a compact branch, revision, upstream, and status report suitable for interactive CLI output.

func DiffReport

func DiffReport() (string, error)

DiffReport returns the current working-tree diff, falling back to the index when there are no unstaged changes. An empty report means no changes exist.

func DiffReportWith

func DiffReportWith(git GitOutputFunc) (string, error)

DiffReportWith makes diff selection and truncation independently testable.

func FilesSummary

func FilesSummary() string

FilesSummary returns a compact modified-files report.

func GitOutput

func GitOutput(args ...string) (string, error)

GitOutput runs the fixed git executable and returns trimmed stdout. Git warnings remain on stderr so callers receive stable values for UI output.

Types

type GitOutputFunc

type GitOutputFunc func(args ...string) (string, error)

GitOutputFunc is the narrow git boundary used by DiffReport.

Jump to

Keyboard shortcuts

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