Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Default mode is `observe` (report only); `guard` is opt-in; `heal` is experiment
| `training/` | vocabulary pruning, curriculum (`curriculum/rt.py` mirrors the runtime's situation renderer), Azure training, ONNX export, `EVAL.md` |
| `demos/` | six demo apps with a chaos backend and Playwright trials; `bench/heal/` runs them per mode |
| `packages/mcp/` | `@genclass/mcp`: the MCP server for coding agents (bridge on 127.0.0.1:47357, store, explore verdicts, replays, regression-test generation, 9 tools incl. `genclass_scan`, which runs the runtime CLI's `scan`); no runtime deps; `test/e2e/race.e2e.mjs` is the real-browser check (not in CI's main job). `plugin/` is the Claude Code plugin (also an Agent Plugins package); `server.json`, the plugin, `.claude-plugin/`, `.cursor-plugin/`, `gemini-extension.json`, `llms-install.md` and the READMEs pin its version (`npm run sync -w @genclass/mcp` after a version bump; `test/manifests.test.ts` fails otherwise); `scripts/plugin-repo.mjs` assembles genclass-dev/genclass-plugin (the plugin at a repository root with its marketplace files and the released server vendored from npm under `server/`, which `.mcp.json` and the hook there run with `node` from `${CLAUDE_PLUGIN_ROOT}`, for the Claude directory's 50 MiB archive limit and its holds on `npx` launchers and lockfiles, Codex, Gemini CLI, `gh skill`; that repository re-syncs daily from main and is never edited by hand) |
| `packages/cli/` | `genclass` (`npx genclass`): the one way to set GenClass up, `genclass dashboard` (one app, whole, in the terminal) and `genclass suggest`. Plain ESM `.mjs` in `src/` (`main.mjs` names the command to the runtime CLI's modules, which it reuses from `packages/runtime/bin/lib`: sign-in, project detection, `init`; `state.mjs` reads the seven steps of a project from disk and from genclass.dev (account, runtime, dashboard, test workflow, GitHub App, coding agent, suggestions); `setup.mjs` and `actions.mjs` walk them, one Enter each, in a short view that `d` expands; `art.mjs` is the opening wordmark; `app.mjs` is `genclass dashboard`, which reads `GET /api/cli/app` (the dashboard's own numbers; a CLI session approved before the approval page said so is asked to sign in again); `views.mjs` is the rest of the dashboard from the same answer (`problems`, `analytics`, `events`, `health`, `agent`, `report`); `kinds.mjs` holds the dashboard page's own texts for each kind and its fix prompts (a test reads `telemetry-worker/src/pages.ts` and fails when a sentence differs); `fix.mjs` hands a problem to the person's coding agent with that prompt (it starts `claude`, `codex`, `cursor-agent` or `gemini` on a key press, or copies or prints; GenClass changes no code); `ask.mjs` is a question to genclass.dev's model; `manage.mjs` is the account's side (`apps`, `plan`, `team`, `connections`, `export`, `funnels`, `agent link`) over the routes a newer approval lists, with `session.mjs` saying why a call was refused and what to do next; `home.mjs` is the prompt the command stays open on after the walk (a command, or a sentence that is a question); `name.mjs` makes every screen say `genclass` once it is installed, `npx genclass` until then; `suggest/` measures the repository and the live site (`repo.mjs`, `site.mjs`), runs the catalog of checks (`checks.mjs`) and asks genclass.dev to order and explain what failed (`digest.mjs` is everything that is sent); `tui.mjs` is the look); `build.mjs` bundles it into one file with no dependencies (`dist/genclass.mjs`) with the runtime and MCP versions it installs; tests in `test/` (`server.test.ts` runs it against the collector in process). The server side is `telemetry-worker/src/cli.ts`, `suggest.ts` (rule 11) and `ask.ts` (rule 12). On npm as `genclass` since 2026-11-12, released by `release-cli.yml` on a `cli-v*` tag; it is the first install line the README names |
| `packages/cli/` | `genclass` (`npx genclass`): the one way to set GenClass up, `genclass dashboard` (one app, whole, in the terminal) and `genclass suggest`. Plain ESM `.mjs` in `src/` (`main.mjs` names the command to the runtime CLI's modules, which it reuses from `packages/runtime/bin/lib`: sign-in, project detection, `init`; `state.mjs` reads the seven steps of a project from disk and from genclass.dev (account, runtime, dashboard, test workflow, GitHub App, coding agent, suggestions); `setup.mjs` and `actions.mjs` walk them, one Enter each, in a short view that `d` expands; `art.mjs` is the opening wordmark; `app.mjs` is `genclass dashboard`, which reads `GET /api/cli/app` (the dashboard's own numbers; a CLI session approved before the approval page said so is asked to sign in again); `views.mjs` is the rest of the dashboard from the same answer (`problems`, `analytics`, `events`, `health`, `agent`, `report`); `kinds.mjs` holds the dashboard page's own texts for each kind and its fix prompts (a test reads `telemetry-worker/src/pages.ts` and fails when a sentence differs); `fix.mjs` hands a problem to the person's coding agent with that prompt (it starts `claude`, `codex`, `cursor-agent` or `gemini` on a key press, or copies or prints; GenClass changes no code); `site.mjs` is `genclass site <address>`, genclass.dev's site check (`POST /api/scan/crawl`, the scanner's only way in since 2026-11-17): only for a site the account has shown is its own (`GET /api/scan/verify`), an optional test account whose password goes in that POST body and nowhere else, the findings to the agent through `fix-page.mjs` `handOff`; `ask.mjs` is a question to genclass.dev's model; `manage.mjs` is the account's side (`apps`, `plan`, `team`, `connections`, `export`, `funnels`, `agent link`) over the routes a newer approval lists, with `session.mjs` saying why a call was refused and what to do next; `home.mjs` is the prompt the command stays open on after the walk (a command, or a sentence that is a question); `name.mjs` makes every screen say `genclass` once it is installed, `npx genclass` until then; `suggest/` measures the repository and the live site (`repo.mjs`, `site.mjs`), runs the catalog of checks (`checks.mjs`) and asks genclass.dev to order and explain what failed (`digest.mjs` is everything that is sent); `tui.mjs` is the look); `build.mjs` bundles it into one file with no dependencies (`dist/genclass.mjs`) with the runtime and MCP versions it installs; tests in `test/` (`server.test.ts` runs it against the collector in process). The server side is `telemetry-worker/src/cli.ts`, `suggest.ts` (rule 11) and `ask.ts` (rule 12). On npm as `genclass` since 2026-11-12, released by `release-cli.yml` on a `cli-v*` tag; it is the first install line the README names |
| `packages/sv/` | `@genclass/sv`: the Svelte CLI community add-on (`npx sv add @genclass`): adds the runtime, the `/auto` import first in `src/hooks.client` (never the devtools overlay) and (default) the telemetry opt-out meta in `src/app.html`, all with the `genclass:init` marker so `remove` undoes it; bundles `@sveltejs/sv-utils`, `sv` is a peer; `test/e2e/` runs sv's add-on harness (pnpm, Chromium) |
| `packages/playwright/` | `@genclass/playwright`: the fixture (`src/fixture.ts`, `install.ts`, `page.ts`, `chaos.ts`, `races.ts`: puts the runtime's script-tag build on every `page` in observe mode with telemetry off, seeded chaos that holds matched fetch/XHR requests with `page.route` and `route.fallback()`, witnesses through the agent entry with every hold off, one `genclass-races/1` file per test in `test-results/genclass/`, with where the test is declared (`location`), which the GitHub App's inline comments use) and the reporter + pure summariser that read those files and write `genclass-report.md` for the PR; peer deps only (`@playwright/test`, `@genclass/runtime`); zero-edit mode (`src/register.ts`, `wrap.ts`, `worker.ts`, `run.ts`: the command `genclass-playwright-run` gives an unmodified suite the same instrumentation by wrapping public Playwright objects in the worker process; `docs/github-app/workflows/genclass.yml` is the one file a repository adds); `test/e2e/run.mjs` is the real-browser check of both (its own workflow) |
| `packages/nuxt/`, `packages/astro/` | `@genclass/nuxt` (a Nuxt module, `@nuxt/kit`, built with `@nuxt/module-builder`) and `@genclass/astro` (an Astro integration, `injectScript("page", ...)`): from options `{ mode, token?, telemetry?, devtools? }` they generate the runtime's own one line (`/auto` or `/auto/guard`) plus a `window.GENCLASS_CONFIG` module imported before it; browser only, nothing on the server; `@genclass/runtime` is a peer dependency. The generated code is pure (`src/source.ts`, `src/index.ts`) and the tests check it exactly, then build one fixture app. Workflow: `integrations.yml` (Node 24) |
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.3.13

