statusline

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextInfo

type ContextInfo struct {
	CurrentUsage        ContextUsage `json:"current_usage"`
	ContextWindow       int          `json:"context_window_size"`
	UsedPercentage      float64      `json:"used_percentage"`      // New in Claude Code 2.1.6
	RemainingPercentage float64      `json:"remaining_percentage"` // New in Claude Code 2.1.6
}

ContextInfo contains context window usage

type ContextUsage

type ContextUsage struct {
	InputTokens         int `json:"input_tokens"`
	OutputTokens        int `json:"output_tokens"`
	CacheCreationTokens int `json:"cache_creation_input_tokens"`
	CacheReadTokens     int `json:"cache_read_input_tokens"`
}

ContextUsage contains token counts

type CostInfo

type CostInfo struct {
	TotalCostUSD      float64 `json:"total_cost_usd"`
	TotalLinesAdded   int     `json:"total_lines_added"`
	TotalLinesRemoved int     `json:"total_lines_removed"`
}

CostInfo contains cost and line change information

type Input

type Input struct {
	SessionID string        `json:"session_id"`
	Model     ModelInfo     `json:"model"`
	Workspace WorkspaceInfo `json:"workspace"`
	Cost      CostInfo      `json:"cost"`
	Context   ContextInfo   `json:"context_window"`
}

Input is the JSON structure received from Claude Code

type ModelInfo

type ModelInfo struct {
	DisplayName string `json:"display_name"`
}

ModelInfo contains model information

type StatusLine

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

StatusLine handles rendering the status line

func New

func New(input Input, cfg config.Config) *StatusLine

New creates a new StatusLine renderer

func (*StatusLine) Render

func (sl *StatusLine) Render() string

Render generates the status line output

type WorkspaceInfo

type WorkspaceInfo struct {
	ProjectDir string `json:"project_dir"`
	CurrentDir string `json:"current_dir"`
}

WorkspaceInfo contains workspace paths

Jump to

Keyboard shortcuts

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