cli

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package cli is the lfr command line: the only way to operate a server. Every command except init, serve, version and skills talks to the running server over its local control socket.

Index

Constants

View Source
const (
	ExitOK         = 0
	ExitFailure    = 1
	ExitUsage      = 2
	ExitNotRunning = 3
	ExitInterrupt  = 130
)

Exit codes.

View Source
const (
	RemoteEnv     = "LFR_REMOTE"      // user@host (or an ssh alias) running the lfr server
	RemoteDataEnv = "LFR_REMOTE_DATA" // the server's data directory when not the default
)

Remote operation: the CLI on a laptop drives the server over ssh.

View Source
const DefaultData = "/var/lib/lfr"

DefaultData is where lfr keeps its data unless --data or LFR_DATA say otherwise.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, env Env, args []string) int

Run executes args and returns the exit code.

Types

type Build

type Build struct{ Version, Commit, Date string }

Build identifies the binary.

type Env

type Env struct {
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	Build          Build
	Getenv         func(string) string
}

Env is what a command touches outside the file system.

Jump to

Keyboard shortcuts

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