diff --git a/src/cli.ts b/src/cli.ts index 1092089..0f6b389 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -92,7 +92,7 @@ program if (!branch && opts.print) { branch = branchFromPrompt(opts.print) } else if (!branch) { - console.error("Branch name or prompt is required.") + console.error("✖ Branch name or prompt is required.") process.exit(1) } else if (branch.includes(" ")) { // If the "branch" contains spaces, it's actually a prompt — derive the branch name @@ -104,7 +104,7 @@ program const existing = await state.getSession(root, branch) if (existing) { - console.error(`Session "${branch}" already exists. Use "sandlot open ${branch}" to re-enter it.`) + console.error(`✖ Session "${branch}" already exists. Use "sandlot open ${branch}" to re-enter it.`) process.exit(1) } @@ -166,7 +166,7 @@ program } if (sessions.length === 0) { - console.log("No active sessions.") + console.log("◆ No active sessions.") return } @@ -197,7 +197,7 @@ program const session = await state.getSession(root, branch) if (!session) { - console.error(`No session found for branch "${branch}".`) + console.error(`✖ No session found for branch "${branch}".`) process.exit(1) } @@ -234,19 +234,19 @@ const closeAction = async (branch: string) => { const worktreeAbs = session?.worktree ?? join(homedir(), '.sandlot', basename(root), branch) await git.removeWorktree(worktreeAbs, root) - .catch((e) => console.warn(`Failed to remove worktree: ${e.message}`)) + .catch((e) => console.warn(`⚠ Failed to remove worktree: ${e.message}`)) await unlink(join(root, '.sandlot', branch)) .catch(() => {}) // symlink may not exist await git.deleteLocalBranch(branch, root) - .catch((e) => console.warn(`Failed to delete branch ${branch}: ${e.message}`)) + .catch((e) => console.warn(`⚠ Failed to delete branch ${branch}: ${e.message}`)) if (session) { await state.removeSession(root, branch) } - console.log(`Closed session ${branch}`) + console.log(`✔ Closed session ${branch}`) } // ── sandlot merge ────────────────────────────────────────── @@ -261,13 +261,13 @@ program const conflicts = await git.merge(branch, root) if (conflicts.length === 0) { - console.log(`Merged ${branch} into current branch`) + console.log(`✔ Merged ${branch} into current branch`) await closeAction(branch) return } // Resolve conflicts with Claude - console.log(`Merge conflicts in ${conflicts.length} file(s). Resolving with Claude...`) + console.log(`◆ Merge conflicts in ${conflicts.length} file(s). Resolving with Claude...`) const spin = spinner("Starting container") try { @@ -328,7 +328,7 @@ program const root = await git.repoRoot() const session = await state.getSession(root, branch) if (!session) { - console.error(`No session found for branch "${branch}".`) + console.error(`✖ No session found for branch "${branch}".`) process.exit(1) } @@ -346,14 +346,14 @@ program const root = await git.repoRoot() const session = await state.getSession(root, branch) if (!session) { - console.error(`No session found for branch "${branch}".`) + console.error(`✖ No session found for branch "${branch}".`) process.exit(1) } // Check for uncommitted changes (staged + unstaged) const status = await $`git -C ${session.worktree} status --porcelain`.nothrow().quiet() if (status.exitCode !== 0) { - console.error("git status failed") + console.error("✖ git status failed") process.exit(1) } @@ -373,7 +373,7 @@ program const main = await git.mainBranch(root) const result = await $`git -C ${session.worktree} diff --color=always ${main}...${branch}`.nothrow().quiet() if (result.exitCode !== 0) { - console.error("git diff failed") + console.error("✖ git diff failed") process.exit(1) } diff = result.text() @@ -401,13 +401,13 @@ program const root = await git.repoRoot() const session = await state.getSession(root, branch) if (!session) { - console.error(`No session found for branch "${branch}".`) + console.error(`✖ No session found for branch "${branch}".`) process.exit(1) } const result = await $`git -C ${session.worktree} log main..HEAD`.nothrow() if (result.exitCode !== 0) { - console.error("git log failed") + console.error("✖ git log failed") process.exit(1) } }) @@ -422,7 +422,7 @@ program const root = await git.repoRoot() const session = await state.getSession(root, branch) if (!session) { - console.error(`No session found for branch "${branch}".`) + console.error(`✖ No session found for branch "${branch}".`) process.exit(1) } @@ -462,7 +462,7 @@ vmCmd .description("Stop the VM") .action(async () => { await vm.stop() - console.log("VM stopped") + console.log("✔ VM stopped") }) vmCmd @@ -470,10 +470,10 @@ vmCmd .description("Stop and delete the VM") .action(async () => { await vm.destroy() - console.log("VM destroyed") + console.log("✔ VM destroyed") }) program.parseAsync().catch((err) => { - console.error(err.message ?? err) + console.error(`✖ ${err.message ?? err}`) process.exit(1) }) diff --git a/src/vm.ts b/src/vm.ts index 1a62ca0..76f63b3 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -19,7 +19,7 @@ function containerPath(hostPath: string): string { function requireContainer(): void { if (!Bun.which("container")) { - console.error('Apple Container is not installed. Install it with: brew install container') + console.error('✖ Apple Container is not installed. Install it with: brew install container') process.exit(1) } }