Documentation
¶
Overview ¶
Package runnercli holds the launch logic shared by the standalone railgrid-runner binary (cmd/railgrid-runner) and the `railgrid runner run` subcommand of the main CLI (pkg/cli/cmd/runner.go). Both entry points parse their own flags — one with stdlib flag, the other with pflag — and then hand the identical Options to Run, so the two can never diverge on refusals (uid 0, non-loopback listener) or on how a harness adapter is configured.
Index ¶
Constants ¶
const ( // HarnessCodex is the default coding harness, for backwards compatibility: // a command line that predates --harness keeps behaving exactly as it did. HarnessCodex = "codex" // HarnessClaude runs headless Claude Code. HarnessClaude = "claude" // DefaultCodexBinary is the Codex executable looked up on PATH. DefaultCodexBinary = "codex" // DefaultCodexVersionPin is the Codex version the adapter probes for. It // applies ONLY to the Codex harness: Claude Code has no default pin. DefaultCodexVersionPin = "0.155.1" // DefaultClaudeBinary is the Claude Code executable looked up on PATH. DefaultClaudeBinary = "claude" )
Variables ¶
var Harnesses = []string{HarnessCodex, HarnessClaude} //nolint:gochecknoglobals
Harnesses are the accepted --harness values.
Functions ¶
func Run ¶
Run serves the loopback runner until ctx is cancelled. It refuses to run as root: the runner executes a coding harness, and the harness boundaries are configuration isolation, not a privilege boundary.
func WriteVersion ¶
WriteVersion emits the build and protocol metadata as JSON. It deliberately loads no enrollment, credentials, or harness state, so it stays usable as a local health check on a host whose configuration is broken.
Types ¶
type Options ¶
type Options struct {
Config string
StateDir string
Listen string
TokenFile string
// Harness selects the adapter: "codex" (default) or "claude".
Harness string
// VersionPin applies to the SELECTED harness. Empty means the harness
// default, which is a pinned version for Codex and no pin for Claude Code.
VersionPin string
CodexHome string
CodexBinary string
ClaudeHome string
ClaudeBinary string
ClaudeModel string
// ClaudePermissionMode is acceptEdits (default) or bypassPermissions.
ClaudePermissionMode string
// ClaudeAllowedTools are tool patterns granted up front, e.g. "Bash(git *)".
ClaudeAllowedTools []string
}
Options are the runner's launch inputs. Everything durable (identity, enrollment, token) lives in the JSON configuration file; these only select the file, the harness, and a handful of paths.
One runner process drives exactly ONE harness. That is deliberate: the capabilities response advertises a single harness entry, and a coordinator that dispatches to a runner needs to know what it will get without negotiating.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the defaults both front ends advertise.