cmd

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: MIT Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd provides the command-line interface for Ghost, including the root command configuration, subcommands (ask, chat), and shared functionality like LLM client initialization.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConfig indicates a configuration binding or initialization failure.
	ErrConfig = errors.New("failed to bind config")

	// ErrLogging indicates a logging setup or file operation failure.
	ErrLogging = errors.New("failed to setup logging")

	// ErrLLM indicates an LLM client initialization or request processing failure.
	ErrLLM = errors.New("failed to process LLM request")

	// ErrHomeDir indicates a failure to retrieve the user's home directory path.
	ErrHomeDir = errors.New("failed to get home directory")
)

Functions

func Execute

func Execute() *cobra.Command

Execute creates and returns the root command for use with fang.Execute. It sets up the logger and registers the configuration initialization.

func NewAskCmd

func NewAskCmd(logger *log.Logger) *cobra.Command

NewAskCmd creates a new ask command that sends queries to the configured LLM. It supports both direct command-line queries and piped input from stdin.

func NewChatCmd added in v1.1.0

func NewChatCmd(logger *log.Logger) *cobra.Command

NewChatCmd creates a new chat command that launches an interactive TUI session for multi-turn conversations with the configured LLM.

func NewRootCmd

func NewRootCmd(logger *log.Logger) *cobra.Command

NewRootCmd creates and returns the root command for the Ghost CLI application. It sets up persistent flags for configuration, debug mode, model selection, and API settings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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