---
title: cmd/radioactive_ralph
description: Go API reference for the radioactive\_ralph package.
---
# radioactive\_ralph
```go
import "github.com/jbcom/radioactive-ralph/cmd/radioactive_ralph"
```
Command radioactive\_ralph is the radioactive\-ralph CLI entry point.
Ralph is a per\-repo orchestration binary with multiple built\-in personas. Today the runtime targets the claude CLI, but the long\-term contract is provider\-oriented rather than Claude\-plugin\-oriented. See https://github.com/jbcom/radioactive-ralph for the full rationale and architecture plan.
## Index
- [Variables](<#variables>)
- [type AttachCmd](<#AttachCmd>)
- [func \(c \*AttachCmd\) Run\(rc \*runContext\) error](<#AttachCmd.Run>)
- [type DoctorCmd](<#DoctorCmd>)
- [func \(c \*DoctorCmd\) Run\(rc \*runContext\) error](<#DoctorCmd.Run>)
- [type InitCmd](<#InitCmd>)
- [func \(c \*InitCmd\) Run\(rc \*runContext\) error](<#InitCmd.Run>)
- [type MCPCmd](<#MCPCmd>)
- [type MCPRegisterCmd](<#MCPRegisterCmd>)
- [func \(c \*MCPRegisterCmd\) Run\(\_ \*runContext\) error](<#MCPRegisterCmd.Run>)
- [type MCPStatusCmd](<#MCPStatusCmd>)
- [func \(c \*MCPStatusCmd\) Run\(\_ \*runContext\) error](<#MCPStatusCmd.Run>)
- [type MCPUnregisterCmd](<#MCPUnregisterCmd>)
- [func \(c \*MCPUnregisterCmd\) Run\(\_ \*runContext\) error](<#MCPUnregisterCmd.Run>)
- [type PlanCmd](<#PlanCmd>)
- [type PlanImportCmd](<#PlanImportCmd>)
- [func \(c \*PlanImportCmd\) Run\(rc \*runContext\) error](<#PlanImportCmd.Run>)
- [type PlanLsCmd](<#PlanLsCmd>)
- [func \(c \*PlanLsCmd\) Run\(rc \*runContext\) error](<#PlanLsCmd.Run>)
- [type PlanMarkDoneCmd](<#PlanMarkDoneCmd>)
- [func \(c \*PlanMarkDoneCmd\) Run\(rc \*runContext\) error](<#PlanMarkDoneCmd.Run>)
- [type PlanNextCmd](<#PlanNextCmd>)
- [func \(c \*PlanNextCmd\) Run\(rc \*runContext\) error](<#PlanNextCmd.Run>)
- [type PlanShowCmd](<#PlanShowCmd>)
- [func \(c \*PlanShowCmd\) Run\(rc \*runContext\) error](<#PlanShowCmd.Run>)
- [type RunCmd](<#RunCmd>)
- [func \(c \*RunCmd\) Run\(rc \*runContext\) error](<#RunCmd.Run>)
- [type ServeCmd](<#ServeCmd>)
- [func \(c \*ServeCmd\) Run\(rc \*runContext\) error](<#ServeCmd.Run>)
- [type ServiceCmd](<#ServiceCmd>)
- [type ServiceInstallCmd](<#ServiceInstallCmd>)
- [func \(c \*ServiceInstallCmd\) Run\(\_ \*runContext\) error](<#ServiceInstallCmd.Run>)
- [type ServiceListCmd](<#ServiceListCmd>)
- [func \(c \*ServiceListCmd\) Run\(\_ \*runContext\) error](<#ServiceListCmd.Run>)
- [type ServiceStatusCmd](<#ServiceStatusCmd>)
- [func \(c \*ServiceStatusCmd\) Run\(\_ \*runContext\) error](<#ServiceStatusCmd.Run>)
- [type ServiceUninstallCmd](<#ServiceUninstallCmd>)
- [func \(c \*ServiceUninstallCmd\) Run\(\_ \*runContext\) error](<#ServiceUninstallCmd.Run>)
- [type StatusCmd](<#StatusCmd>)
- [func \(c \*StatusCmd\) Run\(rc \*runContext\) error](<#StatusCmd.Run>)
- [type StopCmd](<#StopCmd>)
- [func \(c \*StopCmd\) Run\(rc \*runContext\) error](<#StopCmd.Run>)
- [type SupervisorCmd](<#SupervisorCmd>)
- [func \(c \*SupervisorCmd\) Run\(rc \*runContext\) error](<#SupervisorCmd.Run>)
## Variables
Version is set by GoReleaser at build time via \-ldflags.
```go
var (
Version = "dev"
Commit = "none"
Date = "unknown"
)
```
## type [AttachCmd]()
AttachCmd is \`radioactive\_ralph attach \-\-variant X\`.
```go
type AttachCmd struct {
Variant string `help:"Variant to attach to." required:""`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
Raw bool `help:"Emit raw JSON-line event frames instead of the default one-line summary."`
}
```
### func \(\*AttachCmd\) [Run]()
```go
func (c *AttachCmd) Run(rc *runContext) error
```
Run streams events from the supervisor until the operator cancels.
## type [DoctorCmd]()
DoctorCmd is \`radioactive\_ralph doctor\`.
```go
type DoctorCmd struct{}
```
### func \(\*DoctorCmd\) [Run]()
```go
func (c *DoctorCmd) Run(rc *runContext) error
```
Run prints the doctor report.
## type [InitCmd]()
InitCmd is \`radioactive\_ralph init\`.
```go
type InitCmd struct {
RepoRoot string `help:"Repo root to initialize. Defaults to cwd." type:"path" default:""`
Force bool `help:"Overwrite existing config.toml."`
Refresh bool `help:"Re-discover capabilities while preserving existing operator choices."`
Yes bool `help:"Skip interactive prompts; auto-select first candidate for multi-candidate categories."`
SkipMCP bool `help:"Skip the Claude Code MCP registration step. Default is to register."`
MCPScope string `help:"Scope for the MCP registration: local, user, or project." default:"user" enum:"local,user,project"`
}
```
### func \(\*InitCmd\) [Run]()
```go
func (c *InitCmd) Run(rc *runContext) error
```
Run executes the init subcommand.
## type [MCPCmd]()
MCPCmd groups MCP server client\-registration helpers. These shell out to \`claude mcp add/remove/get\` rather than editing Claude Code's config files directly — the CLI is the supported interface, and using it means we stay correct when Claude changes its on\-disk format.
```go
type MCPCmd struct {
Register MCPRegisterCmd `cmd:"" help:"Register radioactive_ralph as an MCP server with Claude Code."`
Unregister MCPUnregisterCmd `cmd:"" help:"Remove radioactive_ralph's MCP server registration."`
Status MCPStatusCmd `cmd:"" help:"Show the registered MCP server entry, if any."`
}
```
## type [MCPRegisterCmd]()
MCPRegisterCmd is \`radioactive\_ralph mcp register\`. It wires the current binary into Claude Code as a stdio MCP server.
```go
type MCPRegisterCmd struct {
Name string `help:"Registration name." default:"radioactive_ralph"`
Scope string `help:"Config scope: local, user, project." default:"user" enum:"local,user,project"`
Bin string `help:"Path to radioactive_ralph binary. Defaults to argv[0]."`
}
```
### func \(\*MCPRegisterCmd\) [Run]()
```go
func (c *MCPRegisterCmd) Run(_ *runContext) error
```
Run shells out to \`claude mcp add\`.
## type [MCPStatusCmd]()
MCPStatusCmd is \`radioactive\_ralph mcp status\`. Shells out to \`claude mcp get \\`; exit code 0 = registered, non\-zero = not.
```go
type MCPStatusCmd struct {
Name string `help:"Registration name." default:"radioactive_ralph"`
}
```
### func \(\*MCPStatusCmd\) [Run]()
```go
func (c *MCPStatusCmd) Run(_ *runContext) error
```
Run shells out to \`claude mcp get\`.
## type [MCPUnregisterCmd]()
MCPUnregisterCmd is \`radioactive\_ralph mcp unregister\`.
```go
type MCPUnregisterCmd struct {
Name string `help:"Registration name." default:"radioactive_ralph"`
Scope string `help:"Config scope: local, user, project." default:"user" enum:"local,user,project"`
}
```
### func \(\*MCPUnregisterCmd\) [Run]()
```go
func (c *MCPUnregisterCmd) Run(_ *runContext) error
```
Run shells out to \`claude mcp remove\`.
## type [PlanCmd]()
PlanCmd is \`radioactive\_ralph plan \\`. This is the durable plan\-DAG surface — direct CRUD against the SQLite store under $XDG\_STATE\_HOME/radioactive\_ralph/.
```go
type PlanCmd struct {
Ls PlanLsCmd `cmd:"" help:"List plans for this repo by default. Use --all-repos to widen the view."`
Show PlanShowCmd `cmd:"" help:"Show one plan's tasks and current ready set."`
Next PlanNextCmd `cmd:"" help:"Print the next ready task for a plan (without claiming it)."`
// Import seeds a plan from a JSON file. Used during the
// dogfooding bootstrap before the MCP server + fixit rewire.
Import PlanImportCmd `cmd:"" help:"Import tasks into a new plan from a JSON file."`
// MarkDone lets an operator (or shell script acting as one)
// close out a task manually while we bootstrap.
MarkDone PlanMarkDoneCmd `cmd:"mark-done" help:"Mark a running task as done."`
}
```
## type [PlanImportCmd]()
PlanImportCmd implements \`plan import \\`.
```go
type PlanImportCmd struct {
Path string `arg:"" help:"Path to JSON file."`
}
```
### func \(\*PlanImportCmd\) [Run]()
```go
func (c *PlanImportCmd) Run(rc *runContext) error
```
## type [PlanLsCmd]()
PlanLsCmd implements \`plan ls\`.
```go
type PlanLsCmd struct {
All bool `help:"Include archived + abandoned plans."`
AllRepos bool `help:"Include plans from every repo in the operator state dir."`
}
```
### func \(\*PlanLsCmd\) [Run]()
```go
func (c *PlanLsCmd) Run(rc *runContext) error
```
## type [PlanMarkDoneCmd]()
PlanMarkDoneCmd implements \`plan mark\-done \ \\`.
```go
type PlanMarkDoneCmd struct {
PlanIDOrSlug string `arg:"" help:"Plan UUID or slug."`
TaskID string `arg:"" help:"Task id within the plan."`
Evidence string `help:"Evidence payload (JSON or short string)."`
}
```
### func \(\*PlanMarkDoneCmd\) [Run]()
```go
func (c *PlanMarkDoneCmd) Run(rc *runContext) error
```
## type [PlanNextCmd]()
PlanNextCmd implements \`plan next \\`.
```go
type PlanNextCmd struct {
IDOrSlug string `arg:"" help:"Plan UUID or slug."`
JSON bool `help:"Emit the next task as JSON instead of human-readable."`
}
```
### func \(\*PlanNextCmd\) [Run]()
```go
func (c *PlanNextCmd) Run(rc *runContext) error
```
## type [PlanShowCmd]()
PlanShowCmd implements \`plan show \\`.
```go
type PlanShowCmd struct {
IDOrSlug string `arg:"" help:"Plan UUID or slug."`
}
```
### func \(\*PlanShowCmd\) [Run]()
```go
func (c *PlanShowCmd) Run(rc *runContext) error
```
## type [RunCmd]()
RunCmd is \`radioactive\_ralph run \-\-variant X\`.
```go
type RunCmd struct {
Variant string `help:"Variant name (blue, grey, green, red, professor, fixit, immortal, savage, old-man, world-breaker)." required:""`
Detach bool `help:"Spawn the supervisor in a multiplexer pane and return immediately."`
Foreground bool `help:"Run in the foreground — invoked by launchd/systemd service units."`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
SpendCapUSD float64 `help:"Spend cap for variants that require one." name:"spend-cap-usd"`
ConfirmBurnBudget bool `help:"Confirmation gate for savage." name:"confirm-burn-budget"`
ConfirmNoMercy bool `help:"Confirmation gate for old-man." name:"confirm-no-mercy"`
ConfirmBurnEverything bool `help:"Confirmation gate for world-breaker." name:"confirm-burn-everything"`
// Fixit-only flags.
Advise bool `help:"(fixit only) Run in advisor mode: scan the codebase, write .radioactive-ralph/plans/-advisor.md, and sync the first durable DAG plan for this repo. Auto-enabled when no active plan exists for this repo."`
Topic string `help:"(fixit --advise only) Slug used for the output filename (plans/-advisor.md). Defaults to 'general'."`
Description string `help:"(fixit --advise only) Free-form operator goal. Overrides TOPIC.md. Passed verbatim to the Claude subprocess."`
AutoHandoff bool `help:"(fixit --advise only) When the recommendation has no tradeoffs, spawn the recommended variant as a follow-up run automatically."`
// Advisor refinement thresholds. Operators can also set these in
// .radioactive-ralph/config.toml under [variants.fixit].
MaxIterations int `help:"(fixit --advise only) Max refinement passes. Default 3."`
MinConfidence int `help:"(fixit --advise only) Confidence threshold for accepting a proposal without refinement. Default 70."`
PlanModel string `help:"(fixit --advise only) Claude model tier for planning. Default opus."`
PlanEffort string `help:"(fixit --advise only) Reasoning-effort level for planning (low/medium/high/max). Default high."`
}
```
### func \(\*RunCmd\) [Run]()
```go
func (c *RunCmd) Run(rc *runContext) error
```
Run launches the supervisor for the named variant.
## type [ServeCmd]()
ServeCmd is \`radioactive\_ralph serve \-\-mcp\`.
Claude Code spawns this as a stdio MCP server. One process = one Claude session; the binary remains the source of truth and the MCP layer is just the structured control plane.
```go
type ServeCmd struct {
MCP bool `help:"Required. Serve the MCP protocol."`
}
```
### func \(\*ServeCmd\) [Run]()
```go
func (c *ServeCmd) Run(rc *runContext) error
```
Run implements the kong\-dispatched serve command.
## type [ServiceCmd]()
ServiceCmd is \`radioactive\_ralph service \\`.
```go
type ServiceCmd struct {
Install ServiceInstallCmd `cmd:"" help:"Install a per-user service unit for a variant."`
Uninstall ServiceUninstallCmd `cmd:"" help:"Remove a per-user service unit."`
List ServiceListCmd `cmd:"" help:"List installed service units."`
Status ServiceStatusCmd `cmd:"" help:"Shell out to launchctl/systemctl for live service status."`
}
```
## type [ServiceInstallCmd]()
ServiceInstallCmd wires the service.Install filesystem operation.
```go
type ServiceInstallCmd struct {
Variant string `help:"Variant to install." required:""`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
RalphBin string `help:"Absolute path to the radioactive_ralph binary. Defaults to the currently-running executable." name:"radioactive_ralph-bin"`
ConfirmBurnBudget bool `help:"Confirmation gate for savage." name:"confirm-burn-budget"`
ConfirmNoMercy bool `help:"Confirmation gate for old-man." name:"confirm-no-mercy"`
ConfirmBurnEverything bool `help:"Confirmation gate for world-breaker." name:"confirm-burn-everything"`
Env []string `help:"KEY=VALUE env vars to inject into the service unit (repeatable)."`
}
```
### func \(\*ServiceInstallCmd\) [Run]()
```go
func (c *ServiceInstallCmd) Run(_ *runContext) error
```
Run installs the unit.
## type [ServiceListCmd]()
ServiceListCmd lists installed units.
```go
type ServiceListCmd struct{}
```
### func \(\*ServiceListCmd\) [Run]()
```go
func (c *ServiceListCmd) Run(_ *runContext) error
```
Run shells out to launchctl/systemctl to enumerate installed units. M2 implementation is simple: list the unit files under the per\-user config dir and report their presence. Status is available via the dedicated status subcommand.
## type [ServiceStatusCmd]()
ServiceStatusCmd invokes the platform service manager for live status.
```go
type ServiceStatusCmd struct {
Variant string `help:"Variant to query." required:""`
}
```
### func \(\*ServiceStatusCmd\) [Run]()
```go
func (c *ServiceStatusCmd) Run(_ *runContext) error
```
Run shells out to launchctl list / systemctl \-\-user status.
## type [ServiceUninstallCmd]()
ServiceUninstallCmd removes an installed unit.
```go
type ServiceUninstallCmd struct {
Variant string `help:"Variant to remove." required:""`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
}
```
### func \(\*ServiceUninstallCmd\) [Run]()
```go
func (c *ServiceUninstallCmd) Run(_ *runContext) error
```
Run removes the unit.
## type [StatusCmd]()
StatusCmd is \`radioactive\_ralph status \-\-variant X\`.
```go
type StatusCmd struct {
Variant string `help:"Variant to query." required:""`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
JSON bool `help:"Emit status as JSON instead of the default text table."`
}
```
### func \(\*StatusCmd\) [Run]()
```go
func (c *StatusCmd) Run(rc *runContext) error
```
Run dials the supervisor socket and prints the status reply.
## type [StopCmd]()
StopCmd is \`radioactive\_ralph stop \-\-variant X\`.
```go
type StopCmd struct {
Variant string `help:"Variant to stop." required:""`
RepoRoot string `help:"Repo root. Defaults to cwd." type:"path"`
}
```
### func \(\*StopCmd\) [Run]()
```go
func (c *StopCmd) Run(rc *runContext) error
```
Run asks the supervisor to shut down gracefully.
## type [SupervisorCmd]()
SupervisorCmd is the hidden \`radioactive\_ralph \_supervisor\` entry invoked by service wrappers \(launchd/systemd\). Human operators use \`radioactive\_ralph run\` instead — which, for now, simply calls through to the same logic. This command exists so the plist/systemd unit can target a stable, internal\-only name that won't get re\-pointed at a different code path by a future CLI refactor.
```go
type SupervisorCmd struct {
Variant string `help:"Variant." required:""`
RepoRoot string `help:"Repo root." type:"path" required:""`
}
```
### func \(\*SupervisorCmd\) [Run]()
```go
func (c *SupervisorCmd) Run(rc *runContext) error
```
Run boots a supervisor in the foreground.
Generated by [gomarkdoc]()