# Fork the repo on GitHub, then clone your fork
git clone https://github.com/<your-username>/chatcops.git
cd chatcops
# Add upstream remote
git remote add upstream https://github.com/codercops/chatcops.git
# Install dependencies
pnpm install
# Build all packages
pnpm -r build
# Run tests
pnpm test
# Typecheck
pnpm -r typecheckpackages/
core/ - @chatcops/core (AI providers, tools, knowledge base)
widget/ - @chatcops/widget (embeddable chat UI)
server/ - @chatcops/server (server handler + adapters)
website/ - Marketing site + Starlight docs (Astro)
- Sync your fork's
devbranch with upstream:git fetch upstream git checkout dev git merge upstream/dev
- Work directly on your fork's
devbranch — commit and push as you go - Run tests:
pnpm test - Run typecheck:
pnpm -r typecheck - Add a changeset if your changes affect published packages:
pnpm changeset - When ready, open a PR from your fork's
dev→ upstreamdev
dev— default branch, all development happens hereproduction— release branch, merged fromdevwhen cutting a release- PRs should target
devunless you're doing a production release
When dev is ready to ship:
-
Ensure all changes that affect published packages have changesets:
pnpm changeset
This creates a changeset file describing the version bump (patch/minor/major) and a summary. Commit it to
dev. -
Create a PR from
dev→productionand merge it. -
The Release workflow runs automatically on
productionpush:- Builds, typechecks, and tests everything
- If unreleased changesets exist, Changesets action opens a "Version Packages" PR on
productionthat bumps versions and updates changelogs - Merging that PR triggers the workflow again, which publishes to npm (via OIDC trusted publishing)
-
The website is auto-deployed by the Vercel GitHub integration — no manual step needed.
Note: Only maintainers can merge into
production. If you're a contributor, just make sure your PR todevincludes a changeset when needed.
# Build widget in watch mode
cd packages/widget
pnpm dev
# Open dev.html in a browser for live testingTo test with a real backend, run the Express example:
cd packages/server
ANTHROPIC_API_KEY=sk-... npx tsx src/examples/express-server.ts- Create
packages/core/src/providers/{name}.ts - Implement the
AIProviderinterface - Add a format converter in
base.ts - Register in the
createProviderfactory - Export from
index.ts - Add tests
- Create
packages/core/src/i18n/{code}.ts - Export all
LocaleStringsfields - Register in
packages/core/src/i18n/index.ts - Add to the test in
tests/i18n/locales.test.ts
cd website
pnpm devThe website requires a .env.local file with:
# Required — powers the live chat demo on the landing page
OPENAI_API_KEY=sk-...
# Optional — visitor counter (Upstash Redis)
UPSTASH_REDIS_REST_URL=https://your-endpoint.upstash.io
UPSTASH_REDIS_REST_TOKEN=your-token-hereThe visitor counter gracefully degrades without Upstash credentials (displays -). Google Analytics (G-GLYL9J6QYX) is hardcoded in the layout and Starlight config.
Use conventional commits: feat:, fix:, chore:, docs:, test:, refactor: