Skip to content
/ frame Public

A tiny Go CLI code-editing agent that chats with Claude/Codex and can read files, list directories, and edit files via tool calls. Built from a single main.go, it keeps conversation state, executes tool requests, and streams results back, demonstrating a minimal yet functional agent loop in under 400 lines.

Notifications You must be signed in to change notification settings

0dayfall/frame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frame

A tiny Go CLI code-editing agent that can chat with OpenAI or Anthropic models and use tools to read files, list directories, and edit files.

Features

  • Provider support: OpenAI or Anthropic
  • Minimal tool loop with file system tools
  • Single-file implementation (main.go)

Requirements

  • Go 1.25+
  • An API key for at least one provider
    • OpenAI: set OPENAI_API_KEY
    • Anthropic: set ANTHROPIC_API_KEY

Install

go mod tidy

Run

OpenAI (default when OPENAI_API_KEY is set)

export OPENAI_API_KEY="..."
go run main.go

Optional model override:

export OPENAI_MODEL="gpt-4o"
go run main.go

Anthropic

export ANTHROPIC_API_KEY="..."
go run main.go -provider anthropic

Optional model override:

export ANTHROPIC_MODEL="claude-3-7-sonnet-latest"
go run main.go -provider anthropic

Provider selection

The provider is chosen in this order:

  1. -provider flag
  2. AGENT_PROVIDER or PROVIDER env var
  3. If only one API key is set, use that
  4. If both are set, OpenAI is chosen by default

Tools

  • read_file: read a file by relative path
  • list_files: list files and directories under a path
  • edit_file: replace a string in a file or create a file

Notes

  • Tool calls are executed locally. Be cautious when running with access to sensitive files.
  • This is a minimal example intended for experimentation.

About

A tiny Go CLI code-editing agent that chats with Claude/Codex and can read files, list directories, and edit files via tool calls. Built from a single main.go, it keeps conversation state, executes tool requests, and streams results back, demonstrating a minimal yet functional agent loop in under 400 lines.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages