cli

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli provides the interactive inline CLI terminal application.

Index

Constants

View Source
const CtrlCTimeout = 2 * time.Second

CtrlCTimeout is the duration before the Ctrl+C confirmation resets.

Variables

View Source
var App = trail.SimpleFC("App", func() trail.Node {
	queryClient := kitex.UseMemo(func() *wind.Client {
		return wind.NewClient()
	}, nil)

	return kitex.Fragment(
		wind.Provider(wind.ProviderProps{Client: queryClient}, appContent()),
		components.TerminalStatus(),
	)
})

App is the root REPL UI component, wrapped in a wind.Provider.

View Source
var ErrInvalidOptions = errors.New("repl: invalid options")

ErrInvalidOptions is returned when required Options fields are missing.

Functions

func ActiveQuota

func ActiveQuota() *api.ModelQuota

ActiveQuota returns the store's latest quota reading for the active model, or nil when the model has no subscription window or none was ever read.

func ActiveSession

func ActiveSession() *api.Session

ActiveSession returns the currently active session from the store, or nil if none.

func ActiveUsage

func ActiveUsage() api.SessionUsage

ActiveUsage returns the active session's usage snapshot; it is empty for draft sessions that never recorded calls.

func FormatExitSummary

func FormatExitSummary(in ExitSummaryInput) string

FormatExitSummary renders the goodbye block: the ASCII brand mark in the left gutter beside aligned Changes, Cost/Quota, Tokens, and Resume rows. It is plain-string output (the app runtime has already stopped), so colors come from the static theme snapshot rather than the reactive hook.

func Run

func Run(ctx context.Context, opts Options) error

Run starts the REPL application using the Kite trail inline engine.

Types

type ExitSummaryInput

type ExitSummaryInput struct {
	SessionID string
	Usage     api.SessionUsage
	// Quota is optional; when set the cost row renders remaining quota
	// instead of dollar cost.
	Quota *api.ModelQuota
	// Color enables ANSI true-color output; disable for pipes and NO_COLOR.
	Color bool
}

ExitSummaryInput carries everything the post-REPL goodbye block renders.

type Options

type Options struct {
	Client      *client.Client
	Workspace   string
	Version     string
	SessionID   string
	Agent       string
	Model       string
	Title       string
	Backend     backend.Backend
	StartDaemon func(ctx context.Context, socketPath string) error

	// Sandbox is the requested sandbox isolation backend ("native" or
	// "local") for sessions this REPL creates. Empty means the daemon
	// resolves the host default (native when available).
	Sandbox api.SandboxMode

	// StartupNotices are appended to the transcript as warning notices once
	// the REPL boots (e.g. a daemon version skew the user should act on).
	StartupNotices []string
}

Options holds configuration for starting the REPL.

func (Options) Validate

func (o Options) Validate() error

Validate checks that all required fields in Options are provided.

Directories

Path Synopsis
Package command implements the REPL slash command system for the TaskSmith CLI.
Package command implements the REPL slash command system for the TaskSmith CLI.
Package components provides UI components for the repl terminal interface.
Package components provides UI components for the repl terminal interface.
Package store manages global application UI state for the REPL using kites.
Package store manages global application UI state for the REPL using kites.

Jump to

Keyboard shortcuts

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