This project demonstrates a fully autonomous coding agent capable of performing software development tasks in a Daytona sandbox environment. The agent is built using AgentKit and leverages Daytona sandboxes for secure, isolated execution. The agent can create simple web apps, run tests, execute scripts, and more - all by reasoning about the user's request and automating the necessary steps.
- Multi-language support: The agent can use any language supported by Daytona sandboxes
- Web app creation: Automatically scaffolds and builds simple web applications.
- Dev server orchestration: Detects when a development server is needed, starts it, and generates a preview link for live app inspection.
- File and directory management: Creates, uploads, reads, and deletes files and directories as needed.
- Script and test execution: Runs arbitrary scripts and test suites.
- Automated reasoning: Plans and executes multi-step development workflows based on user prompts.
- Debug logging: Detailed agent flow tracking enabled via
enableDebugLogs=true.
- Node.js: Version 18 or higher is required.
To run the coding agent, you need to set the following environment variables:
DAYTONA_API_KEY: Required for access to Daytona sandboxes. Get it from Daytona DashboardANTHROPIC_API_KEY: Because Anthropic is the default model provider, you must setANTHROPIC_API_KEYin your environment. By default the agent usesclaude-3-5-haiku-20241022model with a preset token limit.
Note
You can change the token setting and the model (see all available Anthropic models at AgentKit Supported Models). To use a different model provider, follow the instructions at AgentKit Model Setup.
See the .env.example file for the exact structure and variable names. Copy .env.example to .env and fill in your API keys before running the agent.
Before proceeding with either Local or Docker setup, complete the following steps:
- Clone this repository to your local machine
- Copy
.env.exampleto.envand add your API keys
-
Install dependencies:
npm install
-
Run the agent:
npm run start
-
Build the Docker image:
docker buildx build . -t coding-agent -
Run the container:
docker run --rm -it coding-agent
-
Prompt Setting: The main prompt for the agent is configured in the
network.run(...)call insidesrc/index.ts. You can edit this prompt to change the agent's task or try different app ideas and workflows. -
Debug Logs: Detailed agent flow tracking is enabled by setting
enableDebugLogs=true. This will log all agent iterations and tool actions for transparency and troubleshooting.
To showcase the agent, try running the default prompt in src/index.ts:
const result = await network.run(
`Create a minimal React app called "Notes" that lets users add, view, and delete notes. Each note should have a title and content. Use Create React App or Vite for setup. Include a simple UI with a form to add notes and a list to display them.`
);The agent will:
- Scaffold the app
- Install dependencies
- Start the dev server
- Generate a preview link for you to view the app
You can inspect the terminal logs to monitor what the agent is doing, observe its evolution, and see how it corrects mistakes from errors during the process.
When the agent finishes, you should see terminal output like:
✔️ App is ready! Preview: https://5173-3a828150-1573-42e3-bf9f-9793a2c2c0c2.proxy.daytona.works
You can view the app on the given preview link above. The image below shows the result generated in this run:
ISC
