handlers

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersion

func GetVersion() string

GetVersion returns the ldflags-provided version, the installed module version, or "dev" for an untagged local build, in that order.

func HandleCode

func HandleCode(ctx context.Context, cfg *config.Config, args []string, opts CodeOptions) error

HandleCode resolves a provider, sets up the environment, and execs Claude Code with all non-CCL arguments passed through unchanged.

func HandleDoctor added in v0.5.0

func HandleDoctor(ctx context.Context, out io.Writer, cfg *config.Config, opts DoctorOptions) error

HandleDoctor runs preflight diagnostics for the selected provider(s).

func HandleProviders added in v0.3.2

func HandleProviders(out io.Writer, cfg *config.Config) error

HandleProviders prints the configured providers as a table, marking the default and showing whether each has auth credentials available.

func HandleUpdate added in v0.3.0

func HandleUpdate(ctx context.Context, out, errOut io.Writer, checkOnly bool) error

HandleUpdate checks GitHub for a newer release and, unless --check was set, runs `go install` to update the binary.

Types

type CodeOptions added in v0.5.1

type CodeOptions struct {
	Input       io.Reader
	Output      io.Writer
	ErrorOutput io.Writer
}

CodeOptions contains the launcher's process streams.

type DoctorOptions added in v0.5.1

type DoctorOptions struct {
	Provider string
	JSON     bool
	CheckNet bool
}

DoctorOptions controls provider selection, output format, and network checks.

type ExitCodeError added in v0.5.0

type ExitCodeError struct {
	Code int
	Msg  string
}

ExitCodeError carries an intended process exit code alongside a message. cmd/ccl/main.go exits 1 on any non-nil Execute() error; Code is reserved for future per-code handling.

func (*ExitCodeError) Error added in v0.5.0

func (e *ExitCodeError) Error() string

type ProviderChoice added in v0.5.0

type ProviderChoice struct {
	Name  string
	Model string
}

ProviderChoice is one selectable provider row.

type ProviderSelector added in v0.5.0

type ProviderSelector interface {
	SelectProvider(ctx context.Context, choices []ProviderChoice, current string) (string, error)
}

ProviderSelector chooses a provider from the configured provider list.

type TerminalProviderSelector added in v0.5.0

type TerminalProviderSelector struct {
	In  io.Reader
	Out io.Writer
}

TerminalProviderSelector selects providers with a simple stdin/stdout prompt.

func (TerminalProviderSelector) SelectProvider added in v0.5.0

func (s TerminalProviderSelector) SelectProvider(ctx context.Context, choices []ProviderChoice, current string) (string, error)

SelectProvider prompts for one provider name.

Jump to

Keyboard shortcuts

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