From d5bab693675dc4b0068de31d42db38425f09473c Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 19 Feb 2026 11:21:03 -0800 Subject: [PATCH] add `dir` command to print worktree path for a session --- src/cli.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index 68065aa..5b0c03c 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -399,6 +399,23 @@ program } }) +// ── sandlot dir ──────────────────────────────────────────── + +program + .command("dir") + .argument("", "branch name") + .description("Print the worktree path for a session") + .action(async (branch: string) => { + const root = await git.repoRoot() + const session = await state.getSession(root, branch) + if (!session) { + console.error(`No session found for branch "${branch}".`) + process.exit(1) + } + + process.stdout.write(session.worktree + "\n") + }) + // ── sandlot vm ─────────────────────────────────────────────────────── const vmCmd = program.command("vm").description("Manage the sandlot VM")