1 Home
Virgil edited this page 2026-02-23 04:54:00 +00:00

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