This tutorial shows how to use Aider's /run
command to work with GitHub issues using the GitHub CLI.
- GitHub CLI (
gh
) installed and authenticated - Aider installed
- A GitHub repository with issues
First, start Aider in your repository:
aider
To see the open issues in your repository:
/run gh issue list
To view details of a specific issue:
/run gh issue view 123 # Replace 123 with the issue number
To create and switch to a branch for working on an issue:
/run gh issue develop 123 -b fix-issue-123
This creates a new branch (named fix-issue-123
) and checks it out.
Now you can use Aider to implement the solution by explaining what needs to be done:
I need to implement a solution for issue #123 which requires [describe the requirement].
Run tests to verify your changes:
/run npm test # Or any appropriate test command for your project
You can ask Aider to commit the changes:
Please commit these changes with an appropriate commit message.
Or manually commit using GitHub CLI:
/run git add .
/run git commit -m "Fix issue #123: [brief description]"
Create a pull request to merge your changes:
/run gh pr create --title "Fix issue #123" --body "This PR addresses issue #123 by implementing [description]"
Close the issue when the PR is merged:
/run gh issue close 123 --reason completed
List pull requests:
/run gh pr list
Check PR status:
/run gh pr status
Add a comment to an issue:
/run gh issue comment 123 --body "I've implemented a fix in PR #456"
Here's a practical example of a complete workflow:
# Start Aider in your repository
aider
# List open issues
/run gh issue list
# View details of issue #123
/run gh issue view 123
# Create a branch for the issue
/run gh issue develop 123 -b fix-issue-123
# Implement the solution with Aider
I need to fix the validation in user_controller.js for issue #123
# Test the changes
/run npm test
# Create a PR
/run gh pr create --title "Fix validation in user_controller.js" --body "Fixes #123 by adding proper input validation"
# Check PR status
/run gh pr status
- Use
/run
to execute any shell command within Aider - Take advantage of GitHub CLI's tab completion in your terminal before copying commands to Aider
- Use the
--file
option when starting Aider to focus on specific files:aider --file user_controller.js
- Remember that Aider will auto-commit changes if you've enabled auto-commits
- Use
/help
in Aider to see available commands
This workflow combines the power of Aider's AI capabilities with GitHub CLI's repository management features, allowing you to manage issues and implement solutions without leaving your terminal.