Skip to content

feat(cli): riskkernel init scaffolds a working starting point - #65

Merged
prashar32 merged 1 commit into
mainfrom
feat/init-command
Jun 5, 2026
Merged

feat(cli): riskkernel init scaffolds a working starting point#65
prashar32 merged 1 commit into
mainfrom
feat/init-command

Conversation

@prashar32

Copy link
Copy Markdown
Owner

What

riskkernel init [dir] scaffolds a working starting point so a new user goes from install to a running governed loop in one command — no hand-assembling a .env or an agent.

It writes (without overwriting anything that already exists):

  • .env — provider key, the default per-run budget, and the data dir where runs and crash-resume checkpoints live.
  • quickstart.py — a runnable, key-free governed loop that the governor stops at its budget.

…then prints the next steps (serve → install the SDK → python quickstart.py).

Details

  • Templates are embedded with go:embed, so the single binary carries them.
  • Safe to re-run: existing files are kept and reported, never clobbered.
  • Surfaced in the README binary-install block.

Verified

  • go test ./cmd/riskkernel — the scaffold (files, the expected config keys, a governed_run in the example) and the no-overwrite guarantee.
  • End to end: ran the scaffolded quickstart.py against a live daemon — steps 1–8 then loop_budget_exceeded (exit 0). gofmt + vet + full Go suite clean.

A new user with the binary had no zero-to-running on-ramp — they had to assemble a
.env and an agent by hand. `riskkernel init [dir]` now scaffolds both: a .env
(provider key, default budget, and the data dir where runs and crash-resume
checkpoints live) plus a runnable, key-free quickstart.py — a governed loop the
governor stops at its budget — then prints the next steps. It never overwrites an
existing file, so it's safe to re-run.

The templates are embedded with go:embed so the single binary carries them. Tests
cover the scaffold (files, the expected config keys, a governed_run in the example)
and the no-overwrite guarantee; verified end to end that the scaffolded
quickstart.py runs against the daemon and the governor caps the loop.
@prashar32
prashar32 merged commit 3c391d0 into main Jun 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant