feat: add --output-format json flag to goose run command (#5525)

Signed-off-by: sheikhlimon <sheikhlimon404@gmail.com>
Signed-off-by: Sheikh Limon <sheikhlimon404@gmail.com>
This commit is contained in:
Sheikh Limon
2025-11-04 22:33:17 +06:00
committed by GitHub
parent 5b93ee587f
commit d4a7bd39be
5 changed files with 131 additions and 11 deletions
+14
View File
@@ -720,6 +720,16 @@ enum Command {
)]
additional_sub_recipes: Vec<String>,
/// Output format (text, json)
#[arg(
long = "output-format",
value_name = "FORMAT",
help = "Output format (text, json)",
default_value = "text",
value_parser = clap::builder::PossibleValuesParser::new(["text", "json"])
)]
output_format: String,
/// Provider to use for this run (overrides environment variable)
#[arg(
long = "provider",
@@ -974,6 +984,7 @@ pub async fn cli() -> anyhow::Result<()> {
sub_recipes: None,
final_output_response: None,
retry_config: None,
output_format: "text".to_string(),
})
.await;
@@ -1054,6 +1065,7 @@ pub async fn cli() -> anyhow::Result<()> {
scheduled_job_id,
quiet,
additional_sub_recipes,
output_format,
provider,
model,
}) => {
@@ -1183,6 +1195,7 @@ pub async fn cli() -> anyhow::Result<()> {
.as_ref()
.and_then(|r| r.final_output_response.clone()),
retry_config: recipe_info.as_ref().and_then(|r| r.retry_config.clone()),
output_format,
})
.await;
@@ -1366,6 +1379,7 @@ pub async fn cli() -> anyhow::Result<()> {
sub_recipes: None,
final_output_response: None,
retry_config: None,
output_format: "text".to_string(),
})
.await;
session.interactive(None).await?;