Skip to main content

run_twiddle

Function run_twiddle 

Source
pub async fn run_twiddle(
    range: Option<&str>,
    model: Option<String>,
    dry_run: bool,
    repo_path: Option<&Path>,
) -> Result<TwiddleOutcome>
Expand description

Non-interactive core for omni-dev git commit message twiddle.

Shared by the CLI (wrapped by TwiddleCommand::execute for the interactive flow) and the MCP server. The MCP tool boundary is non-interactive, so this entry point forces --auto-apply semantics when dry_run is false and never opens an editor. When dry_run is true, proposed amendments are returned as YAML without being applied.

repo_path selects the repository to twiddle (None defaults to the current working directory). It is resolved once here and threaded explicitly into [run_twiddle_with_client], so git, context-discovery, AI-scratch, and amendment-apply paths anchor to the target repo without changing the process working directory.