Skip to content

minpeter/code-editing-agent

Repository files navigation

Code Editing Agent

A code-editing agent built with Vercel AI SDK and FriendliAI provider, following the architecture described in ampcode.com/how-to-build-an-agent.

Requirements

  • Bun >= 1.0
  • FriendliAI API token

Installation

Quick Start (via bunx)

Run directly without installation:

export FRIENDLI_TOKEN=your_token_here
bunx github:minpeter/agent#main

Global Installation

bun install -g github:minpeter/agent
export FRIENDLI_TOKEN=your_token_here
code-editing-agent

Local Development

  1. Clone the repository:
git clone https://github.com/minpeter/code-editing-agent.git
cd code-editing-agent
  1. Install dependencies:
bun install
  1. Set your FriendliAI token:
export FRIENDLI_TOKEN=your_token_here
  1. Run the agent:
bun start

Usage

$ bun start

Chat with AI (model: LGAI-EXAONE/K-EXAONE-236B-A23B)
Use '/help' for commands, 'ctrl-c' to quit

You: what's in package.json?
tool: read_file({"path":"package.json"})
AI: The package.json file contains...

You: create a hello.js file that prints "Hello World"
tool: edit_file({"path":"hello.js","old_str":"","new_str":"console.log('Hello World');"})
AI: I've created hello.js...

You: /help
Available commands:
  /help              - Show this help message
  /clear             - Clear current conversation
  /model             - Show and select available AI models
  /render            - Render conversation as raw prompt text
  /quit              - Exit the program

You: ^C

Model

Uses LGAI-EXAONE/K-EXAONE-236B-A23B via FriendliAI serverless endpoints by default. Use /model command to switch models.

License

MIT

About

To become a vibe coder who understands vibe, Building a Coding Agent

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •