{"id":29948417,"url":"https://github.com/wheeyls/remote-pair-programmer","last_synced_at":"2025-08-03T08:16:14.175Z","repository":{"id":290483947,"uuid":"974587983","full_name":"wheeyls/remote-pair-programmer","owner":"wheeyls","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-07T19:08:26.000Z","size":906,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:23:48.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wheeyls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-29T02:26:08.000Z","updated_at":"2025-05-07T19:08:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7513ac68-f33c-4cbb-abce-f9144fd3c170","html_url":"https://github.com/wheeyls/remote-pair-programmer","commit_stats":null,"previous_names":["wheeyls/remote-pair-programmer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wheeyls/remote-pair-programmer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fremote-pair-programmer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fremote-pair-programmer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fremote-pair-programmer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fremote-pair-programmer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wheeyls","download_url":"https://codeload.github.com/wheeyls/remote-pair-programmer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wheeyls%2Fremote-pair-programmer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512162,"owners_count":24261888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-03T08:16:09.258Z","updated_at":"2025-08-03T08:16:14.156Z","avatar_url":"https://github.com/wheeyls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub AI Coding Agent\n\nA GitHub Action that allows an AI to make code changes directly to your PR based on comments.\n\n## Architecture\n\nThis project uses a distributed architecture with two main components:\n\n1. **GitHub Action** - Enqueues jobs to a queue service when GitHub events occur\n2. **Worker** - Processes jobs from the queue, interacts with AI, and makes code changes\n\nThis separation allows for more reliable processing and better scalability.\n\n## Features\n\n- Responds to PR comments with AI-generated insights\n- Responds to line-specific review comments in PRs\n- Makes code changes and commits them directly to PRs\n- Works like a remote pair programmer you can access from anywhere\n\n## Usage\n\n### 1. Set up the GitHub Action\n\nAdd this to your repository's `.github/workflows/ai-agent.yml` file:\n\n```yaml\nname: AI Coding Agent\non:\n  pull_request:\n    types: [opened, synchronize, reopened]\n  issue_comment:\n    types: [created]\n  pull_request_review_comment:\n    types: [created]\n  issues:\n    types: [opened]\n\npermissions:\n  contents: write\n  pull-requests: write\n  issues: write\n\njobs:\n  process-event:\n    runs-on: ubuntu-latest\n    if: ${{ (github.event_name == 'pull_request') || (github.event_name == 'issue_comment' \u0026\u0026 github.event.issue.pull_request) }}\n    steps:\n      - uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n          ref: ${{ github.event.pull_request.head.ref }}\n      - uses: actions/setup-node@v3\n        with:\n          node-version: '20'\n      - name: Run AI Agent\n        uses: yourusername/github-ai-agent@v1\n        with:\n          queue-service-url: ${{ secrets.QUEUE_SERVICE_URL }}\n          queue-auth-token: ${{ secrets.QUEUE_AUTH_TOKEN }}\n          trigger-phrase: '@github-ai-bot'\n```\n\n### 2. Set up the Worker\n\nThe worker needs to be deployed separately, typically on a server or cloud service. It processes jobs from the queue and interacts with the AI service.\n\nExample worker setup:\n\n1. Clone the repository\n2. Create a `.env` file with your configuration:\n   ```\n   # Queue Configuration\n   QUEUE_SERVICE_URL=https://your-queue-service.com/api\n   QUEUE_AUTH_TOKEN=your-auth-token\n   \n   # AI Configuration (OpenAI)\n   AI_PROVIDER=openai\n   OPENAI_API_KEY=your-openai-api-key\n   AI_MODEL=gpt-4\n   \n   # Or for Anthropic\n   # AI_PROVIDER=anthropic\n   # ANTHROPIC_API_KEY=your-anthropic-api-key\n   # AI_MODEL=claude-3-5-sonnet-latest\n   \n   # Bot Configuration\n   BOT_TRIGGER_PHRASE=@github-ai-bot\n   ```\n3. Start the worker:\n   ```bash\n   npm install\n   node worker.js\n   ```\n\n## Configuration\n\n### Required Secrets for GitHub Action\n\n- `QUEUE_SERVICE_URL` - Your queue web service URL\n- `QUEUE_AUTH_TOKEN` - API token for queue service authentication (optional)\n\n### Required Environment Variables for Worker\n\n- `QUEUE_SERVICE_URL` - Your queue web service URL\n- `QUEUE_AUTH_TOKEN` - API token for queue service authentication (optional)\n- `AI_PROVIDER` - AI provider to use (openai or anthropic)\n- `OPENAI_API_KEY` - Your OpenAI API key (when using OpenAI provider)\n- `ANTHROPIC_API_KEY` - Your Anthropic API key (when using Anthropic provider)\n- `AI_MODEL` - Default AI model to use\n\n### GitHub Action Inputs\n\n| Input | Description | Required | Default |\n|-------|-------------|----------|---------|\n| `trigger-phrase` | Phrase to trigger the agent | No | `@github-ai-bot` |\n| `queue-service-url` | Web service URL for queue operations | Yes | N/A |\n| `queue-auth-token` | API token for queue service authentication | No | N/A |\n\n## File Context Directives\n\nThe AI agent can access additional files beyond those changed in the PR by using file context directives in your comments. This helps the AI understand more of your codebase to make better suggestions.\n\n### New Format (Recommended)\n\n```\n/add path/to/file.js src/**/*.js\n/ignore node_modules/ dist/\n```\n\n### Legacy Format\n\n```\n.add-files\n- path/to/file.js\n- src/**/*.js\n\n.ignore\n- node_modules/\n- dist/\n```\n\n### Directive Types\n\n- `/add` or `.add-files`: Specify additional files or glob patterns to include\n- `/ignore` or `.ignore`: Specify files or directories to exclude\n\n### Usage Tips\n\n- Use glob patterns to include multiple files (e.g., `src/**/*.js` for all JavaScript files in the src directory)\n- Add trailing slashes to directory names to ignore entire directories (e.g., `node_modules/`)\n- The AI will have access to:\n  1. Files changed in the PR\n  2. Files specified in add directives\n  3. Any additional context files provided by the action configuration\n\n## Examples\n\n### PR Comments\n\nComment on a PR with:\n\n```\n@github-ai-bot implement a function that sorts this array\n\n/add src/utils/*.js src/components/\n/ignore node_modules/ dist/\n```\n\nThe agent will:\n1. Analyze the PR context and the additional files specified\n2. Generate appropriate code changes\n3. Commit directly to the PR branch\n4. Reply with a summary of changes\n\n### Issues\n\nCreate a new issue with the trigger phrase in the title or body:\n\n```\nTitle: @github-ai-bot Add pagination to the user list\n\nBody:\nPlease implement pagination for the user list component.\nWe should show 10 users per page and add next/previous buttons.\n\n/add src/components/UserList.js src/styles/pagination.css\n```\n\nThe agent will:\n1. Create a new branch\n2. Make the requested changes\n3. Push the changes to the branch\n4. Comment on the issue with a link to create a PR\n\nNote: Due to GitHub Actions permissions limitations, the bot cannot create PRs directly. Instead, it will provide a link for you to create the PR manually.\n\n## Development\n\n### Project Structure\n\n```\n├── src/\n│   ├── commands/           # Command handlers for different GitHub events\n│   ├── utils/\n│   │   ├── queueClient.js  # Client for enqueuing jobs\n│   │   ├── workerQueue.js  # Worker for processing jobs\n│   │   └── queueFactory.js # Factory to create the appropriate queue\n│   ├── aiClient.js         # Client for AI service interactions\n│   ├── config.js           # Configuration management\n│   ├── handler.js          # GitHub Action entry point\n│   ├── index.js            # Worker initialization\n│   └── jobEnqueuer.js      # Job enqueuing logic\n├── worker.js               # Worker process entry point\n└── action.yml              # GitHub Action definition\n```\n\n### Architecture Flow\n\n1. **GitHub Event** → GitHub Action runs `handler.js`\n2. `handler.js` → Uses `jobEnqueuer.js` to enqueue a job\n3. `jobEnqueuer.js` → Creates a `QueueClient` to send job to queue service\n4. **Queue Service** → Stores job for processing\n5. `worker.js` → Runs continuously, polling for jobs\n6. `worker.js` → Uses `index.js` to initialize worker\n7. `index.js` → Creates a `WorkerQueue` and registers command handlers\n8. `WorkerQueue` → Fetches and processes jobs using registered handlers\n9. Command handlers → Use `AIClient` to generate responses and make changes\n\n## License\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheeyls%2Fremote-pair-programmer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwheeyls%2Fremote-pair-programmer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwheeyls%2Fremote-pair-programmer/lists"}