From 970ed0895f0557113220c25f1f1b5ffdcb43f3b6 Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Tue, 31 Mar 2026 10:00:52 -0700 Subject: [PATCH] feat(claudbg-ltt0): sessions with no subcommand defaults to list Co-Authored-By: Claude Sonnet 4.6 --- ...essions-no-sub-command-defaults-to-sessions-list.md | 10 ++++++++++ src/cli.rs | 5 +++-- src/main.rs | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .beans/claudbg-ltt0--sessions-no-sub-command-defaults-to-sessions-list.md diff --git a/.beans/claudbg-ltt0--sessions-no-sub-command-defaults-to-sessions-list.md b/.beans/claudbg-ltt0--sessions-no-sub-command-defaults-to-sessions-list.md new file mode 100644 index 0000000..c783240 --- /dev/null +++ b/.beans/claudbg-ltt0--sessions-no-sub-command-defaults-to-sessions-list.md @@ -0,0 +1,10 @@ +--- +# claudbg-ltt0 +title: 'sessions: no sub-command defaults to sessions list' +status: todo +type: feature +created_at: 2026-03-31T00:32:35Z +updated_at: 2026-03-31T00:32:35Z +--- + +Running `claudbg sessions` with no sub-command should behave identically to `claudbg sessions list`. Note: `claudbg agents` does NOT get this treatment since agents list requires a session ID. diff --git a/src/cli.rs b/src/cli.rs index 17e89f6..5615c95 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -82,10 +82,11 @@ pub struct GlobalOpts { #[derive(Debug, clap::Subcommand)] pub enum Commands { /// List, dump, and transcribe sessions. + #[command(subcommand_required = false)] Sessions { - /// Sessions subcommand. + /// Sessions subcommand (defaults to `list` when omitted). #[command(subcommand)] - cmd: SessionsCmd, + cmd: Option, }, /// List, dump, and transcribe sub-agent runs. Agents { diff --git a/src/main.rs b/src/main.rs index df5051b..1fcb697 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use claudbg::error::Result; async fn main() -> Result<()> { let cli = Cli::parse(); match cli.command { - Commands::Sessions { cmd } => match cmd { + Commands::Sessions { cmd } => match cmd.unwrap_or(SessionsCmd::List) { SessionsCmd::List => claudbg::commands::sessions::list(&cli.global).await?, SessionsCmd::Dump { id, follow } => { claudbg::commands::sessions::dump(&id, follow, &cli.global).await?