Skip to main content

Module config

Module config 

Source
Expand description

Configuration file (Runfile) discovery and loading.

Structs§

MergeMetadata
Metadata about which runfiles were loaded during a merge.

Constants§

NO_RUNFILE_ERROR
Error message when no Runfile is found.

Functions§

ensure_mcp_output_dir
Compute (and memoize) the MCP output directory. Prefers env override, then Runfile dir, then temp.
find_project_runfile_path
Find the project Runfile path (searching upward from cwd). Returns None if no project Runfile is found (will not return ~/.runfile).
find_runfile_path
Find the path to the Runfile without loading its contents. Uses the same search logic as load_config(). Returns Some(path) if found, None otherwise.
get_custom_runfile_path
Get the custom runfile path if set
get_home_dir
Get the user’s home directory in a cross-platform way.
get_mcp_output_dir
Get the MCP output directory if set, otherwise derives it and memoizes
is_mcp_output_configured
Check if MCP output directory is configured or derivable (env or Runfile)
load_config
Search for a Runfile in the current directory or upwards, then fallback to ~/.runfile. Returns Some(content) if a file is found (even if empty), or None if no file exists.
load_config_or_exit
Load config or exit with an error message.
load_from_path
Load a Runfile from a specific path (file or directory) If path is a directory, looks for Runfile inside it Returns Some(content) if found, None otherwise
load_home_runfile
Load ~/.runfile from the user’s home directory. Returns Some(content) if found, or None otherwise.
load_merged_config
Load and merge both global (~/.runfile) and project (./Runfile) configurations. Returns the merged content with project functions taking precedence over global ones. Also returns metadata about which files were loaded.
set_custom_runfile_path
Set a custom runfile path for the current thread
set_mcp_output_dir
Set the MCP output directory for the current thread