An AI coding agent built on Vercel AI SDK with a beautiful terminal interface.
- Multi-Model Support - Works with OpenAI, Ollama, and other providers via Vercel AI SDK
- Terminal UI - Beautiful React-based terminal interface using Ink
- Tool Approval - Interactive approval flow for sensitive operations
- Subagent System - Delegate complex tasks to context-isolated subagents
- Skill System - On-demand domain knowledge loading
- Context Compaction - Infinite sessions with three-layer compression
- Sandbox Execution - Isolated command execution environment
This is a pnpm monorepo with three packages:
| Package | Description |
|---|---|
@my-agent/core |
Core AI agent, tools, environment abstraction, and Vercel AI SDK integration |
@my-agent/cli |
Terminal CLI using Ink (React for terminal) |
@my-agent/extension |
Browser extension using WXT framework |
- Node.js 18+
- pnpm 8+
# Clone the repository
git clone https://github.com/MrWangJustToDo/MyAgent.git
cd MyAgent
# Install dependencies
pnpm install
# Build all packages
pnpm buildCreate a .env file in the root directory:
# OpenAI API Key (for OpenAI models)
OPENAI_API_KEY=sk-xxx
# Or use Ollama (local models)
OLLAMA_BASE_URL=http://localhost:11434
# Sandbox environment: local | native | remote
SANDBOX_ENV=local# Start the CLI
pnpm start:cli
# Or run in development mode
pnpm dev:clipnpm run dev:webThe agent comes with a comprehensive set of tools:
read_file- Read file contents with line numberswrite_file- Write content to filesedit_file- Make precise edits to filesglob- Find files by patterngrep- Search file contentstree- Display directory structure
run_command- Execute shell commandslist_file- List directory contents
websearch- Search the web using Googlewebfetch- Fetch and parse web pages
task- Delegate tasks to subagentstodo- Manage task listscompact- Manually compress conversation contextlist_skills/load_skill- Load domain-specific knowledge
# Run all packages in watch mode
pnpm dev
# Type check
pnpm typecheck
# Lint and format
pnpm lint
pnpm format
# Build specific packages
pnpm build:core
pnpm build:cli
pnpm build:extension- Vercel AI SDK - AI SDK for LLM interactions
- Ink - React for terminal UIs
- Zod - Schema validation
- WXT - Browser extension framework
| Key | When Running | When Idle |
|---|---|---|
Esc |
Abort current run | Exit app |
Ctrl+C |
Exit app | Exit app |
Y |
Approve tool | - |
N |
Deny tool | - |
Contributions are welcome! Please read the AGENTS.md file first to understand the coding conventions and architectural patterns.
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure tests pass and code is formatted
- Submit a pull request
MIT
Built with Vercel AI SDK and Ollama





