From 6e8dc2e8669288d56a0fb9ddbd038d1ec61ac6a3 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Tue, 20 Jan 2026 21:36:48 +0530 Subject: [PATCH] Add template processing to /run command Apply the same {{var}} template variable injection to prompts loaded via the /run command in interactive mode. --- crates/g3-cli/src/commands.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/g3-cli/src/commands.rs b/crates/g3-cli/src/commands.rs index e8ce771..cb2d91f 100644 --- a/crates/g3-cli/src/commands.rs +++ b/crates/g3-cli/src/commands.rs @@ -11,6 +11,7 @@ use g3_core::Agent; use crate::completion::G3Helper; use crate::g3_status::{G3Status, Status}; use crate::simple_output::SimpleOutput; +use crate::template::process_template; use crate::task_execution::execute_task_with_retry; /// Handle a control command. Returns true if the command was handled and the loop should continue. @@ -142,7 +143,8 @@ pub async fn handle_command( }; match std::fs::read_to_string(&expanded_path) { Ok(content) => { - let prompt = content.trim(); + let processed = process_template(&content); + let prompt = processed.trim(); if prompt.is_empty() { output.print("❌ File is empty."); } else {