xonecas.io
64875
Mc

mini-coder / commit a8a7183

refactor(cli): simplify shell and status output

xonecas2026-03-15 a8a71831151027db1077ad7fa25a3e62530c3fa3 parent 5e01dab

7 files changed

TODO.md+2−1
@@ -1,7 +1,8 @@
11 # TODO
22
3-- Reasoning blocks should use our colors library for italic styling.
43 - Assistant responses are no longer rendered with highlighted markdown syntax. It's just plain text with no coloring. Let's condider markdown rendering libraries and their performance costs and completly rethink our approach. We want to keep our fast output above all, even if that means no markdown rendering.
4+- Investigate using tmux to allow agents to use mc from a users perspective
5+- Follow up on the recent CLI simplification pass: interactive `!cmd` now logs the command first, streamed shell results no longer duplicate stdout in summaries, and the status bar prioritizes session identity over cwd. Keep pushing this direction across the remaining UI surface.
56
67 ---
78
src/cli/input-loop.ts+4−0
@@ -10,6 +10,7 @@ import { createGitBranchCache } from "./git-branch-cache.ts";
1010 import { type InputResult, readline } from "./input.ts";
1111 import { renderUserMessage, tildePath } from "./output.ts";
1212 import { buildStatusBarSignature } from "./status-bar.ts";
13+import { buildToolCallLine } from "./tool-render.ts";
1314
1415 import type { CommandContext } from "./types.ts";
1516
@@ -94,6 +95,9 @@ export async function runInputLoop(opts: InputLoopOptions): Promise<void> {
9495 }
9596
9697 case "shell": {
98+ reporter.writeText(
99+ ` ${buildToolCallLine("shell", { command: input.command })}`,
100+ );
97101 const out = await runShellPassthrough(input.command, cwd, reporter);
98102 if (out) {
99103 runner.addShellContext(input.command, out);
src/cli/live-reasoning.ts+1−4
@@ -1,11 +1,8 @@
11 import * as c from "yoctocolors";
22 import { G, write, writeln } from "./output.ts";
33
4-const ITALIC_ON = "\x1b[3m";
5-const ITALIC_OFF = "\x1b[23m";
6-
74 function styleReasoningText(text: string): string {
8- return `${ITALIC_ON}${c.dim(text)}${ITALIC_OFF}`;
5+ return c.italic(c.dim(text));
96 }
107
118 export class LiveReasoningBlock {
src/cli/status-bar.test.ts+4−3
@@ -41,10 +41,11 @@ describe("renderStatusBar", () => {
4141
4242 const line = stripAnsi(stdout).trim();
4343 expect(line).toContain("gpt-5.3-codex");
44- expect(line).toContain("~/src/mini-coder");
44+ expect(line).toContain("#12345678");
4545 expect(line).toContain("@general");
4646 expect(line).toContain("tok 1.2k/3.4k");
4747 expect(line).toContain("ctx 8.0k/128.0k");
48+ expect(line).toContain("~/src/mini-coder");
4849 expect(line).not.toContain("reasoning");
4950 });
5051
@@ -72,8 +73,8 @@ describe("renderStatusBar", () => {
7273
7374 const line = stripAnsi(stdout).trim();
7475 expect(line).toContain("gpt-5.3-codex");
75- expect(line).toContain("~/src/");
76- expect(line).not.toContain("#abcdef12");
76+ expect(line).toContain("#abcdef12");
77+ expect(line).not.toContain("~/src/");
7778 expect(line).not.toContain("ctx 72.0k");
7879 });
7980
src/cli/status-bar.ts+7−4
@@ -92,14 +92,17 @@ function fitStatusSegments(
9292
9393 export function renderStatusBar(opts: StatusBarData): void {
9494 const cols = Math.max(20, terminal.stdoutColumns || 80);
95- const required = [c.cyan(opts.model), c.dim(opts.cwd)];
95+ const required = [
96+ c.cyan(opts.model),
97+ c.dim(`#${opts.sessionId.slice(0, 8)}`),
98+ ];
9699 const optional: string[] = [];
97100
98- if (opts.activeAgent) optional.push(c.green(`@${opts.activeAgent}`));
99- if (opts.thinkingEffort) optional.push(c.dim(`✦ ${opts.thinkingEffort}`));
100101 if (opts.provider && opts.provider !== "zen") {
101102 optional.push(c.dim(opts.provider));
102103 }
104+ if (opts.activeAgent) optional.push(c.green(`@${opts.activeAgent}`));
105+ if (opts.thinkingEffort) optional.push(c.dim(`✦ ${opts.thinkingEffort}`));
103106 if (opts.gitBranch) optional.push(c.dim(`⎇ ${opts.gitBranch}`));
104107
105108 if (opts.inputTokens > 0 || opts.outputTokens > 0) {
@@ -116,7 +119,7 @@ export function renderStatusBar(opts: StatusBarData): void {
116119 });
117120 if (contextSegment) optional.push(contextSegment);
118121
119- optional.push(c.dim(`#${opts.sessionId.slice(0, 8)}`));
122+ optional.push(c.dim(opts.cwd));
120123
121124 const out = fitStatusSegments(required, optional, cols);
122125 terminal.stdoutWrite(`${out}\n`);
src/cli/tool-render.test.ts+23−0
@@ -76,6 +76,29 @@ describe("renderToolResult", () => {
7676 expect(plain).not.toContain("│ boom");
7777 });
7878
79+ test("does not repeat successful single-line stdout when it was streamed live", () => {
80+ captureStdout();
81+
82+ renderToolResult(
83+ "shell",
84+ {
85+ stdout: "done",
86+ stderr: "",
87+ exitCode: 0,
88+ success: true,
89+ timedOut: false,
90+ streamedOutput: true,
91+ },
92+ false,
93+ );
94+
95+ const plain = stripAnsi(stdout);
96+ expect(plain).toContain(
97+ "success exit 0 · stdout 1L · stderr 0L · streamed",
98+ );
99+ expect(plain).not.toContain("out: done");
100+ });
101+
79102 test("renders compact listSkills previews", () => {
80103 captureStdout();
81104
src/cli/tool-result-renderers.ts+1−0
@@ -65,6 +65,7 @@ function renderShellResult(result: unknown): boolean {
6565 if (
6666 r.success &&
6767 !r.timedOut &&
68+ !r.streamedOutput &&
6869 stderrLines === 0 &&
6970 stdoutSingleLine !== null &&
7071 stdoutSingleLine.length > 0