A Node.js library and CLI tool for listing and synchronizing GitHub issues between repositories. Perfect for repository migrations, issue management dashboards, and automation workflows.
- 📋 List and filter GitHub issues with advanced options
- 🔄 Sync issues between repositories with metadata preservation
- 🏷️ Smart duplicate detection and automatic label creation
- 🛠️ Dual interface: Use as CLI tool or integrate as a library
- 🔧 Extensible: Easy to integrate into web apps, CI/CD, or VS Code extensions
# CLI tool
npm install -g issuesync
# Library
npm install issuesyncGet a GitHub Personal Access Token with repo scope:
# Set environment variable
export GITHUB_TOKEN=your_token_here
# Or create .env file
echo "GITHUB_TOKEN=your_token_here" > .envList issues:
issuesync list --owner microsoft --repo vscode --state open --labels bug,enhancementSync issues:
issuesync sync --source-owner facebook --source-repo react --target-owner myorg --target-repo react-forkconst issueSync = require('issuesync');
// Initialize (token optional if env var set)
issueSync.init({ token: 'your_token' });
// List issues
const issues = await issueSync.listIssues({
owner: 'microsoft',
repo: 'vscode',
state: 'open',
labels: 'bug,enhancement'
});
// Sync issues
const result = await issueSync.syncIssues({
sourceOwner: 'sourceOwner',
sourceRepo: 'sourceRepo',
targetOwner: 'targetOwner',
targetRepo: 'targetRepo',
syncComments: true
});
console.log(`Created: ${result.created.length}, Skipped: ${result.skipped.length}`);app.get('/issues', async (req, res) => {
const issues = await issueSync.listIssues({ owner: 'myorg', repo: 'project' });
res.json(issues);
});// Sync issues after deployment
await issueSync.syncIssues({
sourceOwner: 'internal', sourceRepo: 'app',
targetOwner: 'client', targetRepo: 'app',
labels: 'client-visible'
});const issues = await issueSync.listIssues({ owner, repo });
const selected = await vscode.window.showQuickPick(
issues.map(i => ({ label: i.title, description: `#${i.number}` }))
);More examples: ./examples/ | Integration guide: ./docs/integration-guide.md
Initialize with GitHub token.
options.token- GitHub token (optional ifGITHUB_TOKENenv var set)
List repository issues.
owner,repo- Repository details (required)state-'open','closed','all'(default:'open')labels- Comma-separated labels filterverbose- Show detailed info
Sync issues between repositories.
sourceOwner,sourceRepo- Source repository (required)targetOwner,targetRepo- Target repository (required)state,labels- Filter optionssyncComments- Include comments (default:true)
Returns: { created: [], skipped: [], total: number }
Requirements:
- Node.js v14+
- GitHub Personal Access Token with
reposcope
Limitations:
- Rate limits may require multiple runs for large repos
- Duplicate detection uses issue title matching
- Original authors not preserved (issues created by token owner)
Contributions welcome! Please submit a Pull Request.