Thanks for your interest in contributing! This guide summarizes how to set up the project, run it locally, write tests, and open high‑quality pull requests.
bin/cc-web.js: CLI entry; parses flags and starts the server.src/server.js: Express + WebSocket server, routes, session wiring.src/claude-bridge.jsandsrc/codex-bridge.js: spawn and manage CLI sessions vianode-pty.src/utils/*: helpers (auth token handling, session persistence).src/public/*: browser UI assets (HTML/JS/CSS) served by the server.test/*.test.js: Mocha unit tests for bridges/utilities.
- Node.js >= 16
- Claude/Code CLI installed and available on
PATH
git clone <repository>
cd claude-code-web
npm install
npm run dev # or: npm start- Dev mode:
npm run dev(equivalent tonode bin/cc-web.js --dev). - Normal mode:
npm start(equivalent tonode bin/cc-web.js). - Custom port:
node bin/cc-web.js --port 8080. - Auth token:
node bin/cc-web.js --auth <token>.
- Framework: Mocha with Node’s
assert. - Location:
test/directory; name tests as*.test.js. - Run:
npm test. - Guidelines:
- Write fast, isolated unit tests.
- Avoid network and real CLI calls — mock process spawns where possible.
- Use temp dirs under
test/(seesession-store.test.js).
- Language: Node.js (CommonJS).
- Indentation: 2 spaces; use semicolons; prefer single quotes.
- File naming: kebab‑case for modules, PascalCase for classes, camelCase for functions/variables.
- No linters/formatters are configured; match existing style and keep diffs minimal.
Follow Conventional Commits. Examples:
feat: add multi-session persistencefix(auth): do not log tokenschore(release): v2.1.0
- Keep PRs focused and narrowly scoped.
- Provide a concise description, reproduction steps, and risk/impact notes.
- Add or update tests for behavior changes.
- Update README/docs when flags, routes, or defaults change.
- Include screenshots/GIFs for UI-facing changes.
- Auth is enabled by default. Use
--auth <token>to set a token. - Avoid
--disable-authexcept in local dev; never commit or log tokens. - Prefer HTTPS in production:
--https --cert <path> --key <path>.
When filing an issue, include:
- Environment (OS, Node version, browser).
- Exact command(s) run and flags used.
- Expected vs. actual behavior and any logs (omit sensitive info).
We maintain a CHANGELOG.md. If your PR introduces user‑visible changes, please add an entry under the “Unreleased” section following Keep a Changelog style.
Main is protected. All releases must go through a pull request from a separate branch. The automated workflow will tag, create a GitHub release, and publish to npm after merge.
-
Ensure a clean working tree (
git statusis empty) and you are onmainsynced with origin. -
Run the release helper to prepare a PR (defaults to a patch bump):
- Patch:
npm run release:pr - Minor:
BUMP=minor npm run release:pr - Major:
BUMP=major npm run release:pr
This will:
- Bump the version in package files (no tag)
- Ensure
CHANGELOG.mdhas an entry for the new version - Create
release/vX.Y.Zbranch, commit, push, and open a PR
- Patch:
-
Review the PR, ensure CHANGELOG and notes are correct, then merge.
-
On merge to
main, the GitHub Actions workflow.github/workflows/release-on-main.ymlwill:- Create a tag
vX.Y.Zand a GitHub Release - Publish the package to npm (requires
NPM_TOKENsecret)
- Create a tag
Notes:
- Never push directly to
main. Branch protection will reject such pushes. - Ensure
secrets.NPM_TOKENis configured at the repository level for publishing. - The workflow runs on every merge to
mainand skips if a tag for the currentpackage.jsonversion already exists.
By contributing, you agree that your contributions will be licensed under the MIT License (see LICENSE).