GitHub Issues Integration
June 12, 2026 · View on GitHub
Setup
1. Get Personal Access Token
- Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Give it a descriptive name
- Select required scopes:
repo- For private repositories (full access)public_repo- For public repositories only
- Click "Generate token"
- Copy the token immediately (you won't see it again)
2. Environment Configuration
export GITHUB_TOKEN="your_github_personal_access_token_here"
3. Plugin Configuration
require("comment-tasks").setup({
providers = {
github = {
enabled = true,
api_key_env = "GITHUB_TOKEN",
repo_owner = "username", -- Required: GitHub username or organization
repo_name = "repository", -- Required: Repository name
}
}
})
4. Repository Information
Get your repository details from the GitHub URL:
https://github.com/[owner]/[repository]
↳ ↳
repo_owner repo_name
Usage
Commands
:GitHubTask new " Create new issue
:GitHubTask close " Close existing issue
:GitHubTask addfile " Add current file reference to issue
Status Management
GitHub Issues use a simple open/closed model:
new→ Creates issue in "open" stateclose→ Closes the issue
Example Workflow
-
Create an issue:
// TODO: Add input validation for user registration form // This should check email format and password strengthPlace cursor on comment →
:GitHubTask new// TODO: Add input validation for user registration form // This should check email format and password strength // https://github.com/username/repo/issues/123 -
Add file reference:
:GitHubTask addfile " Adds current file to issue description -
Close when finished:
:GitHubTask close " Closes the issue
Configuration Options
Basic Configuration
github = {
enabled = true,
api_key_env = "GITHUB_TOKEN",
repo_owner = "your-username",
repo_name = "your-repository",
}
Custom Environment Variable
github = {
enabled = true,
api_key_env = "MY_GITHUB_TOKEN", -- Use a different env var name
repo_owner = "your-organization",
repo_name = "your-repository",
}
Troubleshooting
"Authentication Failed" or "401 Unauthorized"
- Check token: Verify
GITHUB_TOKENenvironment variable is set - Token permissions: Ensure token has correct scopes (
repoorpublic_repo) - Token expiry: Check if token has expired and regenerate if needed
"Repository Not Found" or "404 Error"
- Verify repository: Ensure
repo_ownerandrepo_nameare correct - Check access: Verify token has access to the repository
- Private repos: Ensure token has
reposcope for private repositories
"Rate Limit Exceeded"
GitHub has API rate limits:
- Authenticated requests: 5,000 per hour
- Search API: 30 per minute
Solutions:
- Wait for rate limit reset
- Use more specific operations
- Consider GitHub Apps for higher limits
Issues Not Linking Properly
- Check URL format: Ensure issue URLs are valid GitHub issue links
- Repository match: Verify the issue belongs to the configured repository
- Permissions: Ensure you have read access to the issues
API Reference
GitHub Issues uses the GitHub REST API v3. The plugin makes requests to:
POST /repos/{owner}/{repo}/issues- Create issuesPATCH /repos/{owner}/{repo}/issues/{number}- Update issuesGET /repos/{owner}/{repo}/issues/{number}- Get issue detailsPOST /repos/{owner}/{repo}/issues/{number}/comments- Add comments
Integration Tips
- Use descriptive titles: The plugin extracts meaningful titles from comments
- Add context: Include relevant code context in issue descriptions
- Link files: Use
:GitHubTask addfileto reference source locations - Label consistently: Use consistent labeling for better organization
- Cross-reference: Reference related issues using #123 syntax
Multiple Repositories
To target a different repository per project, place a .comment-tasks.json
file at each project's root — repo_owner and repo_name are overridable
there:
{
"providers": {
"github": { "repo_owner": "company", "repo_name": "frontend-app" }
}
}
See the Configuration Reference for details.