cli

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package cli implements the wallfacer CLI subcommands.

Package cli implements all wallfacer CLI subcommands: run (start server), status (print board state), doctor (check prerequisites), and exec (attach to container).

The run subcommand wires together the HTTP server, workspace manager, task store, runner, and handler into a running system. Other subcommands provide operational tooling for inspecting and interacting with the running server or sandbox containers. Platform-specific signal handling and process execution are isolated in _unix.go and _windows.go files.

Connected packages

This is the top-level orchestrator that depends on nearly every internal package: apicontract for route registration, handler for HTTP handlers, runner for task execution, store for persistence, workspace for workspace lifecycle, envconfig for configuration, logger for logging, metrics for instrumentation, constants for system parameters, and prompts for template management. Changes to any of these packages may require corresponding updates in cli.

Usage

cli.RunServer(configDir, args, uiFS, docsFS)  // start HTTP server
cli.RunStatus(configDir, args)                 // print board state
cli.RunDoctor(configDir)                       // check prerequisites
cli.RunExec(configDir, args)                   // attach to container

Index

Constants

This section is empty.

Variables

View Source
var Version = ""

Version is set at build time via -ldflags. When empty (dev build), the binary pulls the :latest sandbox image.

Functions

func BuildMux

func BuildMux(h *handler.Handler, reg *metrics.Registry, indexData IndexViewData, uiFS, docsFS fs.FS) *http.ServeMux

BuildMux constructs the HTTP request router.

All API routes are registered from apicontract.Routes (the single source of truth). The handlers map below pairs each route Name with its http.HandlerFunc, applying per-route middleware (e.g. UUID parsing via withID) at map construction time. A startup panic is triggered if a route in the contract has no corresponding handler entry, preventing silent drift.

func ConfigDir

func ConfigDir() string

ConfigDir returns the default wallfacer configuration directory.

func PrintUsage

func PrintUsage()

PrintUsage writes the CLI help text to stderr.

func RunDoctor

func RunDoctor(configDir string)

RunDoctor implements the `wallfacer doctor` subcommand. It displays configuration paths, checks prerequisites, and reports whether credentials, container runtime, sandbox images, and git are ready. Items marked [!] need attention; [ ] are optional.

func RunExec

func RunExec(configDir string, args []string)

RunExec attaches to a running task container or opens a new sandbox shell.

func RunServer

func RunServer(configDir string, args []string, uiFS, docsFS fs.FS)

RunServer implements the `wallfacer run` subcommand. uiFS and docsFS are the embedded (or on-disk) filesystems containing the ui/ and docs/ directory trees respectively.

func RunStatus

func RunStatus(_ string, args []string)

RunStatus implements the `wallfacer status` subcommand.

Types

type IndexViewData

type IndexViewData struct {
	ServerAPIKey string
}

IndexViewData holds the data passed to the index.html template.

Jump to

Keyboard shortcuts

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