cli

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package cli builds howmuchleft's strictcli command tree and runs the statusline itself: it parses the status object Claude Code pipes on stdin, gathers usage, git and profile data, and hands the result to internal/render.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp() *strictcli.App

NewApp builds and returns the strictcli application.

Every command is classified strictcli.EffectMutating, including the ones that only print. That is not a rubber stamp: every handler opens with runMigrations(), which converts a legacy ~/.config/howmuchleft.json to TOML (renaming the original to .bak) and writes any missing settings into ~/.config/howmuchleft/config.toml. Those are user-visible filesystem mutations, so no command here can honestly claim read_only. classification_test.go pins the table.

func RunGitCacheRefresh

func RunGitCacheRefresh() bool

RunGitCacheRefresh handles the detached invocation a render starts to refresh a repository's status cache:

howmuchleft --refresh-git-cache <repository-root>

Like statusline mode, it is dispatched before the strictcli app is built and is not a command in it: it exists for howmuchleft to call on itself, takes no options, prints nothing on success, and running any of the app's commands instead would run the migrations a render has no business running. Returns true if it handled the invocation (caller should exit), false otherwise.

func RunStatuslineDirect

func RunStatuslineDirect() bool

RunStatuslineDirect checks if stdin is piped and runs the statusline. Returns true if it handled the invocation (caller should exit), false otherwise.

func SetVersion

func SetVersion(v string)

SetVersion sets the application version string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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