This project is an experimental tool that leverages Anthropic's Agent SDK to automatically generate code based on user requirements. It utilizes the Anthropic API to power its AI capabilities.
This agent is designed to take high-level specifications and implement them in code, streamlining the development process and reducing manual coding effort. The agent runs in non-interactive mode, making it suitable for automated workflows.
- Automatic code generation from user requirements
- Integration with Anthropic's Agent SDK
- Non-interactive operation for seamless automation
- Docker support for containerized execution
- Node.js 20+ (for local development)
- Docker & Docker Compose (for containerized execution)
- Anthropic API key (set via
ANTHROPIC_API_KEYenvironment variable)
- Clone the repository:
git clone https://github.com/nnance/agent-auto-coder.git- Navigate to the project directory:
cd agent-auto-coder- Install dependencies:
npm install- Create a
.envfile with your API key:
echo "ANTHROPIC_API_KEY=your-key-here" > .env- Run the agent:
npm start "Your prompt here"docker build -t agent-auto-coder .docker run --env ANTHROPIC_API_KEY=your-key-here agent-auto-coder "Your prompt here"Or using environment file:
docker run --env-file .env agent-auto-coder "Your prompt here"- Ensure your
.envfile containsANTHROPIC_API_KEY:
echo "ANTHROPIC_API_KEY=your-key-here" > .env- Run the container:
docker-compose run --rm agent-coder "Your prompt here"Or with a specific prompt in the docker-compose.yml:
docker-compose run --rm agent-coderGenerate a utility function:
docker run --env-file .env agent-auto-coder "Create a function that validates email addresses"Refactor existing code (from local file mounted as volume):
docker run --env-file .env -v $(pwd):/app/input agent-auto-coder "Refactor the code in input/utils.js to improve performance"npm run build- Compile TypeScript to JavaScriptnpm start- Run the agent with a prompt argumentnpm run lint- Run Biome linternpm run format- Format code with Biome
ANTHROPIC_API_KEY- Your Anthropic API key (required)
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.