Skip to content

Commit 67aa16d

Browse files
committed
Ship first-party dashboard with container
Dashboard package: - Rename @codeforge/dashboard → codeforge-dashboard, remove private flag - Add bin wrapper with --port/--host/--version/--help flags - Add HOST env var support to Bun.serve for container port forwarding - Add files, engines, prepublishOnly fields for npm publish - Move build-time deps (Svelte, Vite, Tailwind) to devDependencies Container feature: - Rewrite install.sh: bun install -g replaces npm install -g - Add autostart poststart hook (PID-guarded, nohup background launch) - Rename command: claude-dashboard → codeforge-dashboard - Remove persistence symlink hook (DB on bind mount) - Update feature metadata, README, devcontainer.json, CLAUDE.md CI/CD: - Add release-dashboard.yml workflow (dashboard-v* tags → npm publish) - Add test-dashboard job to ci.yml - Add dashboard/CHANGELOG.md
1 parent 42f6b85 commit 67aa16d

File tree

14 files changed

+302
-132
lines changed

14 files changed

+302
-132
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: CI
33
on:
44
push:
55
branches: [main, staging]
6-
paths: ['container/**', 'cli/**']
6+
paths: ['container/**', 'cli/**', 'dashboard/**']
77
pull_request:
88
branches: [main, staging]
9-
paths: ['container/**', 'cli/**']
9+
paths: ['container/**', 'cli/**', 'dashboard/**']
1010

1111
jobs:
1212
test:
@@ -52,3 +52,13 @@ jobs:
5252
working-directory: cli
5353
- run: bun test
5454
working-directory: cli
55+
56+
test-dashboard:
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v6
60+
- uses: oven-sh/setup-bun@v2
61+
- run: bun install
62+
working-directory: dashboard
63+
- run: bun test
64+
working-directory: dashboard
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release Dashboard
2+
3+
on:
4+
push:
5+
tags: ['dashboard-v*']
6+
7+
jobs:
8+
validate:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
version: ${{ steps.extract.outputs.version }}
12+
steps:
13+
- uses: actions/checkout@v6
14+
- id: extract
15+
name: Extract and validate version
16+
run: |
17+
TAG="${GITHUB_REF#refs/tags/dashboard-v}"
18+
PKG=$(node -p "require('./dashboard/package.json').version")
19+
echo "version=$TAG" >> "$GITHUB_OUTPUT"
20+
if [ "$TAG" != "$PKG" ]; then
21+
echo "::error::Tag dashboard-v${TAG} does not match dashboard/package.json version ${PKG}"
22+
exit 1
23+
fi
24+
25+
publish-and-release:
26+
needs: validate
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- uses: actions/checkout@v6
32+
33+
- uses: oven-sh/setup-bun@v2
34+
35+
- name: Install dependencies
36+
run: bun install
37+
working-directory: dashboard
38+
39+
- name: Run tests
40+
run: bun test
41+
working-directory: dashboard
42+
43+
- name: Build SPA
44+
run: bun run build
45+
working-directory: dashboard
46+
47+
- name: Verify package contents
48+
run: npm pack --dry-run
49+
working-directory: dashboard
50+
51+
- uses: actions/setup-node@v6
52+
with:
53+
node-version: 18
54+
registry-url: https://registry.npmjs.org
55+
56+
- name: Publish to npm
57+
run: npm publish
58+
working-directory: dashboard
59+
env:
60+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
62+
- name: Extract changelog section
63+
id: changelog
64+
run: |
65+
VERSION="${{ needs.validate.outputs.version }}"
66+
NOTES=$(sed -n "/^## v${VERSION}/,/^## v/{ /^## v${VERSION}/d; /^## v/d; p; }" dashboard/CHANGELOG.md)
67+
[ -z "$NOTES" ] && NOTES="Dashboard Release v${VERSION}"
68+
echo "$NOTES" > /tmp/release-notes.md
69+
70+
- name: Create GitHub Release
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
run: |
74+
VERSION="dashboard-v${{ needs.validate.outputs.version }}"
75+
gh release create "$VERSION" --title "$VERSION" --notes-file /tmp/release-notes.md

