OpenSpec Dashboard
+Select an item from the sidebar to view its content.
+diff --git a/openspec/changes/add-web-dashboard-command/.openspec.yaml b/openspec/changes/add-web-dashboard-command/.openspec.yaml new file mode 100644 index 00000000..df18424f --- /dev/null +++ b/openspec/changes/add-web-dashboard-command/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-01-28 diff --git a/openspec/changes/add-web-dashboard-command/design.md b/openspec/changes/add-web-dashboard-command/design.md new file mode 100644 index 00000000..bdbf6fe9 --- /dev/null +++ b/openspec/changes/add-web-dashboard-command/design.md @@ -0,0 +1,91 @@ +## Context + +OpenSpec currently has a terminal-based `openspec view` command (`src/core/view.ts`) that outputs a static text dashboard using chalk for formatting. It uses `ViewCommand.getChangesData()` and `ViewCommand.getSpecsData()` to gather project data. There are also utility modules for discovering changes (`src/utils/item-discovery.ts`), parsing task progress (`src/utils/task-progress.ts`), and parsing markdown specs (`src/core/parsers/markdown-parser.ts`). + +The project has zero frontend dependencies and uses Node.js built-in modules wherever possible. The CLI uses Commander.js for command registration. + +## Goals / Non-Goals + +**Goals:** +- Add `openspec dashboard` command that starts a local HTTP server with a web-based project dashboard +- Reuse existing data-gathering logic from `ViewCommand`, `ListCommand`, and `item-discovery` utilities +- Zero new npm dependencies (use Node.js built-in `http` and `child_process` modules) +- Serve a self-contained HTML page with inline CSS and JS +- Support viewing rendered markdown for any artifact +- Clean cross-platform behavior (Windows `start`, macOS `open`, Linux `xdg-open`) + +**Non-Goals:** +- Real-time file watching or live-reload (page can be refreshed manually) +- Editing or creating artifacts from the dashboard (read-only) +- Authentication or multi-user access (local development tool) +- External CDN dependencies or build toolchains for the frontend + +## Decisions + +### Decision 1: Node.js Built-in HTTP Server + +Use `node:http` to create the server rather than adding Express or another framework. + +**Rationale:** +- Zero new dependencies aligns with the project's minimal dependency philosophy +- The API surface is small (one HTML page, ~5 JSON endpoints) +- Commander.js already handles CLI concerns; the server is a simple request router +- `node:http` is stable, well-documented, and available on all target platforms + +### Decision 2: Self-Contained HTML with Inline Markdown Rendering + +The dashboard is a single HTML file with inline ` + +
+ + + +Select an item from the sidebar to view its content.
+