initcmd

import "github.com/jbcom/radioactive-ralph/internal/initcmd"

Package initcmd implements `radioactive_ralph init` — the per-repo setup wizard.

Responsibilities:

  1. Write .radioactive-ralph/config.toml (committed) and local.toml (gitignored) with provider/service defaults.

  2. Scaffold .radioactive-ralph/plans/ with a starter index.md so non-Fixit variants have the plans structure they refuse to run without.

  3. Append .radioactive-ralph/local.toml to the repo’s .gitignore.

  4. Refuse to clobber an existing config unless Force is true; support –refresh to preserve prior provider/service/variant settings while rewriting the file layout.

Index

type Options

Options drives Init.

type Options struct {
    // RepoRoot is the absolute path to the operator's repo. The
    // .radioactive-ralph/ tree is created directly under it.
    RepoRoot string

    // Force overwrites an existing config.toml. Without this, Init
    // refuses to clobber prior operator work.
    Force bool

    // Refresh rewrites config.toml from scratch but preserves existing
    // operator choices from any prior config.toml that loaded cleanly.
    Refresh bool
}

type Result

Result summarizes what Init did.

type Result struct {
    ConfigPath string
    LocalPath  string
    PlansPath  string
    GitIgnore  string
}

func Init

func Init(opts Options) (Result, error)

Init runs the wizard against Options. Returns a Result describing the paths it touched and the resolved choices.

Generated by gomarkdoc