container/.devcontainer/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Unreleased
44

5+
### Dashboard
6+
- **First-party dashboard** — replaced third-party `claude-session-dashboard` npm package with `codeforge-dashboard` (built from monorepo `dashboard/` package)
7+
- Auto-launch on container start via poststart hook (controllable with `autostart` option)
8+
- Install switched from npm to Bun (`bun install -g`)
9+
- Command renamed: `claude-dashboard``codeforge-dashboard`
10+
- Removed persistence symlink hook (dashboard DB now lives on bind mount at `~/.codeforge/data/`)
11+
512
### Skills
613
- Added `agent-browser` skill to skill-engine plugin — guides headless browser automation with CLI reference, workflow patterns, and authentication
714

container/.devcontainer/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Config files deploy via `.codeforge/file-manifest.json` on every container start
2929
| `ccusage` / `ccburn` | Token usage analysis / burn rate |
3030
| `agent-browser` | Headless Chromium (Playwright-based) |
3131
| `check-setup` | Verify CodeForge setup health |
32-
| `claude-dashboard` | Session analytics dashboard (port 7847) |
32+
| `codeforge-dashboard` | Session analytics dashboard — auto-launches on start (port 7847) |
3333
| `dbr` | Dynamic port forwarding ([devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge)) |
3434
| `cc-tools` | List all installed tools with versions |
3535

container/.devcontainer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ claude --resume # Resume previous session
203203
| `ccburn` | Visual token burn rate tracker with pace indicators |
204204
| `ccstatusline` | Status bar display (integrated into Claude Code, not standalone CLI) |
205205
| `claude-monitor` | Real-time usage tracking |
206-
| `claude-dashboard` | Local session analytics dashboard (token usage, costs, timelines) |
206+
| `codeforge-dashboard` | Session analytics dashboard — auto-launches on start (port 7847) |
207207

208208
## Configuration
209209

container/.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@
4646

