get_tool_context

Function get_tool_context 

Source
pub fn get_tool_context() -> Result<ExecutionContext>
Expand description

Returns the live, immutable ToolContext for the current operation

Provides access to the execution context including repository state, changed files, and shared data between tools.

§Returns

A clone of the current execution context

§Example

use dx_forge::get_tool_context;

fn my_operation() -> anyhow::Result<()> {
    let ctx = get_tool_context()?;
    println!("Working in: {:?}", ctx.repo_root);
    Ok(())
}