From fec0601722a6957c0490d96178cfe6c0aded2fb4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 5 Jul 2026 22:15:47 +0000 Subject: [PATCH] Add a Terminal page to the dashboard Adds a real shell terminal to the dashboard sidebar: POST /api/terminal/run executes a command via subprocess in a server-tracked working directory (with cd support), and GET /api/terminal/session returns the current cwd. The frontend renders a scrollback panel with command history (up/down arrows) styled to match the existing chat UI. Local-only power feature: it executes arbitrary shell commands, same trust model as the existing agent CLIs the dashboard already shells out to. --- dashboard/api.js | 3 + dashboard/index.html | 1 + dashboard/pages/terminal.js | 114 ++++++++++++++++++++++++++++++++++++ dashboard/styles.css | 32 ++++++++++ dashboard/utils.js | 1 + server.py | 37 ++++++++++++ 6 files changed, 188 insertions(+) create mode 100644 dashboard/pages/terminal.js diff --git a/dashboard/api.js b/dashboard/api.js index bdb2284..886e71f 100644 --- a/dashboard/api.js +++ b/dashboard/api.js @@ -52,6 +52,9 @@ const api = { discoverStandards: () => api.post('/api/standards/discover'), chat: (agent, message, controller) => api.post('/api/chat', { agent, message }, controller), getChatHistory: () => api.get('/api/chat/history'), + // Terminal + getTerminalSession: () => api.get('/api/terminal/session'), + runTerminalCommand: (command) => api.post('/api/terminal/run', { command }), // Kanban getKanbanBoard: (status) => api.get(status ? `/api/kanban/board?status=${encodeURIComponent(status)}` : '/api/kanban/board'), getKanbanTask: (id) => api.get(`/api/kanban/tasks/${encodeURIComponent(id)}`), diff --git a/dashboard/index.html b/dashboard/index.html index 4f7899e..6a600ba 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -33,6 +33,7 @@