中文文档 | English
A powerful CLI-based multi-agent coding assistant powered by Claude Agent SDK.
Rust version available: rust-terminal-coding-agent
- Multi-Agent Architecture - Coordinator, Reader, Coder, Reviewer agents working together
- Smart Routing - Automatically routes tasks to the most suitable agent
- Skills System - Extensible skills for specialized tasks (code review, git commit, PDF analysis, etc.)
- Interactive UI -
/command menu and@file browser for easy interaction - Web Scraping - Built-in Playwright integration for web content extraction
- Deep Research - Dify-powered comprehensive research workflow
Built-in skills that extend the agent's capabilities:
| Skill | Description | Agent |
|---|---|---|
/code-review |
Analyze code quality, find bugs, security issues | Reviewer |
/git-commit |
Create well-structured conventional commits | Coder |
/pdf-analyze |
Extract text/tables from PDFs, fill forms | Reader |
/web-scrape |
Scrape web content with Playwright (internal) | Coordinator |
/deep-research |
Comprehensive research via Dify workflow (internal) | Coordinator |
Create skills in .claude/skills/<skill-name>/SKILL.md:
---
name: my-skill
description: Description of what this skill does
version: 1.0.0
allowed-tools:
- Read
- Write
- Bash
---
# My Custom Skill
Instructions for Claude on how to execute this skill...git clone https://github.com/yourusername/terminalAgent.git
cd terminalAgent
npm run install:allCopy the example environment file and add your API key:
cp deepresearch/.env.example deepresearch/.envEdit deepresearch/.env:
ANTHROPIC_API_KEY=your-api-key-here
ANTHROPIC_BASE_URL=https://api.anthropic.comSupports custom API endpoints (e.g., API proxy services).
# Development mode
npm run dev
# Or build and run
npm run build
npm startcd deepresearch
npm link
# Now you can use from anywhere:
agent # Interactive mode
agent "your question" # Single query
agent /code-review # Invoke a skill| Command | Description |
|---|---|
/help |
Show help |
/mode |
Switch permission mode (safe/unsafe) |
/clear |
Start new session |
/exit |
Exit program |
@ |
Open file browser |
@file.ts |
Attach file to context |
┌─────────────────────────────────────────────────────────────┐
│ User Input │
└─────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Smart Router │
│ (Keyword matching, Skill detection) │
└───────┬─────────┬─────────┬─────────┬───────────────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌───────┐ ┌───────┐ ┌───────┐ ┌───────────┐
│Reader │ │ Coder │ │Review │ │Coordinator│
│ 📖 │ │ 💻 │ │ 🔍 │ │ 🎯 │
└───────┘ └───────┘ └───────┘ └───────────┘
│ │ │ │
└─────────┴─────────┴─────────┘
│
▼
┌───────────────────────┐
│ [DISPATCH:agent] │
│ Inter-agent calls │
└───────────────────────┘
| Agent | Icon | Role |
|---|---|---|
| Coordinator | 🎯 | Task decomposition, multi-agent dispatch |
| Reader | 📖 | Code reading, analysis, understanding |
| Coder | 💻 | Code writing, modification, implementation |
| Reviewer | 🔍 | Code review, quality checks, bug detection |
| Tool | Description |
|---|---|
Read |
Read file contents |
Write |
Create/overwrite files |
Edit |
Edit existing files |
Bash |
Execute shell commands |
Glob |
Find files by pattern |
Grep |
Search text in files |
LSP |
Language Server Protocol integration |
WebFetch |
Fetch web content |
WebSearch |
Search the web |
Skill |
Invoke skills |
This project integrates Dify workflows for deep research capabilities.
Start → Background Search → Task Analysis → Research Loop → Implementation Guide → End
↓
[DeepSeek Reasoner]
↓
┌──────────────────────────┐
│ Research Loop (1-5x) │
│ ┌─────────────────────┐ │
│ │ Plan → Search → Reason│ │
│ └─────────────────────┘ │
└──────────────────────────┘
| Node | Model | Purpose |
|---|---|---|
| Task Analysis | DeepSeek Reasoner | Deep analysis of coding tasks |
| Query Planner | GPT-5 | Generate precise search queries |
| Code Reasoning | DeepSeek Reasoner | Extract actionable code info |
| Implementation Guide | GPT-5 | Generate complete implementation |
- Create an account at Dify
- Import the
dify/code-research-skill.ymlworkflow - Configure in
.env:
DIFY_API_KEY=your-dify-api-key
DIFY_BASE_URL=https://api.dify.ai/v1terminalAgent/
├── deepresearch/
│ ├── src/
│ │ ├── index.ts # Main entry point
│ │ ├── agents/ # Agent implementations
│ │ │ ├── base.ts # BaseAgent class
│ │ │ ├── coordinator.ts # Coordinator agent
│ │ │ ├── reader.ts # Reader agent
│ │ │ ├── coder.ts # Coder agent
│ │ │ └── reviewer.ts # Reviewer agent
│ │ ├── core/
│ │ │ ├── router.ts # Smart routing logic
│ │ │ └── session.ts # Session management
│ │ ├── config/
│ │ │ ├── agents.ts # Agent configurations
│ │ │ └── constants.ts # Constants
│ │ ├── ui/
│ │ │ ├── smart-input.ts # Input with "/" and "@"
│ │ │ ├── commands.ts # Command picker
│ │ │ └── file-browser.ts # File browser
│ │ └── prompts/ # Agent system prompts
│ ├── .claude/
│ │ └── skills/ # Skill definitions
│ ├── bin/agent.cjs # CLI entry point
│ └── package.json
├── dify/ # Dify workflow configs
│ └── code-research-skill.yml # Deep research workflow DSL
├── docs/images/ # Documentation images
├── CLAUDE.md # Instructions for Claude Code
└── README.md
| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key | Yes |
ANTHROPIC_BASE_URL |
API endpoint (default: api.anthropic.com) | No |
ANTHROPIC_MODEL |
Model to use (default: claude-sonnet-4-20250514) | No |
DIFY_API_KEY |
Dify API key for deep-research skill | No |
DIFY_BASE_URL |
Dify API endpoint | No |
- TypeScript - Type-safe development
- @anthropic-ai/claude-agent-sdk - Claude Agent SDK for multi-agent orchestration
- Playwright - Web automation and scraping
- Cheerio - HTML parsing and manipulation
- Dify - Deep research workflow engine
- dotenv - Environment configuration
# Install dependencies
npm run install:all
# Development mode with hot reload
npm run dev
# Build TypeScript
npm run build
# Run compiled version
npm start
# Test UI components
cd deepresearch && npm run test:uiMIT
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request

