onboarding

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package onboarding tracks whether the first-run setup wizard has been completed — a small, versioned marker so a future wizard redesign can force existing installs through it again (bump currentVersion), while a completed install on the current version never sees it uninvited.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(s State) error

Save persists a fully completed wizard state. It is only called after the user confirms the final Ready step, never merely because Stage 1 produced a usable gateway configuration.

func SaveProgress added in v0.2.5

func SaveProgress(s State) error

SaveProgress persists the choices needed to resume/re-run setup while deliberately leaving Completed false. Stage 1 uses this before the daemon starts; if the user exits during Stage 2, the next launch therefore opens setup again instead of mistaking a half-finished wizard for a completed one.

Types

type State

type State struct {
	Version       int    `json:"version"`
	Completed     bool   `json:"completed"`
	ProjectsRoot  string `json:"projects_root,omitempty"`
	LastWorkspace string `json:"last_workspace,omitempty"`
}

State is what persists across runs about the first-run wizard. ProjectsRoot and LastWorkspace are seed data for a future "projects root + picker" launcher (see DECISIONS.md) — Kram doesn't read them for anything today beyond pre-filling the wizard's own defaults.

func Load

func Load() (State, error)

Load reads the onboarding state file (kramhome.Path("onboarding.json")), or returns a zero State (NeedsSetup() == true) if it doesn't exist yet — a missing file is the normal first-run state, not an error.

func (State) NeedsSetup

func (s State) NeedsSetup() bool

NeedsSetup reports whether the wizard should run: never completed, or completed against an older wizard version than this build knows about.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL