Skip to content
seanrobertwrightPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

295 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


420AI logo

420AI

A self-hosted AI Coding Session Intelligence Platform — capture every AI coding-tool session on your machine(s), archive it with full fidelity, and turn it into reports on cost, token/context efficiency, tool-call failures, and Git outcomes.
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

420AI Live Monitor screenshot

AI coding tools produce valuable but fragmented operational data — sessions live in vendor-specific local stores, CLIs, and logs that can crash, change format, or lose history. 420AI captures that data across machines, archives it with maximum fidelity, and turns it into Markdown reports and a live dashboard so you can answer questions like which projects/tools/models are worth the spend and where context is wasted.

It is local-first and self-hosted (nothing leaves your home server), event-sourced (raw records are the permanent truth; everything else is a re-buildable projection), and deterministic-metrics-first, AI-interpretation-second. The repo is an npm-workspaces monorepo:

  • packages/shared — token shape, event taxonomy, fingerprint, pricing, cost, ingest wire types
  • packages/db — Drizzle Postgres schema + migrations, AES-256-GCM field encryption, repositories
  • apps/ingest — Fastify Ingest API (pairing, bearer-authed idempotent ingest, projections, reports)
  • apps/collector — headless capture agent (connectors, durable queue, watcher, sync, CLI)
  • apps/dashboard — Next.js + shadcn/theGridCN Live Monitor
  • apps/desktop — Tauri (Rust) tray app that supervises the collector as a sidecar

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

  • Node ≥ 24 (see .nvmrc) — the collector queue uses the built-in node:sqlite.
  • Docker — for the PostgreSQL 17 archive (host port 5433).

Installation

  1. Clone the repo
    git clone https://github.com/seanrobertwright/420AI.git
    cd 420AI
  2. Install workspace dependencies
    npm install
  3. Create your env file and fill the two secrets
    cp .env.example .env
    # ARCHIVE_ENCRYPTION_KEY — 32 bytes, base64:
    node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
    # SESSION_SECRET — signs login cookies (must match in ingest + dashboard):
    node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))"
    # …then set ADMIN_EMAIL + ADMIN_PASSWORD. As of M15 15.9 that pair IS the bootstrap:
    # ADMIN_TOKEN was retired, and an API key can only be minted from a login.
  4. Start the archive and apply migrations
    npm run db:up        # postgres:17 on host port 5433
    npm run db:migrate
  5. Run the Ingest API
    npm run ingest:dev   # http://localhost:8420

(back to top)

Usage

Pair a machine and capture sessions (collector CLI, run with tsx — no build needed):

# Log in, mint an `admin` API key (M15 15.9; Settings → API keys does this in the dashboard as
# of 15.10 — the curl form is kept because it scripts), create a pairing code, pair
SESSION=$(curl -s -X POST localhost:8420/v1/auth/login -H "content-type: application/json" \
  -d "{\"email\":\"$ADMIN_EMAIL\",\"password\":\"$ADMIN_PASSWORD\"}" | jq -r .token)
API_KEY=$(curl -s -X POST localhost:8420/v1/auth/api-keys -H "authorization: Bearer $SESSION" \
  -H "content-type: application/json" \
  -d "{\"name\":\"setup\",\"role\":\"admin\",\"currentPassword\":\"$ADMIN_PASSWORD\"}" | jq -r .token)
curl -s -X POST localhost:8420/v1/pairing-codes -H "authorization: Bearer $API_KEY" -d '{}'
npx tsx apps/collector/src/cli.ts pair <code> --url http://localhost:8420 --name win-dev

# Run the background capture agent (Ctrl-C drains and stops)
npx tsx apps/collector/src/cli.ts watch

# One-shot ops: drain the queue / inspect backlog / discover repos
npx tsx apps/collector/src/cli.ts sync
npx tsx apps/collector/src/cli.ts queue
npx tsx apps/collector/src/cli.ts discover

Run the dashboard (Live Monitor):

npm run dashboard:dev   # reads INGEST_URL + SESSION_SECRET from env (it forwards YOUR login)

For the full setup and day-to-day guide, see docs/guide/install.md and docs/guide/usage.md.

(back to top)

Roadmap

  • M1–M9 — capture → archive → projections → reporting → AI interpretation → Live Monitor
  • M10 — hardening: exports, catalog signing, operational alerts, replay metadata
  • M11 — Tauri desktop/tray collector
  • M12 — Production Readiness / GA (8 slices): basic search, dashboard surfaces, auth hardening, ops baseline, archive-replay engine, alert delivery, connector hardening, export/distribution polish
  • M13 — Capability Gap Closure (7 slices): truth fixes, the 5 remaining report types + context governance, archive re-parse, incremental search, alert delivery completion, scheduled reports, the Cursor connector
  • M14 — General AI Chat Capture (in progress): ChatGPT / Claude / Gemini web+desktop session capture (spike-first), plus catalog admin UIs, desktop polish, and per-event search granularity. Shipped: 14.5 Claude chat-export connector (batch, non-repo attribution); 14.7 browser extension (near-real-time Claude web capture) + collector push capture mode — ChatGPT/Gemini extension origins deferred

See SUMMARY.md and the open issues for the full list.

(back to top)

Contributing

This is a single-maintainer project. Contributions, issues, and feature requests are welcome — fork the repo, create a feature branch, and open a PR. Before committing, ensure the gate passes:

npm run repo-health           # typecheck + tests + NUL/stray-artifact scans
npm run repo-health -- --require-db   # also runs the Postgres integration layer

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Sean Wright —

Project Link: https://github.com/seanrobertwright/420AI

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages