cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package cli implements the daemon and start commands for rallish.

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeoutWaitingForBaton = errors.New("rally join: timeout waiting for baton")

ErrTimeoutWaitingForBaton is returned by runRallyJoin when --timeout elapses before any baton event arrives. The top-level main maps this to exit code 2.

Functions

func AddCmd

func AddCmd() *cobra.Command

AddCmd returns the `add` cobra command.

func BootstrapCmd added in v0.3.0

func BootstrapCmd() *cobra.Command

BootstrapCmd returns the `bootstrap` cobra command.

func BuildRegistry

func BuildRegistry() (*adapter.Registry, error)

BuildRegistry creates a registry with all available adapters.

func ConfigCmd added in v0.3.0

func ConfigCmd() *cobra.Command

ConfigCmd returns the `config` cobra command group.

func DoctorCmd added in v0.3.0

func DoctorCmd() *cobra.Command

DoctorCmd returns the `doctor` cobra command.

func RallyCmd

func RallyCmd() *cobra.Command

RallyCmd returns the parent `rally` cobra command with subcommands registered.

func RallyDoneCmd

func RallyDoneCmd() *cobra.Command

RallyDoneCmd returns the `rally done` subcommand.

func RallyJoinCmd

func RallyJoinCmd() *cobra.Command

RallyJoinCmd returns the `rally join` subcommand.

func RallyNewCmd

func RallyNewCmd() *cobra.Command

RallyNewCmd returns the `rally new` subcommand.

func RallyStatusCmd

func RallyStatusCmd() *cobra.Command

RallyStatusCmd returns the `rally status` subcommand.

func RunBootstrap added in v0.3.0

func RunBootstrap(ctx context.Context, opts BootstrapOptions) error

RunBootstrap is the executable entry point so tests can call it directly with an in-memory BootstrapOptions. The context is checked between steps so a Ctrl-C / SIGTERM cancellation exits cleanly without writing a partial config.

func RunConfigEdit added in v0.3.0

func RunConfigEdit(opts *ConfigOptions) error

RunConfigEdit opens the config file in $EDITOR, creating it (with defaults) if it doesn't exist yet.

func RunConfigGet added in v0.3.0

func RunConfigGet(opts *ConfigOptions, key string) error

RunConfigGet prints the resolved value for one key.

func RunConfigList added in v0.3.0

func RunConfigList(opts *ConfigOptions) error

RunConfigList is the executable entry point for `config list` so tests can call it directly with an in-memory ConfigOptions.

func RunConfigSet added in v0.3.0

func RunConfigSet(opts *ConfigOptions, key, value string) error

RunConfigSet writes a value and persists the file.

func RunDaemon

func RunDaemon(ctx context.Context, homeDir string, shutdown <-chan struct{}) error

RunDaemon starts the broker daemon. The caller is responsible for trapping signals and closing the shutdown channel to trigger a graceful stop; RunDaemon will then clean up its socket files.

func RunDoctor added in v0.3.0

func RunDoctor(ctx context.Context, opts DoctorOptions) error

RunDoctor is the exported entry point used by both the cobra command and tests.

func RunSquash

func RunSquash(ctx context.Context, opts SquashOptions) error

RunSquash loads a preset, ensures the daemon is running, creates a session, and starts runners.

Types

type AddOptions

type AddOptions struct {
	Global bool
	From   string
	Yes    bool
	// contains filtered or unexported fields
}

AddOptions holds flags for the add command.

type BootstrapOptions added in v0.3.0

type BootstrapOptions struct {
	// Yes runs in non-interactive mode (CI-friendly). All prompts
	// pick their default; the config file gets the built-in defaults.
	Yes bool

	// SkipSkill skips the skill-bundle install (useful when the user
	// has already placed it under a different path).
	SkipSkill bool

	// SkipConfig skips the config-wizard step (still creates a
	// defaults-only config file if none exists).
	SkipConfig bool
	// contains filtered or unexported fields
}

BootstrapOptions configures the bootstrap wizard.

type ConfigOptions added in v0.3.0

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

ConfigOptions plumbs streams for unit tests.

type DoctorOptions added in v0.3.0

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

DoctorOptions controls the human-facing `rallish doctor` view.

type SquashOptions

type SquashOptions struct {
	PresetName     string
	Task           string
	SessionID      string
	AllowShellExit bool
	HomeDir        string
	Repo           string
}

SquashOptions holds flags for the squash command.

Jump to

Keyboard shortcuts

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