Repository navigation
feat: add /repo and /pr slash commands for on-demand GitHub queries - #86
Merged
Kingvic300 merged 3 commits intoAug 30, 2026
Merged
Conversation
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Chigybillionz
force-pushed
the
feat/5-add-pr-repo-commands
branch
from
August 30, 2026 21:00
938dc8d to
a8e1414
Compare
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Text
// markdown
Add /repo and /pr on-demand Telegram commands
Summary
Add slash commands so the team can query GitHub state mid-conversation instead of scrolling through notification history.
Issue
Closes #5
Root Cause
The bot was entirely push-only — it only received GitHub webhook events and posted them to Telegram. There was no way for team members to query repository or PR status on demand.
Solution Implemented
Created a reusable GitHub REST API client and registered two new slash commands:
/repo <name>— fetches stars, forks, open issues, and open PR count for a tracked repo/pr <repo>#<number>— fetches PR title, state, review state, and CI statusBoth commands resolve short repo names (e.g. "backend") to full names (e.g. "txio-labs/txio-backend") using the existing repo routing config.
Key Changes
src/github/api.ts— reusable GitHub REST client with error handlingsrc/github/command-formatters.ts— response formatters for both commandssrc/telegram/client.ts— registered/repoand/prcommand handlerssrc/config.ts— addedresolveRepoName()andgetConfiguredRepos().env.example— documentedGITHUB_TOKENscope for new commandsREADME.md— added "On-Demand Commands" sectionAffected Files
src/github/api.ts— new REST client wrappersrc/github/command-formatters.ts— new response formatterssrc/telegram/client.ts— new command handlerssrc/config.ts— new repo name resolution functions.env.example— documentation updateREADME.md— documentation updatesrc/github/api.test.ts— new testssrc/github/command-formatters.test.ts— new tests (21)src/github/commands.test.ts— new tests (8)Trade-offs / Considerations
GITHUB_TOKENenv var rather than adding a new one — the token already needspull_requests:readscope for merge-conflict detectionREPO_ROUTING_CONFIG_PATH) being set — without it,/repoand/prwon't workTesting
Commands/checks performed:
npx tsc --noEmit— type check passednpm run build— build passednpx vitest run— 49/49 tests passed (21 new formatter tests, 8 new command tests, 4 new API tests, 16 existing tests)CI Verification
No GitHub Actions workflows exist in the repository. Local validation (typecheck, build, tests) all pass.
Please kindly review this task. If there are any corrections, improvements, adjustments, or merge conflicts that you notice regarding my implementation, I'd really appreciate your feedback. I'd also love to hear your overall review of my work on this branch.
Thank you!