4747
// Feature install order: external runtimes first (Node, uv, Bun),
4848
// then Claude Code native binary (no Node dependency), then custom features.
49-
// npm-dependent features (agent-browser, ccusage, claude-session-dashboard,
50-
// biome, lsp-servers) must come after Node. uv-dependent features (ruff, claude-monitor) must
49+
// npm-dependent features (agent-browser, ccusage,
50+
// biome, lsp-servers) must come after Node. bun-dependent features
51+
// (claude-session-dashboard) must come after Bun. uv-dependent features (ruff, claude-monitor) must
5152
// come after uv. notify-hook is second-to-last (lightweight, no dependencies).
5253
// dbr (devcontainer-bridge) is last — standalone binary, no dependencies.
5354
"overrideFeatureInstallOrder": [
@@ -160,7 +161,7 @@
160161
"forwardPorts": [7847],
161162
"portsAttributes": {
162163
"7847": {
163-
"label": "Claude Dashboard",
164+
"label": "CodeForge Dashboard",
164165
"onAutoForward": "notify"
165166
},
166167
"*": {
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
# Claude Session Dashboard (devcontainer feature)
1+
# CodeForge Dashboard (devcontainer feature)
22

3-
Installs [claude-session-dashboard](https://github.com/dlupiak/claude-session-dashboard)a local analytics dashboard for Claude Code sessions.
3+
Installs [codeforge-dashboard](https://github.com/AnExiledDev/CodeForge)the first-party analytics dashboard for Claude Code sessions, built from the monorepo `dashboard/` package.
44

55
## What it provides
66

7-
- `claude-dashboard` command to launch the web UI
7+
- `codeforge-dashboard` command to launch the web UI
8+
- Auto-launches on container start via poststart hook (controllable with `autostart` option)
89
- Session browsing with full-text search and filtering
910
- Token usage breakdown, cost estimates, and activity heatmaps
1011
- Tool call timeline visualization
1112
- Per-project aggregated analytics
12-
- Settings persisted across container rebuilds via symlink to `/workspaces/.claude-dashboard/`
13+
- Dashboard DB persisted at `~/.codeforge/data/dashboard.db` on the bind mount
1314

1415
## Options
1516

@@ -19,22 +20,27 @@ Installs [claude-session-dashboard](https://github.com/dlupiak/claude-session-da
1920
| `port` | `7847` | Default port for the dashboard server |
2021
| `shells` | `both` | Shell configs to add alias to (`bash`, `zsh`, `both`) |
2122
| `username` | `automatic` | Container user to install for |
23+
| `autostart` | `true` | Auto-launch dashboard on container start |
2224

2325
## Usage
2426

2527
```bash
2628
# Start the dashboard (default port 7847)
27-
claude-dashboard
29+
codeforge-dashboard
2830

2931
# Start on a custom port
30-
claude-dashboard -p 8080
32+
codeforge-dashboard -p 8080
3133

3234
# Show help
33-
claude-dashboard --help
35+
codeforge-dashboard --help
3436
```
3537

3638
The dashboard reads session data from `~/.claude/projects/`.
3739

38-
## How persistence works
40+
## Auto-launch behavior
3941

40-
Dashboard settings and cache are stored at `~/.claude-dashboard/`. A poststart hook symlinks `~/.claude-dashboard``/workspaces/.claude-dashboard/`, which is bind-mounted and survives rebuilds.
42+
When `autostart` is enabled (default), a poststart hook starts the dashboard in the background on every container start. It listens on `0.0.0.0:7847` so VS Code port forwarding works automatically. The process writes logs to `/tmp/codeforge-dashboard.log` and tracks its PID at `/tmp/codeforge-dashboard.pid` to avoid duplicate launches.
43+
44+
## Persistence
45+
46+
The dashboard database is stored at `~/.codeforge/data/dashboard.db`, which lives on the Docker named volume backing `~/.claude/`. This survives container rebuilds without any symlink hooks.
Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
{
2-
"id": "claude-session-dashboard",
3-
"version": "1.0.0",
4-
"name": "Claude Session Dashboard",
5-
"description": "Local analytics dashboard for Claude Code sessions (token usage, tool calls, cost estimates)",
6-
"documentationURL": "https://github.com/dlupiak/claude-session-dashboard",
7-
"options": {
8-
"version": {
9-
"type": "string",
10-
"description": "Dashboard version (e.g., 'latest', '1.0.0', 'none' to skip)",
11-
"default": "latest"
12-
},
13-
"port": {
14-
"type": "string",
15-
"description": "Default port for the dashboard server",
16-
"default": "7847"
17-
},
18-
"shells": {
19-
"type": "string",
20-
"description": "Which shells to configure aliases in (bash, zsh, or both)",
21-
"default": "both",
22-
"enum": ["bash", "zsh", "both"]
23-
},
24-
"username": {
25-
"type": "string",
26-
"description": "Container user to install for",
27-
"default": "automatic"
28-
}
29-
},
30-
"installsAfter": [
31-
"ghcr.io/devcontainers/features/node:1"
32-
]
2+
"id": "claude-session-dashboard",
3+
"version": "1.0.0",
4+
"name": "Claude Session Dashboard",
5+
"description": "First-party analytics dashboard for Claude Code sessions, built from the CodeForge monorepo dashboard package",
6+
"documentationURL": "https://github.com/AnExiledDev/CodeForge",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"description": "Dashboard version (e.g., 'latest', '1.0.0', 'none' to skip)",
11+
"default": "latest"
12+
},
13+
"port": {
14+
"type": "string",
15+
"description": "Default port for the dashboard server",
16+
"default": "7847"
17+
},
18+
"shells": {
19+
"type": "string",
20+
"description": "Which shells to configure aliases in (bash, zsh, or both)",
21+
"default": "both",
22+
"enum": ["bash", "zsh", "both"]
23+
},
24+
"username": {
25+
"type": "string",
26+
"description": "Container user to install for",
27+
"default": "automatic"
28+
},
29+
"autostart": {
30+
"type": "boolean",
31+
"description": "Auto-launch dashboard on container start",
32+
"default": true
33+
}
34+
},
35+
"installsAfter": ["ghcr.io/rails/devcontainer/features/bun:1"]
3336
}

0 commit comments

Comments
 (0)