feat(claudbg-ltt0): sessions with no subcommand defaults to list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Elijah Voigt 2 months ago
parent 7f864192e8
commit 970ed0895f

@ -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.

@ -82,10 +82,11 @@ pub struct GlobalOpts {
#[derive(Debug, clap::Subcommand)] #[derive(Debug, clap::Subcommand)]
pub enum Commands { pub enum Commands {
/// List, dump, and transcribe sessions. /// List, dump, and transcribe sessions.
#[command(subcommand_required = false)]
Sessions { Sessions {
/// Sessions subcommand. /// Sessions subcommand (defaults to `list` when omitted).
#[command(subcommand)] #[command(subcommand)]
cmd: SessionsCmd, cmd: Option<SessionsCmd>,
}, },
/// List, dump, and transcribe sub-agent runs. /// List, dump, and transcribe sub-agent runs.
Agents { Agents {

@ -8,7 +8,7 @@ use claudbg::error::Result;
async fn main() -> Result<()> { async fn main() -> Result<()> {
let cli = Cli::parse(); let cli = Cli::parse();
match cli.command { 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::List => claudbg::commands::sessions::list(&cli.global).await?,
SessionsCmd::Dump { id, follow } => { SessionsCmd::Dump { id, follow } => {
claudbg::commands::sessions::dump(&id, follow, &cli.global).await? claudbg::commands::sessions::dump(&id, follow, &cli.global).await?

Loading…
Cancel
Save