Contributing
See CONTRIBUTING.md in the repository root for full contribution guidelines.
Quick Reference
Section titled “Quick Reference”Commit Format
Section titled “Commit Format”<type>(<scope>): <description>Types: feat, fix, docs, refactor, perf, test, chore
Development
Section titled “Development”git clone https://github.com/dorlugasigal/TermBeam.gitcd TermBeamnpm installnpm run dev # Start with auto-generated passwordnpm test # Run testsTesting
Section titled “Testing”npm test # run all unit/integration tests (node:test)npm run test:coverage # tests + coverage report (c8)npm run lint # syntax-check with node --checknpm run format # format with PrettierTermBeam also has end-to-end UI tests using Playwright (in test/e2e-*.test.js files). These are not included in npm test and require a separate Playwright setup.
Pull Request Checklist
Section titled “Pull Request Checklist”- Tests pass (
npm test) - New features have tests
- Commits follow conventional format
- Documentation updated if needed
- Manually tested on mobile (if UI changes)
Architecture Overview
Section titled “Architecture Overview”TermBeam follows a one-responsibility-per-file pattern. Key modules:
bin/termbeam.js— CLI entry point, dispatches subcommandssrc/server/index.js— orchestrator that wires Express + WebSocket + PTYsrc/server/sessions.js—SessionManagerwrappingnode-ptylifecycle (create/list/delete)src/server/auth.js— password auth, token cookies, rate limitingsrc/server/routes.js— Express routes for API and pagessrc/server/websocket.js— WebSocket message handling (attach,input,resize,output)src/cli/—termbeam resume,termbeam list, interactive setup, service installsrc/tunnel/— DevTunnel integration (optional public URLs)src/utils/— shells, git metadata, logger, agent detectionsrc/frontend/— React SPA built with Vite + TypeScript (xterm.js, Zustand, Radix UI); compiled topublic/
For the full architecture, see Architecture.
Documentation
Section titled “Documentation”- README.md — user-facing quick reference (features, CLI flags, security summary)
packages/site/— Astro + Starlight site deployed to GitHub Pages (the page you’re reading now)- Preview docs locally:
cd packages/site && npm install && npm run dev - Changes to
packages/site/src/content/docs/pushed tomainauto-deploy via the Pages workflow
See Also
Section titled “See Also”- API Reference — HTTP endpoints and WebSocket protocol you’ll work against
- Architecture — how the server, frontend, and PTY sessions fit together
- Getting Started — install TermBeam and run a local instance