#Root scripts
| Command | Purpose |
|---|---|
npm run setup | Install root/web dependencies and build everything. |
npm run build | TypeScript backend → dist/. |
npm run build:web | Interface TypeScript and Vite SPA. |
npm run build:all | Backend and interface. |
npm start | Built CLI; default bind 0.0.0.0. |
npm run typecheck | Root type checking without output. |
npm test | Configured Vitest suite, including discovered tests/ files. |
npm run test:e2e | The two smoke/frontend and workspace-control files in the script, not every tests/e2e/ test. |
npm run test:watch | Watch mode. |
npm run test:coverage | Coverage; may need a provider matching the Vitest version. |
npm run prepublishOnly | Pre-publication build hook; does not publish by itself. |
#Interface development
After npm run setup, use two terminals at the root. Backend:
node bin/cockpit.js --host 127.0.0.1 --port 4000 --headless --no-open
Vite:
npm --prefix web run dev
Open http://localhost:5173. The proxy sends /api and /ws to 127.0.0.1:4000; changing the port requires updating web/vite.config.ts. Backend changes require npm run build and a restart; no backend watch script is declared.
Other web scripts:
npm --prefix web run build
npm --prefix web run preview
Preview serves the built SPA, not a replacement backend. The proxy above belongs to the development server.
#Checks
npm run typecheck
npm run build:all
npx playwright install chromium
npm run test:e2e
Browser tests need Playwright Chromium. On Linux, missing system libraries may require npx playwright install --with-deps chromium with installation permissions.
Select suites:
npx vitest run tests/unit
npx vitest run tests/integration
npx vitest run tests/e2e
Some tests create servers, processes, and temporary repositories. Read suites before adapting your environment. Having tests does not establish that all are validated on native Windows or macOS.
Report generator:
node scripts/generate-compliance-report.js
Writes .cockpit/compliance/audit-report.json and .cockpit/compliance/audit-report.md. The script assembles declared passing checks and predefined metadata; it does not run tests. Generating a report does not prove compliance for the current revision. Run relevant checks separately and inspect the script before automation.