Skip to main content

Module tutorial

Module tutorial 

Source
Expand description

tutorial — data and introspection for the interactive tutorial.

The interactive driver lives in dodot-cli; this module provides the building blocks it composes: pack classification, shell- integration detection (read-only inspection plus an explicit append helper), JSON state persistence for resume, and the serializable TutorialCtx that the CLI passes to step templates. Reads are pure; writes (append_shell_integration, save_state, clear_state) only run on explicit user consent from the driver.

Structs§

ShellIntegration
What we found out about the eval "$(dodot init-sh)" line.
TutorialCtx
Serializable context passed to step templates. The CLI driver mutates this between steps; templates read fields by name.
TutorialPack
Summary line for one pack as shown in the tutorial.
TutorialState
Persisted between tutorial invocations so users can resume.

Enums§

PackKind
Coarse categorisation of a pack used by the tutorial to pick a good starter. Names match human prose: “config-only” / “shell” / “install”.

Functions§

append_shell_integration
Append the eval line to the user’s rc file with a header comment. Idempotent: returns Ok without writing if the line is already there.
classify_pack
Classify a pack by inspecting its top-level files.
clear_state
detect_shell_integration
Detect the shell init situation for the user.
discover_and_classify
Discover packs in the active context and classify each one.
load_state
save_state
state_path
Path where tutorial state is stored.