Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 2.64 KB

File metadata and controls

74 lines (54 loc) · 2.64 KB

Contributing

Thanks for your interest in improving the OpenCode Telegram Bot!

Development setup

git clone https://github.com/artickc/opencode-telegram-bot.git
cd opencode-telegram-bot
npm install
cp .env.example .env   # add your TELEGRAM_BOT_TOKEN and ALLOWED_USERS
npm run dev            # auto-reload on changes

No build step is required — the project runs TypeScript directly via tsx.

Before opening a pull request

  • npm run typecheck must pass with no errors.
  • Keep files focused and under ~500 lines; prefer small modules.
  • Match the existing style (ESM imports with .js specifiers, named exports).
  • Don't introduce new dependencies without a good reason.
  • Never commit .env, tokens, logs, or generated launcher files.

Project layout

See the "Project layout" section in the README. In short:

  • src/opencode — OpenCode ACP bridge: client (opencode acp), transport, types
  • src/sessions — session discovery, history, live tail
  • src/render — Markdown → Telegram MarkdownV2, diffs, tool formatting
  • src/bot — grammY bot, handlers, per-chat runtime
  • src/service — cross-platform daemon install (Windows/Linux/macOS)

Branch, PR & release workflow

Work is delivered as batches of small, focused branches opened as pull requests, then merged and shipped together in the next versioned release. Please don't push feature work straight to main.

  1. Branch off the latest main, one logical change per branch (git checkout -b feat/<topic>).
  2. Implement it and make sure npm run typecheck passes.
  3. Open a PR to main (gh pr create --base main --fill). CI runs typecheck.
  4. Several ready PRs are merged in sequence as a batch.
  5. If a branch falls behind, update it from main (git merge origin/main), resolve conflicts keeping both sides' intent, re-run typecheck, then merge.

How releases are cut

Releases are automated. Pushing a vX.Y.Z tag runs .github/workflows/release.yml, which type-checks, builds a clean downloadable zip, and publishes a GitHub Release using the matching CHANGELOG.md section as the notes:

# update CHANGELOG.md, then:
npm version minor          # patch | minor | major
git push --follow-tags

See docs/ops/RELEASE_CHECKLIST.md for the full pre-release checklist.

Reporting bugs

Open an issue using the bug template. Include your OS, Node version, OpenCode version (opencode --version), and relevant log lines from logs/opencode-telegram-bot.log (redact any secrets).

Code of Conduct

By participating you agree to abide by the Code of Conduct.