Documentation
¶
Overview ¶
Package setup installs Volcano agent skills/plugins into the coding-agent harnesses present on the machine. With no targeting flags it autodetects the installed harnesses, installs into each, and returns a per-harness report; when none are detected it falls back to a manual install under ~/.volcano.
Index ¶
Constants ¶
const ( FlameHex = "#f54019" // lava flame: key hints (space/enter/esc) LavaHex = "#f37a58" // lava-500 brand primary: titles, main lines, CTA VolcanoHex = "#f97316" // volcano-500: options — selectors, checkboxes, marks )
The Volcano CLI palette, taken from volcano-web. Shared by the interactive picker and the report so the CLI keeps one color identity across both.
Variables ¶
This section is empty.
Functions ¶
func RenderReport ¶
RenderReport writes a human-readable per-harness summary to w. The footer is derived from the actual result statuses, so a dry run says "would install" and only a genuine no-detection fallback claims none was detected.
func RenderReportString ¶ added in v0.9.0
RenderReportString returns the same report as a string, colored when on is true regardless of the destination. RenderReport uses it for direct output; the interactive completion animation uses it to reveal the identical content line by line, so the animated finish mirrors the non-interactive report.
Types ¶
type CommandRunner ¶
type CommandRunner interface {
Run(ctx context.Context, name string, args ...string) ([]byte, error)
}
CommandRunner runs an external command (used for marketplace-based installs). Production uses the package's execRunner; tests inject a fake. runtime.Deps has no general-purpose runner to reuse (only Local/Update/Git), so setup owns its default rather than wiring one through the CLI.
type Detected ¶ added in v0.9.0
Detected is one harness present on the machine, with whether Volcano is already installed into it, so an interactive picker can label each option with the same status vocabulary the non-interactive report uses.
func Detect ¶ added in v0.9.0
Detect returns the coding-agent harnesses present on this machine, in the same order Run would install them, each flagged with whether Volcano is already installed. It performs detection only — no install, no network — so an interactive front-end can seed a selection prompt before anything is written.
func (Detected) StatusMark ¶ added in v0.9.0
StatusMark returns the picker's install-state mark for a detected harness. The picker describes install *state* (pick what to set up), so it uses [installed]/[available] rather than the report's outcome marks ([ok]/[detected]): clearer here, and it avoids colliding with the report's [detected], which there means "install failed", not "not yet installed". Both marks are 11 columns wide, so options align without padding. The caller colors the mark and leaves the harness name in the terminal's default foreground.
type HTTPDoer ¶
HTTPDoer is the subset of *http.Client used to fetch skill content. It is satisfied by both http.DefaultClient and apiclient.HttpRequestDoer.
type Options ¶
type Options struct {
HTTPDoer HTTPDoer // skills fetch; default http.DefaultClient
CommandRunner CommandRunner // marketplace shell-out; default os/exec
SkillsBaseURL string // skills source; default the volcano-skills GitHub raw base (tests inject a mock)
HomeDir string // default os.UserHomeDir()
Getenv func(string) string // default os.Getenv
LookPath func(string) (string, error) // default exec.LookPath
Only []string // explicit --harness targets (bypasses autodetect)
BestEffort bool // downgrade Only-target install failures to detected (interactive default); --harness stays strict
Manual bool // force the ~/.volcano fallback
DryRun bool // report the plan without writing
}
Options configures Run. Zero-value fields default to real implementations, so production callers can pass an empty Options; tests inject fakes.
type Report ¶
type Report struct {
Results []Result
// ManualFallback is true only when no harness was detected and setup fell
// back to ~/.volcano. An explicit --manual (or --harness manual) produces a
// "manual" result but leaves this false: it was requested, not a fallback.
ManualFallback bool
}
Report is the full setup outcome.
func Run ¶
Run detects/targets harnesses and installs Volcano into each. It returns an error only for setup-wide problems (e.g. an unknown --harness). Autodetect is best-effort: a detected harness whose install fails is reported as detected (not installed) rather than failed. Only an explicit --harness target records a failure — inspect Report.Failed.
type Status ¶
type Status string
Status is the outcome for one harness.
const ( // StatusInstalled means the harness was set up successfully. StatusInstalled Status = "installed" // StatusDetected means the harness was found on the machine but its install // didn't complete (autodetect best-effort, not a command failure). StatusDetected Status = "detected" // StatusSkipped means the harness was not detected on this machine. StatusSkipped Status = "skipped" // StatusFailed means the harness was targeted but its install failed. StatusFailed Status = "failed" // StatusPlanned is a dry-run entry: what would be installed. StatusPlanned Status = "planned" )