- **`genclass site <address>`**: the site check, which used to be on genclass.dev, now runs from the command only.
genclass.dev opens your site's pages from that address, checks their links, clicks buttons, tabs and menus on each
(never ones that sign out, delete, pay, send, save or submit), runs axe-core and reads each first screen, then the
findings go to your coding agent as with `genclass fix`. It checks only a site you have shown is yours: the first
time, it prints a meta tag and a file to add, and checks again on Enter. It can sign in with a test account: the
password is typed unseen (or read from `GENCLASS_TEST_PASSWORD`), sent to genclass.dev for that check only, and
never kept or printed. `--json`, `--print` and `--out <file>` are for a script or an agent. It comes with Pro.

## 0.3.12

- Before sign-in the command says Pro is 3 days free, then US$50 a developer a month, the price on genclass.dev.
Expand Down
18 changes: 18 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ the page, about a minute) and hands every finding to your coding agent: Claude C
Enter starts the agent, `c` copies the prompt, `p` prints it; `--print` and `--json` print it for a script or an agent.
GenClass changes no code: the agent does, and you approve each change.

## Check your whole site

```bash
npx genclass site shop.example.com
```

The site check, deeper than the page check: genclass.dev opens your site's pages from that address, checks their
links, clicks buttons, tabs and menus on each (never ones that sign out, delete, pay, send, save or submit), runs
axe-core and reads each first screen. It takes up to about five minutes, then hands the findings to your coding agent
the way `genclass fix` does. It checks only a site you have shown is yours: the first time, it prints a meta tag for
your home page and a file for `/.well-known/genclass-verification.txt`, and checks again when you press Enter (a site
with GenClass set up from your account counts already). To check the pages behind a sign-in, answer yes and give a
test account, never a real one: the password is typed unseen, sent to genclass.dev for that check only, and never
kept. For a script or an agent: `--user <name>` with the password in `GENCLASS_TEST_PASSWORD` (never on the command
line), `--login-page <url>`, `--json`, `--print`, `--out <file>`. Like every command it comes with Pro.

