Help us shape the future of Go! Take the 2026 Go Developer Survey

app

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package app is the hive CLI's composition root: the engine services plus the pieces only the CLI has (plugins, the command set, sources, its config).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSourceRegistry

func BuildSourceRegistry(logger zerolog.Logger, cfg *config.Config, exec cliengine.Executor, kvStore kv.KV) *sources.Registry

BuildSourceRegistry constructs the sources.Registry from cfg, registering a per-backend source for each enabled builtin. Registration failures are logged and the offending entry is skipped rather than failing startup.

Types

type App

type App struct {
	*hive.Engine

	// Logger carries no cmp label. A command or component adds its own.
	Logger zerolog.Logger

	// Config is the CLI config. It shadows Engine.Config, and its embedded
	// engine half is the config the engine was built from.
	Config      *config.Config
	Doctor      *doctor.Service
	Multiplexer Multiplexer
	Plugins     *plugins.Manager
	CommandSet  *plugins.CommandSet
	Build       BuildInfo
	Sources     *sources.Registry
}

App is the central entry point for all hive operations. It embeds the engine, whose accessors (Sessions, Messages, HC, ...) commands and the TUI call per use, and adds what only the CLI has.

func NewApp

func NewApp(
	logger zerolog.Logger,
	engine *hive.Engine,
	cfg *config.Config,
	multiplexer Multiplexer,
	pluginMgr *plugins.Manager,
	commandSet *plugins.CommandSet,
	pluginInfos []doctor.PluginInfo,
) *App

NewApp wraps an engine built from &cfg.Config with the CLI pieces. Doctor validates the whole CLI config, so `hive doctor` keeps reporting errors in sections only the CLI reads.

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo holds build-time metadata set by the main package.

type Multiplexer

type Multiplexer interface {
	sessionsvc.Multiplexer
	terminal.PaneSource
	ResolveTarget(ctx context.Context, raw string) (multiplexer.Pane, error)
	SendLiteral(ctx context.Context, target multiplexer.Target, text string) error
	SendKey(ctx context.Context, target multiplexer.Target, key multiplexer.NamedKey) error
	Paste(ctx context.Context, target multiplexer.Target, text []byte, opts multiplexer.PasteOptions) error
}

Multiplexer exposes the shared operations used by application commands.

Jump to

Keyboard shortcuts

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