Expand description
The REPL module exists to own interactive shell behavior that the ordinary CLI host should not know about.
The layering here is intentional:
engineowns the line editor boundary, prompt rendering, history picker/completion adapters, and debug surfaces.dispatchowns command execution and shell-scope behavior once a line has been accepted.completionshapes the live command catalog into REPL-aware completion trees.presentationowns prompt appearance and intro/help material that is specific to interactive use.
When debugging the REPL, first decide whether the issue is editor/runtime state, dispatch semantics, or rendering. That is usually enough to choose the right submodule.
Contract:
- this module may depend on editor/runtime adapters, completion, UI, and dispatch code
- it should not become the owner of generic command execution rules, config resolution, or non-interactive CLI parsing
Public API shape:
- debug snapshots and other semantic payloads stay direct and cheap to read
- host-style REPL configuration flows through concrete builders and
factories such as
crate::repl::ReplRunConfig::builder,crate::repl::ReplAppearance::builder, andcrate::repl::HistoryConfig::builder - guided REPL configuration follows the crate-wide naming rule:
new(...)for exact constructors,builder(...)for staged configuration,with_*setters, andbuild()as the terminal step
Structs§
- Completion
Debug - Snapshot of completion/menu state for a given line and cursor position.
- Completion
Debug Frame - One frame from a stepped completion-debug session.
- Completion
Debug Match - One rendered completion entry in the debug surface.
- Completion
Debug Options - Rendering and capture options for completion-debug helpers.
- Highlight
Debug Span - Debug-friendly view of one highlighted span in the REPL line.
- History
Config - Configuration for REPL history persistence, visibility, and shell scoping.
- History
Config Builder - Builder for
HistoryConfig. - History
Entry - Visible history entry returned by listing operations after scope filtering.
- History
Shell Context - Shared shell-prefix state used to scope history to nested shell integrations.
- Line
Projection - Pre-processed editor input used for completion and highlighting.
- Repl
Appearance - Style overrides for REPL-only completion and highlighting chrome.
- Repl
Appearance Builder - Builder for
ReplAppearance. - Repl
Prompt - Static prompt text shown by the interactive editor.
- Repl
RunConfig - Editor-host configuration for one REPL run.
- Repl
RunConfig Builder - Builder for
ReplRunConfig. - Shared
History - Thread-safe facade over the REPL history store.
Enums§
- Debug
Step - Synthetic editor action used by completion-debug stepping.
- Repl
Input Mode - Selects how aggressively the REPL should use the interactive line editor.
- Repl
Line Result - Outcome of executing one submitted REPL line.
- Repl
Reload Kind - Controls how a command-triggered REPL restart should be presented.
- Repl
RunResult - Outcome of one
run_replsession.
Functions§
- color_
from_ style_ spec - Parses a REPL style string and extracts a terminal color.
- debug_
completion - Builds a single completion-debug snapshot for
lineatcursor. - debug_
completion_ steps - Replays a sequence of synthetic editor actions and captures each frame.
- debug_
highlight - Classifies a REPL line and returns serializable highlight spans for debugging tools.
- debug_
history_ menu - Builds a single history-menu debug snapshot for
lineatcursor. - debug_
history_ menu_ steps - Replays synthetic editor actions for the history menu and captures each frame.
- default_
pipe_ verbs - Returns the default DSL verbs exposed after
|in the REPL. - run_
repl - Runs the interactive REPL and delegates submitted lines to
execute.
Type Aliases§
- Line
Projector - Projects a raw editor line into the view used by completion/highlighting.
- Prompt
Right Renderer - Lazily renders the right-hand prompt for a REPL frame.