Skip to content

Commit 06c0426

Browse files
feat: revamp ArrowCode into a premium, minimalist, terminal-overtaking agent
- Configures the terminal's alternate screen buffer to cleanly overtake the terminal canvas, hiding previous command history on start and restoring it cleanly on exit or SIGINT. - Creates an immersive, beautiful minimal Startup screen matching premium standards with navigation hotkeys (Ctrl+W, Ctrl+S, Ctrl+Q) and cursor-selectable options. - Transitions sessions into a pristine, unified chat thread with simplified, non-glitchy status tags for active agents (ORCH, FE, BE, QA). - Scrubs all references to external agents from help screens, docs, and code comments. - Introduces docs/HOW_TO_USE.md, documenting operation loops and command catalogs.
1 parent a8c69db commit 06c0426

5 files changed

Lines changed: 245 additions & 117 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export NVIDIA_API_KEY=nvapi-...
109109

110110
| Doc | Contents |
111111
|-----|----------|
112+
| **[HOW_TO_USE.md](docs/HOW_TO_USE.md)** | **Detailed premium startup, commands, and layouts guide** |
112113
| **[GUIDE.md](docs/GUIDE.md)** | Full command reference + working playbooks + diagrams |
113114
| [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | System design |
114115
| [docs/SESSIONS.md](docs/SESSIONS.md) | Session memory |

docs/HOW_TO_USE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# How to Use ArrowCode
2+
3+
Welcome to **ArrowCode**, a premium, high-performance multi-agent terminal coding harness. ArrowCode cleanly overtakes your terminal screen, offering an immersive, glitch-free interactive development environment tailored to modern engineering workflows.
4+
5+
---
6+
7+
## Immersive Control Loop
8+
9+
When you open ArrowCode, it takes over the terminal window, hiding standard shell scrollback history to keep your focus perfectly locked. On exiting, your previous shell canvas is fully restored.
10+
11+
1. **The Startup Screen**:
12+
- Offers cursor-based navigation (Arrow keys + Enter) to start a new worktree, resume a session, view history, or quit.
13+
- Includes standard system shortcuts:
14+
- `ctrl+w`: Start a new session / worktree.
15+
- `ctrl+s`: Resume your previous session.
16+
- `ctrl+q`: Gracefully quit the application and restore terminal.
17+
18+
2. **Core Operational Loop**:
19+
- **`/plan [goal]`**: Start drafting an execution strategy for your target task.
20+
- **Clarifying Questions**: ArrowCode's Orchestrator raises questions to eliminate ambiguity before touching any code.
21+
- **`/confirm`**: Approves the compiled plan and kicks off parallel execution across main agents & spawnable worker swarms.
22+
- **`/accept`**: Finalizes the changes, persists the session state, and cleanly logs out.
23+
24+
---
25+
26+
## Commands Catalog
27+
28+
| Command | Action / Explanation |
29+
|---|---|
30+
| `/help` | View help details and interactive command overlays. |
31+
| `/plan [goal]` | Kick off the planning phase for a feature or bugfix. |
32+
| `/confirm` | Approve the plan and begin automatic code construction and tests. |
33+
| `/accept` | Conclude and save the session successfully. |
34+
| `/reject [note]` | Decline the proposed changes and ask the agents to refine the result. |
35+
| `/stop` | Freeze all currently running background execution runs immediately. |
36+
| `/undo` | Walk back to the previous workspace checkpoint safely. |
37+
| `/yolo` | Toggle automatic execution approval for all file edits and bash tools. |
38+
| `/settings` | Open the full-screen terminal configuration dashboard. |
39+
| `/exit` | Exit ArrowCode and cleanly restore your standard shell history. |
40+
41+
---
42+
43+
## Layout Modes
44+
45+
ArrowCode supports two beautiful premium layout experiences:
46+
- **Classic Mode (Default)**: A clean minimalist chat pane showing elegant streaming conversation with a low-noise single-line status representing active agents (**ORCH**, **FE**, **BE**, **QA**).
47+
- **Dashboard Mode**: An advanced 2x2 terminal overlay showing live agent terminals, a swarm map tree, plan checklists, active file tree, and code diff highlights. Run `/swarm` (or `/layout`) to toggle layouts instantly.

src/brand/banner.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ export const BANNER_COMPACT = `
1919
`.replace(/^\n/, "");
2020

2121
/** Clean line-art mark for small terminals / headers */
22+
export const PREMIUM_MINIMAL_ASCII = `
23+
▞▀▖
24+
▚▄▘▛▀▖▛▀▖▞▀▖▌ ▌▞▀▖
25+
▞ ▖▙▄▘▙▄▘▌ ▌▐▐ ▌▌ ▌
26+
▚▄▘▛ ▘▛ ▘▚▄▘ ▘ ▘▚▄▘
27+
`.trim();
28+
2229
export const MARK = `
2330
/\\
2431
/ \\ ARROWCODE

src/index.ts

Lines changed: 32 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -259,123 +259,41 @@ async function main() {
259259
console.log("\n[metrics]", harness.metricsLine());
260260
process.exit(0);
261261
} else {
262-
// CLI Interactive Session (like Claude Code) is now the default!
263-
const readline = await import("node:readline");
264-
const rl = readline.createInterface({
265-
input: process.stdin,
266-
output: process.stdout,
267-
});
268-
269-
console.log("\n================================================================");
270-
console.log(" /\\");
271-
console.log(" / \\ ARROWCODE Interactive CLI");
272-
console.log(" / /\\ \\ swarm coding harness");
273-
console.log(" /______\\ ORCH · FE · BE · QA");
274-
console.log("================================================================\n");
275-
console.log(" Welcome! You are in the interactive CLI mode (similar to Claude Code).");
276-
console.log(" - Type standard prompt to chat with the agents.");
277-
console.log(" - Use /plan <goal> to propose a new plan.");
278-
console.log(" - Use /add <filepath> to attach a file to the context.");
279-
console.log(" - Use /swarm to launch the fullscreen dashboard TUI.");
280-
console.log(" - Use /confirm to approve and execute the current plan.");
281-
console.log(" - Use /accept to finish and save changes.");
282-
console.log(" - Use /help to see all available commands.");
283-
console.log(" - Type /exit or /quit to quit.\n");
284-
285-
const attachedFiles: { path: string; content: string }[] = [];
286-
287-
const promptUser = () => {
288-
rl.question("arrowcode> ", async (answer) => {
289-
const line = answer.trim();
290-
if (!line) {
291-
promptUser();
292-
return;
293-
}
294-
if (line === "/exit" || line === "/quit") {
295-
rl.close();
296-
process.exit(0);
297-
}
298-
299-
let cmdLine = line;
300-
if (cmdLine.startsWith(".")) {
301-
cmdLine = "/" + cmdLine.slice(1);
302-
}
262+
// Enter alternate screen buffer to cleanly overtake the whole terminal canvas
263+
// and hide scrollback history while running.
264+
process.stdout.write("\x1b[?1049h\x1b[H");
303265

304-
if (cmdLine === "/swarm") {
305-
rl.close();
306-
console.log("\nLaunching Multi-Agent Swarm TUI Dashboard...");
307-
const { render } = await import("ink");
308-
const { App } = await import("./tui/App");
309-
const { waitUntilExit } = render(
310-
React.createElement(App, {
311-
harness,
312-
config: cfg,
313-
initialPrompt: undefined,
314-
}),
315-
{ exitOnCtrlC: true },
316-
);
317-
await waitUntilExit();
318-
process.exit(0);
319-
}
320-
321-
if (cmdLine.startsWith("/add ")) {
322-
const filePath = cmdLine.slice(5).trim();
323-
try {
324-
const absolutePath = harness.workspace.resolve(filePath, { mustExist: true });
325-
const fs = await import("node:fs");
326-
const content = fs.readFileSync(absolutePath, "utf8");
327-
const lineCount = content.split("\n").length;
328-
attachedFiles.push({ path: filePath, content });
329-
console.log(`[system] Attached file ${filePath} (${lineCount} lines)`);
330-
} catch (err: any) {
331-
console.log(`[system] Error: Failed to attach file: ${err.message}`);
332-
}
333-
promptUser();
334-
return;
335-
}
336-
337-
if (cmdLine.startsWith("/")) {
338-
// Dispatch command
339-
const [cmd, ..._rest] = cmdLine.slice(1).split(/\s+/);
340-
const { dispatchCommand } = await import("./commands/registry");
266+
const exitAlternateScreen = () => {
267+
process.stdout.write("\x1b[?1049l\x1b[?25h");
268+
};
341269

342-
let modifiedCmdLine = cmdLine;
343-
if (cmd === "plan" && attachedFiles.length > 0) {
344-
const attachmentBlock = attachedFiles
345-
.map((f) => `=== ATTACHED FILE: ${f.path} ===\n${f.content}\n===============================`)
346-
.join("\n\n");
347-
modifiedCmdLine = `/plan ${attachmentBlock}\n\nUser Request:\n${cmdLine.slice(5).trim()}`;
348-
attachedFiles.length = 0;
349-
}
270+
process.on("exit", exitAlternateScreen);
271+
process.on("SIGINT", () => {
272+
exitAlternateScreen();
273+
process.exit(130);
274+
});
275+
process.on("uncaughtException", (err) => {
276+
exitAlternateScreen();
277+
console.error(err);
278+
process.exit(1);
279+
});
350280

351-
const res = await dispatchCommand(modifiedCmdLine, {
352-
harness,
353-
setYolo: () => {},
354-
getYolo: () => false,
355-
});
356-
if (res.type === "exit") {
357-
rl.close();
358-
process.exit(0);
359-
}
360-
if (res && "message" in res && res.message) {
361-
console.log(`[system] ${res.message}`);
362-
}
363-
} else {
364-
let payload = line;
365-
if (attachedFiles.length > 0) {
366-
const attachmentBlock = attachedFiles
367-
.map((f) => `=== ATTACHED FILE: ${f.path} ===\n${f.content}\n===============================`)
368-
.join("\n\n");
369-
payload = `${attachmentBlock}\n\nUser Prompt:\n${line}`;
370-
attachedFiles.length = 0;
371-
}
372-
await harness.chat(payload);
373-
}
374-
promptUser();
375-
});
376-
};
377-
promptUser();
378-
return;
281+
try {
282+
const { render } = await import("ink");
283+
const { App } = await import("./tui/App");
284+
const { waitUntilExit } = render(
285+
React.createElement(App, {
286+
harness,
287+
config: cfg,
288+
initialPrompt: undefined,
289+
}),
290+
{ exitOnCtrlC: true },
291+
);
292+
await waitUntilExit();
293+
} finally {
294+
exitAlternateScreen();
295+
}
296+
process.exit(0);
379297
}
380298
}
381299

0 commit comments

Comments
 (0)