cli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 16 Imported by: 0 modules, 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 cli implements the koment commands a human or a shell hook runs.

Index

Constants

View Source
const (
	ExitOK      = 0
	ExitFailure = 1
	ExitUsage   = 2
)

Variables

This section is empty.

Functions

func Run

func Run(args []string, env Environment, servers Servers) int

Run dispatches a subcommand.

Types

type Build added in v0.2.0

type Build struct {
	Version  string
	Revision string
}

Build is what a release stamps in at link time. It is empty for a build made any other way, and that is the normal case rather than a fault: Go records the module version and the revision in the binary itself, so describeBuild falls back to those instead of inventing a number.

type Environment

type Environment struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	Build  Build
}

type Server

type Server func(args []string, stderr io.Writer) error

Server runs a long-lived server, parsing its own flags.

type Servers

type Servers struct {
	MCP   Server
	UI    Server
	Site  Server
	Serve Server
	LSP   Server
}

Servers are injected rather than imported. Adding one is a new field, not a new parameter, so signatures here stop changing shape.

Jump to

Keyboard shortcuts

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