Expand description
Per-invocation command context.
CommandContext is the single dependency handed to command handlers: the
resolved CliConfig, the EnvOverrides snapshot, the active
Prompter, and lazy access to the runtime. The runtime is resolved on
first use — --database-url invocations carry a DatabaseContext and
refuse to boot the full AppContext; profile-driven invocations boot the
AppContext once and share it across the command. Tests construct the
context with CommandContext::with_app_context or
CommandContext::with_database and a scripted prompter, so no handler
needs process-global state.
Copyright (c) systemprompt.io — Business Source License 1.1. See https://systemprompt.io for licensing details.