Diagnostics (#5323)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-10-22 14:25:49 -04:00
committed by GitHub
parent fdbd5281e2
commit 755e9f893d
16 changed files with 450 additions and 34 deletions
+15 -1
View File
@@ -135,7 +135,7 @@ enum SessionCommand {
#[arg(short, long, help = "Regex for removing matched sessions (optional)")]
regex: Option<String>,
},
#[command(about = "Export a session to Markdown format")]
#[command(about = "Export a session")]
Export {
#[command(flatten)]
identifier: Option<Identifier>,
@@ -156,6 +156,16 @@ enum SessionCommand {
)]
format: String,
},
#[command(name = "diagnostics")]
Diagnostics {
/// Session ID to generate diagnostics for
#[arg(short, long)]
session_id: String,
/// Output path for the diagnostics zip file (optional, defaults to current directory)
#[arg(short, long)]
output: Option<PathBuf>,
},
}
#[derive(Subcommand, Debug)]
@@ -847,6 +857,10 @@ pub async fn cli() -> Result<()> {
.await?;
Ok(())
}
Some(SessionCommand::Diagnostics { session_id, output }) => {
crate::commands::session::handle_diagnostics(&session_id, output).await?;
Ok(())
}
None => {
let session_start = std::time::Instant::now();
let session_type = if resume { "resumed" } else { "new" };