cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package cli is the podium command-line client. It talks to the control plane over Connect and never touches Docker: everything it knows comes from the server.

Index

Constants

View Source
const (
	// ExitInfra is anything that stopped the task from producing an exit code: the
	// server was unreachable, the image would not pull, the node failed the task.
	ExitInfra = 125
	// ExitCancelled is a task that was cancelled, matching the shell's 128+SIGINT.
	ExitCancelled = 130
	// ExitUsage is a bad invocation or a rejected request.
	ExitUsage = 1
)

Exit codes the CLI is contractual about; see docs/cli.md.

View Source
const DefaultServer = "http://127.0.0.1:8080"

DefaultServer is what the CLI dials when nothing says otherwise.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() string

ConfigPath is the file the CLI reads, honouring XDG_CONFIG_HOME.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand builds the whole CLI. The global --server and --token flags win over PODIUM_SERVER/PODIUM_TOKEN, which win over ~/.config/podium/config.yaml.

Types

type Config

type Config struct {
	Server string `yaml:"server"`
	// SENSITIVE: never printed. Under the local transport this is PODIUM_LOCAL_TOKEN.
	Token string `yaml:"token"`
}

Config is ~/.config/podium/config.yaml. Environment variables override it and flags override them, so a scripted invocation never depends on what is on the developer's disk.

func LoadConfig

func LoadConfig(serverFlag, tokenFlag string) (Config, error)

LoadConfig resolves the effective configuration: the file, then PODIUM_SERVER and PODIUM_TOKEN (or PODIUM_LOCAL_TOKEN, which is the same secret under the server's name for it), then the --server and --token flags. A missing file is not an error.

func (Config) Tailnet

func (c Config) Tailnet() bool

Tailnet reports whether the configured server is a tailnet control plane, which is the only case in which the CLI needs no credential of its own.

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries a specific process exit status out of a command. `podium run` uses it to hand the task's own exit code back to the shell.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

Jump to

Keyboard shortcuts

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