## Your app in the terminal

```bash
Expand Down Expand Up @@ -277,6 +293,7 @@ first step and the agent prompt, with the model's own ideas and website designs.
| `npx genclass ask "..."` | a question about your app, answered from its numbers |
| `npx genclass suggest [url]` | what your app is missing, then one number hands the list to your coding agent (`--yes`, `--no-model`, `--all`) |
| `npx genclass scan <url>` | 23 visual checks on one page (free, with no account: `npx @genclass/runtime@beta scan <url>`) |
| `npx genclass site <address>` | the site check: your site's pages, links, buttons and accessibility, signed in with a test account if you like (`--user`, `--login-page`, `--out`) |
| `npx genclass connections` | alerts, GitHub App, coding agent (`add`, `test`, `on`, `off`, `remove` a destination) |
| `npx genclass agent` | your coding agent and what it did (`agent link`) |
| `npx genclass funnels` | funnels (`add "Name" /a /b`, `remove "Name"`) |
Expand All @@ -298,6 +315,7 @@ npx genclass suggest --json # the checks that failed, with evidence, in order
npx genclass dashboard --json # what GenClass found on the live site
npx genclass problems --json # the same by kind and page; also analytics, events, health, agent
npx genclass fix --print # the prompt to fix what was found (fix stale --print: one kind)
npx genclass site shop.example.com --json # the site check (the site shown to be yours first)
npx genclass report # the period as Markdown
```

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "genclass",
"version": "0.3.12",
"version": "0.3.13",
"description": "GenClass CLI: one command that sets GenClass up, shows your app in the terminal (problems, analytics, events), hands problems to your coding agent, answers questions about your app and tells you what it is missing.",
"type": "module",
"license": "Apache-2.0",
Expand Down
12 changes: 9 additions & 3 deletions packages/cli/src/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const HELP = [
['npx genclass ask "..."', "ask about your app in plain words; the model answers from its numbers"],
["npx genclass suggest [url]", "what your app is missing, most important first (--yes, --no-model, --all)"],
["npx genclass scan <url>", "23 visual checks on one page"],
["npx genclass site <address>", "the site check: your site's pages from that address, their links, buttons and accessibility, signed in with a test account if you like (--user, --login-page, --out)"],
]],
["Connect", [
["npx genclass connections", "where alerts go (Slack, Sentry, PostHog, Datadog, a webhook), GitHub, agent (connections add | test | on | off | remove <kind>)"],
Expand Down Expand Up @@ -102,7 +103,7 @@ export function usage(cols = width()) {
export const USAGE = usage(80);

const BOOL = { yes: "yes", y: "yes", json: "json", "no-browser": "noBrowser", "no-model": "noModel", all: "all", help: "help", h: "help", version: "version", v: "version", open: "open", print: "print", copy: "copy" };
const VALUE = { cwd: "cwd", url: "url", app: "app", range: "range", from: "from", to: "to", format: "format", out: "out", agent: "agent" };
const VALUE = { cwd: "cwd", url: "url", app: "app", range: "range", from: "from", to: "to", format: "format", out: "out", agent: "agent", user: "user", "login-page": "loginPage" };

/** The flags this file knows, and what is left ({ o, rest }); an unknown flag stays in `rest` for the command it is for. */
export function parseArgs(argv) {
Expand Down Expand Up @@ -259,7 +260,7 @@ export async function run(argv, ctx = {}) {
// the commands that take words after their name: sections, picks, subcommands, a question
const words = rest.filter((a) => !a.startsWith("-"));
const flags = rest.filter((a) => a.startsWith("-"));
const WORDY = ["analytics", "fix", "ask", "connections", "agent", "funnels", "apps", "team"];
const WORDY = ["analytics", "fix", "ask", "connections", "agent", "funnels", "apps", "team", "site"];
if (flags.length || (words.length && !WORDY.includes(cmd))) {
const bad = flags[0] ?? words[0];
err(`genclass: unknown ${bad.startsWith("-") ? "option" : "command"} ${c.bold(bad)}\n\n${usage()}`);
Expand All @@ -275,6 +276,10 @@ export async function run(argv, ctx = {}) {
err(`genclass agent: there is no ${c.bold(words[0])}. Try ${c.cyan("npx genclass agent")} or ${c.cyan("npx genclass agent link")}`);
return 2;
}
if (cmd === "site" && (words.length !== 1 || !(await import("./fix-page.mjs")).isAddress(words[0]))) {
err(`genclass site: give your site's address, once. Try ${c.cyan("npx genclass site shop.example.com")}`);
return 2;
}
// signed out, the runtime CLI's own command still knows an app's private dashboard link (.genclass.local): it is
// printed as before, with no sign-in and no Pro (it is on this machine already)
const fallback = async () => (await import("../../runtime/bin/lib/login.mjs")).run("dashboard", [...(o.cwd ? ["--cwd", o.cwd] : []), ...(o.open ? ["--open"] : [])]);
Expand All @@ -292,6 +297,7 @@ export async function run(argv, ctx = {}) {
}
if (cmd === "fix") return upsold((await import("./fix.mjs")).fix({ ...o, what: words.join(" ") || null }));
if (cmd === "ask") return upsold((await import("./ask.mjs")).ask({ ...o, question: words.join(" ") }));
if (cmd === "site") return upsold((await import("./site.mjs")).site({ ...o, what: words[0] }));
if (["apps", "plan", "team", "connections", "funnels", "profile", "upgrade"].includes(cmd)) return upsold((await import("./manage.mjs"))[cmd]({ ...o, args: words }), ["apps", "connections", "funnels"].includes(cmd));
if (cmd === "export") return (await import("./manage.mjs")).exportEvents(o);
const { setup, status } = await import("./setup.mjs");
Expand Down Expand Up @@ -440,7 +446,7 @@ export const FREE_COMMANDS = ["login", "logout", "whoami", "plan", "upgrade", "p

/** Every command, for the "did you mean" of a mistyped one. */
export const COMMANDS = [
"setup", "status", "suggest", "dashboard", "problems", "analytics", "events", "health", "report", "export", "fix", "ask", "scan", "connections", "agent", "funnels",
"setup", "status", "suggest", "dashboard", "problems", "analytics", "events", "health", "report", "export", "fix", "ask", "scan", "site", "connections", "agent", "funnels",
"apps", "plan", "upgrade", "profile", "team", "login", "logout", "whoami", "connect", "init", "remove", "help", "version",
];

Expand Down
Loading
Loading