cli

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 79 Imported by: 0

Documentation

Overview

Package cli implements fairpeer's command-line entry: subcommand routing, flag parsing, assembly from config, and exit codes. The core is config-driven — providers and tools are resolved from configuration, not hardcoded.

Renders a unified diff as line-numbered, syntax-highlighted rows on green/red background bars with a +/- gutter.

Formats a tool call as a Claude-style card line: a "● Verb(primary arg)" header instead of the raw "-> name {json}", plus the "⎿" continuation gutter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FrameLines

func FrameLines(filteredLen, termRows int, searching bool) int

FrameLines is exported for testing. It returns the total number of terminal lines that selectOne/selectMany will print for the given state.

func Run

func Run(args []string, version string) int

Run is the CLI entry point; it returns a process exit code.

Types

type RunMetrics

type RunMetrics struct {
	PromptTokens                  int `json:"prompt_tokens"`
	CompletionTokens              int `json:"completion_tokens"`
	CacheHitTokens                int `json:"cache_hit_tokens"`
	CacheMissTokens               int `json:"cache_miss_tokens"`
	Steps                         int `json:"steps"` // model calls (one per stream, incl. tool rounds)
	Compactions                   int `json:"compactions"`
	ReadinessChecks               int `json:"readiness_checks"`
	ReadinessAllowed              int `json:"readiness_allowed"`
	ReadinessBlocks               int `json:"readiness_blocks"`
	ReadinessRecoveries           int `json:"readiness_recoveries"`
	ReadinessErrors               int `json:"readiness_errors"`
	ReadinessMissingProjectChecks int `json:"readiness_missing_project_checks"`
	ReadinessIncompleteTodos      int `json:"readiness_incomplete_todos"`
	ReadinessCommandMismatches    int `json:"readiness_command_mismatches"`
}

RunMetrics is the machine-readable token/cache/cost summary `run --metrics` writes, so a benchmark harness can read a run's cost without scraping stdout.

Jump to

Keyboard shortcuts

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