refactor yaak-cli phase 1 command architecture

This commit is contained in:
Gregory Schier
2026-02-16 06:59:23 -08:00
parent 8023603ebe
commit 26e145942a
8 changed files with 615 additions and 394 deletions

View File

@@ -0,0 +1,19 @@
use crate::cli::{WorkspaceArgs, WorkspaceCommands};
use crate::context::CliContext;
pub fn run(ctx: &CliContext, args: WorkspaceArgs) {
match args.command {
WorkspaceCommands::List => list(ctx),
}
}
fn list(ctx: &CliContext) {
let workspaces = ctx.db().list_workspaces().expect("Failed to list workspaces");
if workspaces.is_empty() {
println!("No workspaces found");
} else {
for workspace in workspaces {
println!("{} - {}", workspace.id, workspace.name);
}
}
}