A Node.js-based agent application powered by Claude via the Vercel AI SDK. Showcasing that core AI agent functionality can be implemented as simply as possible.
- agent.ts: 123 lines
- index.ts: 51 lines
- read-file.ts: 27 lines
- list-files.ts: 35 lines
- edit-file.ts: 58 lines
- types.ts: 3 lines
- Total: 297 lines
- Clone the repository:
git clone [repository-url] cd code-agent-node - Install dependencies:
npm install
- Build the project:
npm run build
- Configure environment variables:
Create a
.envfile in the root directory based on.env.exampleand add yourANTHROPIC_API_KEY.ANTHROPIC_API_KEY=your_anthropic_api_key_here
To start the agent:
npm startPrompt your agent:
You: Create fizzbuzz.js with fizzbuzz implementation that can be run using NodeJS
Claude: <magic>Type exit to quit the agent.
To run unit tests:
npm testTo run tests with coverage:
npm run test:coverageThis repo is the TypeScript implementation of How to Build an Agent by Amp.