No results
1
Home
Virgil edited this page 2026-02-23 04:54:00 +00:00
Table of Contents
Core CLI Framework (pkg/cli)
Go 1.26 CLI framework built on cobra + bubbletea + lipgloss. Provides command registration, flag helpers, styled output, streaming, daemon mode, and TUI components.
Import: forge.lthn.ai/core/cli/pkg/cli
Quick Start
package main
import "forge.lthn.ai/core/cli/pkg/cli"
func main() {
cli.WithAppName("myapp")
cli.Main(
cli.WithCommands("greet", addGreetCommands),
)
}
func addGreetCommands(root *cli.Command) {
cmd := cli.NewCommand("greet", "Say hello", "", func(cmd *cli.Command, args []string) error {
cli.Success("Hello, world!")
return nil
})
root.AddCommand(cmd)
}
Pages
- Command-Builders — NewCommand, NewGroup, NewRun, flag helpers
- Output-Functions — Success, Error, Warn, Info, Progress, Section, Label
- Error-Handling — Err, Wrap, WrapVerb, ExitError, Is/As/Join
- Streaming — Stream for token-by-token rendering
- Daemon-Mode — PIDFile, HealthServer, Daemon runner
- Prompt-Input — Prompt, Select, MultiSelect
- Runtime — Init, Main, Shutdown, Context, signal handling
- Framework-Integration — WithCommands, Core lifecycle, services
- Styles-and-Glyphs — ANSI styles, glyph shortcodes, colours
- Frame-TUI — Bubbletea AppShell with focus, navigation, keymaps