Skip to main content

Module config_init

Module config_init 

Source
Expand description

outrig config init – interactive writer for the global config.

Walks the user through providers, models, and default-model, then writes a parseable + validated TOML file to the resolved global-config path. The file refuses to clobber an existing one without --force. Atomic writes go through tempfile::NamedTempFile::persist so an interrupted prompt never leaves a half-written config behind.

run constructs real terminal I/O; run_with is the test seam that takes an arbitrary PromptSource and target path.

Constants§

DOC_SYNC_FIELDS
Slice of every Field declared in this module, for prompt_doc_sync.rs.

Functions§

run
Public entry: resolve the path, pick a PromptSource via prompt::auto() (dialoguer on a TTY, line-based on piped stdin), and delegate to run_with. global_override plumbs the top-level --global-config flag into the same resolver [global_config_path] uses elsewhere.
run_with
Drives the interactive flow against an arbitrary PromptSource. The flow short-circuits on existing files when force == false so an accidental re-run doesn’t burn through prompts before bailing. hf is the HuggingFace tree-listing client used to discover GGUF files for mistralrs model-id configs; tests pass a stub.