Skip to content

feat: wire up web dashboard via libscope serve --dashboard#265

Merged
RobertLD merged 1 commit intomainfrom
feat/wire-dashboard-cli
Mar 2, 2026
Merged

feat: wire up web dashboard via libscope serve --dashboard#265
RobertLD merged 1 commit intomainfrom
feat/wire-dashboard-cli

Conversation

@RobertLD
Copy link
Owner

@RobertLD RobertLD commented Mar 2, 2026

Summary

Wire up the existing web dashboard server (src/web/server.ts) to the CLI so users can start it with libscope serve --dashboard.

Changes

  • src/cli/index.ts: Add --dashboard flag to serve command that starts the web UI server (port 3377 default)
  • docs/reference/cli.md: Updated serve command docs with new flag, all options, and examples

Usage

libscope serve --dashboard              # Web dashboard at http://localhost:3377
libscope serve --dashboard --port 8080  # Custom port
libscope serve --api                    # REST API at http://localhost:3378  
libscope serve                          # MCP server (stdio) — unchanged

The dashboard serves:

  • GET / → HTML dashboard with document stats, topics, recent activity
  • GET /graph → Interactive knowledge graph visualization
  • GET /api/* → Dashboard API endpoints (search, documents, stats)

Closes #259

Add --dashboard flag to the serve command that starts the web UI server
from src/web/server.ts (default port 3377). The dashboard serves:
- GET / → HTML dashboard with document stats, topics, recent activity
- GET /graph → Knowledge graph visualization

Port and host are configurable via --port and --host flags.
Updated CLI reference docs.

Closes #259

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 2, 2026 19:27
@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
libscope Building Building Preview, Comment Mar 2, 2026 7:27pm

@RobertLD RobertLD merged commit cf16afd into main Mar 2, 2026
8 checks passed
@RobertLD RobertLD deleted the feat/wire-dashboard-cli branch March 2, 2026 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Wires the existing web dashboard HTTP server into the libscope serve CLI entrypoint by adding a new --dashboard mode and documenting the updated serve command behavior.

Changes:

  • Add --dashboard flag to libscope serve to start the web dashboard server (default port 3377).
  • Adjust --port handling so it’s optional and defaults by mode (API: 3378, dashboard: 3377).
  • Update CLI reference docs to include the new flag, options, and examples.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/cli/index.ts Adds --dashboard serve mode and updates port defaulting logic per mode.
docs/reference/cli.md Documents serve --dashboard, including options and examples.

Comment on lines +87 to +101
Start the MCP server, REST API, or web dashboard.

```bash
libscope serve # MCP server (stdio)
libscope serve --api # REST API
libscope serve --api --port 3378
libscope serve # MCP server (stdio)
libscope serve --api # REST API (port 3378)
libscope serve --dashboard # Web dashboard UI (port 3377)
libscope serve --dashboard --port 8080
```

| Option | Description |
|--------|-------------|
| `--api` | Start REST API instead of MCP server |
| `--port <n>` | REST API port (default: 3378) |
| `--dashboard` | Start the web dashboard UI |
| `--port <n>` | Server port (default: 3378 for API, 3377 for dashboard) |
| `--host <h>` | Server host (default: localhost) |
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CLI docs now describe --dashboard, but the README still documents only libscope serve --api under the “REST API” section. If this PR closes #259, consider updating README.md as well so users discover the dashboard entrypoint consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +718 to +722
.action(async (opts: { api?: boolean; dashboard?: boolean; port?: string; host: string }) => {
if (opts.dashboard) {
const { db, provider } = initializeAppWithEmbedding();
const { startWebServer } = await import("../web/server.js");
const defaultPort = 3377;
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--api and --dashboard can both be provided, but the current branching silently prioritizes --dashboard. This makes the CLI behavior ambiguous; consider explicitly rejecting the combination (print an error and exit non-zero) or wiring it to start both servers if that’s intended.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire up web dashboard via CLI command

2 participants