From b9972e8e01500a4f27d36e32cbfb3b4898f8648c Mon Sep 17 00:00:00 2001 From: Shivendra Mishra Date: Sat, 22 Nov 2025 12:19:41 +0530 Subject: [PATCH 1/2] feat(cli): add --runbook-input flag to surfpool start Signed-off-by: Shivendra Mishra --- crates/cli/src/cli/mod.rs | 3 +++ crates/cli/src/cli/simnet/mod.rs | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/cli/src/cli/mod.rs b/crates/cli/src/cli/mod.rs index 7b558c43..f686f0ab 100644 --- a/crates/cli/src/cli/mod.rs +++ b/crates/cli/src/cli/mod.rs @@ -237,6 +237,9 @@ pub struct StartSimnet { /// Enable all SVM features (override mainnet defaults which are used by default) #[clap(long = "features-all", action=ArgAction::SetTrue, default_value = "false")] pub all_features: bool, + /// A set of inputs to use for the runbook (eg. surfpool start --runbook-input myInputs.json) + #[arg(long = "runbook-input", short = 'i', default_value = "./txtx.yml")] + pub runbook_input: Vec, } fn parse_svm_feature(s: &str) -> Result { diff --git a/crates/cli/src/cli/simnet/mod.rs b/crates/cli/src/cli/simnet/mod.rs index 5369d578..d6b41ef2 100644 --- a/crates/cli/src/cli/simnet/mod.rs +++ b/crates/cli/src/cli/simnet/mod.rs @@ -469,6 +469,7 @@ async fn write_and_execute_iac( } } + let input_location = cmd.runbook_input.clone(); // Is infrastructure-as-code (IaC) already setup? let base_location = FileLocation::from_path_string(&cmd.manifest_path)?.get_parent_location()?; @@ -510,6 +511,7 @@ async fn write_and_execute_iac( simnet_events_tx, &on_disk_runbook_data, &in_memory_runbook_data, + &input_location, ); let simnet_events_tx = simnet_events_tx.clone(); @@ -523,6 +525,7 @@ async fn write_and_execute_iac( if cmd.watch { let _handle = hiro_system_kit::thread_named("Watch Filesystem") .spawn(move || { + let input_location = input_location.clone(); let mut target_path = base_location.clone(); let _ = target_path.append_path("target"); let _ = target_path.append_path("deploy"); @@ -571,6 +574,7 @@ async fn write_and_execute_iac( &simnet_events_tx, &on_disk_runbook_data, &in_memory_runbook_data, + &input_location, ); let _ = hiro_system_kit::nestable_block_on(join_all(futures)); @@ -588,6 +592,7 @@ fn assemble_runbook_execution_futures( simnet_events_tx: &Sender, on_disk_runbook_data: &Option<(FileLocation, Vec)>, in_memory_runbook_data: &Option<(String, RunbookSources, WorkspaceManifest)>, + input_location: &Vec, ) -> Vec> + Send>>> { let mut futures: Vec< std::pin::Pin> + Send>>, @@ -619,8 +624,12 @@ fn assemble_runbook_execution_futures( futures.push(Box::pin(execute_on_disk_runbook( progress_tx.clone(), simnet_events_tx_copy.clone(), - ExecuteRunbook::default_localnet(&runbook_id_owned) - .with_manifest_path(file_location_owned.to_string()), + { + let mut ec = ExecuteRunbook::default_localnet(&runbook_id_owned) + .with_manifest_path(file_location_owned.to_string()); + ec.inputs = input_location.clone(); + ec + }, do_setup_logger, ))); } From 81b247364489b7ecd11c6fff76fd89ced1de73af Mon Sep 17 00:00:00 2001 From: Shivendra Mishra Date: Wed, 26 Nov 2025 14:53:15 +0530 Subject: [PATCH 2/2] fix: variable name changes --- crates/cli/src/cli/simnet/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/cli/src/cli/simnet/mod.rs b/crates/cli/src/cli/simnet/mod.rs index d6b41ef2..012ebce1 100644 --- a/crates/cli/src/cli/simnet/mod.rs +++ b/crates/cli/src/cli/simnet/mod.rs @@ -469,7 +469,7 @@ async fn write_and_execute_iac( } } - let input_location = cmd.runbook_input.clone(); + let runbook_input = cmd.runbook_input.clone(); // Is infrastructure-as-code (IaC) already setup? let base_location = FileLocation::from_path_string(&cmd.manifest_path)?.get_parent_location()?; @@ -511,7 +511,7 @@ async fn write_and_execute_iac( simnet_events_tx, &on_disk_runbook_data, &in_memory_runbook_data, - &input_location, + &runbook_input, ); let simnet_events_tx = simnet_events_tx.clone(); @@ -525,7 +525,7 @@ async fn write_and_execute_iac( if cmd.watch { let _handle = hiro_system_kit::thread_named("Watch Filesystem") .spawn(move || { - let input_location = input_location.clone(); + let runbook_input = runbook_input.clone(); let mut target_path = base_location.clone(); let _ = target_path.append_path("target"); let _ = target_path.append_path("deploy"); @@ -574,7 +574,7 @@ async fn write_and_execute_iac( &simnet_events_tx, &on_disk_runbook_data, &in_memory_runbook_data, - &input_location, + &runbook_input, ); let _ = hiro_system_kit::nestable_block_on(join_all(futures)); @@ -592,7 +592,7 @@ fn assemble_runbook_execution_futures( simnet_events_tx: &Sender, on_disk_runbook_data: &Option<(FileLocation, Vec)>, in_memory_runbook_data: &Option<(String, RunbookSources, WorkspaceManifest)>, - input_location: &Vec, + runbook_input: &Vec, ) -> Vec> + Send>>> { let mut futures: Vec< std::pin::Pin> + Send>>, @@ -627,7 +627,7 @@ fn assemble_runbook_execution_futures( { let mut ec = ExecuteRunbook::default_localnet(&runbook_id_owned) .with_manifest_path(file_location_owned.to_string()); - ec.inputs = input_location.clone(); + ec.inputs = runbook_input.clone(); ec }, do_setup_logger,