cmd

package
v0.0.0-...-2fa9275 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitOK        = 0
	ExitUsage     = 2
	ExitDiscovery = 20
	ExitEmpty     = 21
	ExitCanceled  = 30
	ExitLaunch    = 40
)

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

func Main

func Main(args []string, stdout io.Writer, stderr io.Writer) int

Types

type App

type App struct {
	Discover    func(Options) ([]session.SessionCard, []discovery.Diagnostic, error)
	WriteJSON   func(io.Writer, []session.SessionCard) error
	Pick        func([]session.SessionCard) (PickResult, error)
	RunSelected func(session.SessionCard, runner.Mode) error
	CopyCommand func(string) error
	CWD         func() (string, error)
}

func DefaultApp

func DefaultApp() App

func (App) Run

func (app App) Run(args []string, stdout io.Writer, stderr io.Writer) error

type CanceledError

type CanceledError struct{}

func (CanceledError) Error

func (e CanceledError) Error() string

type EmptyError

type EmptyError struct{}

func (EmptyError) Error

func (e EmptyError) Error() string

type HarnessCmd

type HarnessCmd struct{}

type HarnessFilter

type HarnessFilter string
const (
	HarnessAll    HarnessFilter = "all"
	HarnessClaude HarnessFilter = "claude"
	HarnessCodex  HarnessFilter = "codex"
)

type LaunchError

type LaunchError struct {
	Message string
}

func (LaunchError) Error

func (e LaunchError) Error() string

type ListCmd

type ListCmd struct {
	JSON bool `name:"json" help:"Emit stable JSON output."`
}

type Mode

type Mode string
const (
	ModeInteractive Mode = "interactive"
	ModeListJSON    Mode = "list-json"
)

type Options

type Options struct {
	Mode    Mode
	Harness HarnessFilter
	Limit   int
	All     bool
	CWDBias bool
	Debug   bool
	Print   bool
	Tmux    bool
}

func ParseForTest

func ParseForTest(args []string) (Options, error)

func ParseOptions

func ParseOptions(args []string) (Options, error)

type PickResult

type PickResult struct {
	Action   picker.Action
	Selected *session.SessionCard
}

type Root

type Root struct {
	Limit int  `default:"50" help:"Maximum sessions to show."`
	All   bool `help:"Include old, sidechain, and noisy sessions."`
	CWD   bool `name:"cwd" help:"Bias current working directory sessions higher."`
	Debug bool `help:"Print discovery diagnostics to stderr."`
	Print bool `help:"Print selected resume command instead of executing it."`
	Tmux  bool `help:"Launch selected resume command inside tmux."`

	Default HarnessCmd `cmd:"" default:"1" hidden:""`
	Claude  HarnessCmd `cmd:"" help:"Show Claude Code sessions only."`
	Codex   HarnessCmd `cmd:"" help:"Show Codex sessions only."`
	List    ListCmd    `cmd:"" help:"List sessions for scripts."`
}

type UsageError

type UsageError struct {
	Message string
}

func (UsageError) Error

func (e UsageError) Error() string

Jump to

Keyboard shortcuts

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