cli

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 51 Imported by: 0

Documentation

Overview

Package cli wires cobra subcommands. NewRoot returns the root *cobra.Command with all subcommands attached.

Index

Constants

View Source
const NoUpgradeNoticeEnv = "AGENTSYNC_NO_UPGRADE_NOTICE"

NoUpgradeNoticeEnv opts a machine out of the first-run-after-upgrade notice entirely: nothing is printed and nothing is recorded, so unsetting it shows any still-unseen notice rather than swallowing it permanently.

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

version metadata; main.go injects via -ldflags. Tests use the literal strings below.

Functions

func Execute

func Execute() error

Execute is the main.go entry point.

func NewRoot

func NewRoot() *cobra.Command

NewRoot constructs the root command tree. Tests build their own root via this constructor so flag state is isolated per test.

Types

type ExitCoder added in v0.11.0

type ExitCoder interface{ ExitCode() int }

ExitCoder is implemented by the quiet sentinel error `status`/`diff` return under --exit-code. main() maps it to a process exit code and prints nothing (the sentinel's Error() is empty), so a CI gate gets a stable non-zero exit without a spurious "agentsync: ..." line. The root command already sets SilenceErrors, so cobra prints nothing for it either.

Jump to

Keyboard shortcuts

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