|
1 | | -# Claude Code Automation MVP |
| 1 | +# Async Code Agent |
2 | 2 |
|
3 | | -An MVP application that automates coding tasks using Claude Code or Codex CLI in sandboxed environments. Users can submit text prompts describing what they want to develop for a configured GitHub repository, and the selected AI model will analyze the codebase, make the necessary changes, and create commits that can be turned into pull requests. |
| 3 | +Use Claude Code / CodeX CLI to perform multiple tasks in parallel with a Codex-style UI. |
4 | 4 |
|
5 | | -## Features |
| 5 | +A code agent task management system that provides parallel execution of AI-powered coding tasks. Users can run multiple Claude Code agents simultaneously through a Codex-style web interface, with support for different agents for comparison and evaluation. |
6 | 6 |
|
7 | | -- 🤖 **Multiple AI Models**: Choose between Claude Code and Codex CLI for code generation |
8 | | -- 🐳 **Sandboxed Execution**: Runs AI models in isolated Docker containers for security |
9 | | -- 🔄 **Git Integration**: Automatically clones repositories, makes commits, and creates pull requests |
10 | | -- 🌐 **Web Interface**: Clean, modern UI for submitting prompts and reviewing changes |
11 | | -- 📊 **Real-time Status**: Live updates on task progress and completion |
12 | | -- 🔍 **Git Diff Viewer**: Review all changes before creating pull requests |
13 | | -- 🎯 **Model Comparison**: Easily compare outputs from different AI models |
| 7 | +## Key Features |
| 8 | + |
| 9 | +- 🤖 **Multi-Agent Support**: Run Claude Code and other AI agents in parallel |
| 10 | +- 🔄 **Parallel Task Management**: Execute multiple coding tasks simultaneously |
| 11 | +- 🌐 **Codex-Style Web UI**: Clean interface for managing agent tasks |
| 12 | +- 🔍 **Agent Comparison**: Compare outputs from different AI models |
| 13 | +- 🐳 **Containerized Execution**: Secure sandboxed environment for each task |
| 14 | +- 🔗 **Git Integration**: Automatic repository cloning, commits, and PR creation |
| 15 | +- **Selfhost**: Deploy you rown parallel code agent platform. |
14 | 16 |
|
15 | 17 | ## Architecture |
16 | 18 |
|
17 | 19 | - **Frontend**: Next.js with TypeScript and TailwindCSS |
18 | 20 | - **Backend**: Python Flask API with Docker orchestration |
19 | | -- **AI Models**: |
20 | | - - Claude Code (Anthropic) - Advanced coding model |
21 | | - - Codex CLI (OpenAI) - Lightweight coding agent |
22 | | -- **Git Operations**: GitHub API integration for repository management |
23 | | - |
24 | | -## Prerequisites |
25 | | - |
26 | | -- Docker and Docker Compose |
27 | | -- [Anthropic API Key](https://console.anthropic.com/) for Claude Code |
28 | | -- GitHub Personal Access Token with repo permissions |
| 21 | +- **Agents**: Claude Code (Anthropic) with extensible support for other models |
| 22 | +- **Task Management**: Parallel execution system based on container |
29 | 23 |
|
30 | 24 | ## Quick Start |
31 | 25 |
|
32 | | -1. **Clone and Build** |
| 26 | +1. **Setup** |
33 | 27 | ```bash |
34 | 28 | git clone <this-repo> |
35 | | - cd <repo-directory> |
| 29 | + cd async-code |
36 | 30 | ./build.sh |
37 | 31 | ``` |
38 | 32 |
|
39 | | -2. **Configure Environment** |
40 | | - - Edit `server/.env` with your Anthropic API key |
41 | | - - The build script will create this file from the example |
| 33 | +2. **Configure** |
| 34 | + - Add your Anthropic API key to `server/.env` |
| 35 | + - Get a GitHub Personal Access Token with repo permissions |
42 | 36 |
|
43 | | -3. **Access the Application** |
| 37 | +3. **Run** |
44 | 38 | - Frontend: http://localhost:3000 |
45 | 39 | - Backend API: http://localhost:5000 |
46 | 40 |
|
47 | | -4. **Get a GitHub Token** |
48 | | - - Go to GitHub Settings > Developer settings > Personal access tokens |
49 | | - - Create a token with `repo` permissions |
50 | | - - Use this token in the frontend interface |
51 | | - |
52 | 41 | ## Usage |
53 | 42 |
|
54 | | -1. **Setup GitHub Token**: Click "Setup GitHub Token" in the frontend and enter your token |
55 | | -2. **Configure Repository**: Enter the GitHub repository URL and branch |
56 | | -3. **Select AI Model**: Choose between Claude Code or Codex CLI |
57 | | -4. **Enter Prompt**: Describe what you want the AI to develop |
58 | | -5. **Start Task**: Click "Code" to begin the automation process |
59 | | -6. **Review Changes**: View the git diff when the task completes |
60 | | -7. **Create PR**: If satisfied with changes, click "Create PR" |
61 | | - |
62 | | -## Example Prompts |
63 | | - |
64 | | -- "Add a new API endpoint for user authentication" |
65 | | -- "Fix the responsive design issues on mobile" |
66 | | -- "Add error handling to the database connection logic" |
67 | | -- "Implement input validation for the contact form" |
68 | | -- "Update the styling to match the new design system" |
| 43 | +1. **Setup GitHub Token**: Enter your GitHub token in the web interface |
| 44 | +2. **Configure Repository**: Specify target repository and branch |
| 45 | +3. **Select Agent**: Choose your preferred AI agent (Claude Code, etc.) |
| 46 | +4. **Submit Tasks**: Start multiple coding tasks in parallel |
| 47 | +5. **Compare Results**: Review and compare outputs from different agents |
| 48 | +6. **Create PRs**: Generate pull requests from successful tasks |
69 | 49 |
|
70 | 50 | ## Environment Variables |
71 | 51 |
|
72 | | -### Backend (`server/.env`) |
73 | 52 | ```bash |
| 53 | +# server/.env |
74 | 54 | ANTHROPIC_API_KEY=your_anthropic_api_key_here |
75 | | -FLASK_ENV=development |
76 | | -FLASK_DEBUG=True |
| 55 | +FLASK_ENV=production |
77 | 56 | ``` |
78 | 57 |
|
79 | | -## API Endpoints |
80 | | - |
81 | | -- `POST /start-task` - Start a new automation task (supports `model` parameter: "claude" or "codex") |
82 | | -- `GET /task-status/<task_id>` - Get task status and progress (includes model used) |
83 | | -- `GET /git-diff/<task_id>` - Retrieve git diff for completed tasks |
84 | | -- `POST /create-pr/<task_id>` - Create a pull request from completed task |
85 | | - |
86 | | -## Security Considerations |
87 | | - |
88 | | -For this MVP: |
89 | | -- GitHub tokens are handled client-side only |
90 | | -- Tasks run in isolated Docker containers |
91 | | -- No persistent storage of sensitive data |
92 | | -- Direct API communication with Anthropic |
93 | | - |
94 | | -For production: |
95 | | -- Implement proper authentication system |
96 | | -- Use GitHub Apps instead of personal tokens |
97 | | -- Add rate limiting and request validation |
98 | | -- Implement proper secret management |
99 | 58 |
|
100 | 59 | ## Development |
101 | 60 |
|
102 | | -### Running Locally |
103 | 61 | ```bash |
104 | | -# Start all services |
| 62 | +# Run all services |
105 | 63 | docker-compose up |
106 | 64 |
|
107 | | -# View logs |
108 | | -docker-compose logs -f |
109 | | - |
110 | | -# Stop all services |
111 | | -docker-compose down |
| 65 | +# Development mode |
| 66 | +cd async-code-web && npm run dev # Frontend |
| 67 | +cd server && python main.py # Backend |
112 | 68 | ``` |
113 | 69 |
|
114 | | -### Frontend Development |
115 | | -```bash |
116 | | -cd async-code-web |
117 | | -npm install |
118 | | -npm run dev |
119 | | -``` |
120 | | - |
121 | | -### Backend Development |
122 | | -```bash |
123 | | -cd server |
124 | | -pip install -r requirements.txt |
125 | | -python main.py |
126 | | -``` |
127 | | - |
128 | | -## Limitations (MVP) |
129 | | - |
130 | | -- No user authentication system |
131 | | -- In-memory task storage (resets on restart) |
132 | | -- Basic error handling |
133 | | -- Single concurrent task per instance |
134 | | -- No task persistence across restarts |
135 | | - |
136 | | -## Future Enhancements |
137 | | - |
138 | | -- User authentication and session management |
139 | | -- Database persistence (Supabase integration planned) |
140 | | -- Multiple concurrent tasks |
141 | | -- GitHub App integration |
142 | | -- Advanced task scheduling |
143 | | -- Webhook support for repository events |
144 | | -- Task history and analytics |
145 | | - |
146 | | -## Troubleshooting |
147 | | - |
148 | | -### Common Issues |
149 | | - |
150 | | -1. **Docker permission errors**: Ensure your user is in the docker group |
151 | | -2. **Port conflicts**: Change ports in docker-compose.yml if needed |
152 | | -3. **API key errors**: Verify your Anthropic API key is correctly set |
153 | | -4. **GitHub token issues**: Ensure token has proper repo permissions |
154 | | - |
155 | | -### Logs |
156 | | -```bash |
157 | | -# View all logs |
158 | | -docker-compose logs |
159 | | - |
160 | | -# View specific service logs |
161 | | -docker-compose logs backend |
162 | | -docker-compose logs frontend |
163 | | -``` |
164 | | - |
165 | | -## Contributing |
166 | | - |
167 | | -This is an MVP implementation. For production use, consider implementing: |
168 | | -- Proper error handling and validation |
169 | | -- Security hardening |
170 | | -- Performance optimizations |
171 | | -- Comprehensive testing |
172 | | -- Monitoring and logging |
173 | 70 |
|
174 | 71 | ## License |
175 | 72 |
|
|
0 commit comments