@aggroot-team/aggroot

中文文档
1.13.14发布于 2026/11/06MITESM + CJS近 30 天下载 2036

AggRoot - AI Assistant (Node.js/TypeScript Version)

原始使用文档
文档目录43 节
  1. Table of Contents
  2. Core Features
  3. CLI Interface
  4. CLI Features
  5. CLI Commands
  6. Quick Start
  7. Prerequisites
  8. Installation
  9. Web Gateway Mode
  10. Configuration
  11. Environment Variables
  12. Usage
  13. Interactive Mode
  14. Quick Menus
  15. YOLO Mode
  16. Session Management
  17. Memory Management
  18. Available Tools
  19. Core Tools ( @aggroot/core-tools )
  20. Code Tools ( @aggroot/code-tools )
  21. Git Tools ( @aggroot/git-tools )
  22. Web Tools ( @aggroot/web-tools )
  23. Shell Tools ( @aggroot/shell-tools )
  24. Todo Tools ( @aggroot/todo-tools )
  25. Skill Tools ( @aggroot/skill-tools )
  26. MCP Tools ( @aggroot/mcp-tools )
  27. Risk Control Tools ( @aggroot/risk-control-tools )
  28. Stock Tools ( @aggroot/stock-tools )
  29. Skills System
  30. MCP Integration
  31. Configuration
  32. Pre-configured MCP Servers
  33. Installing MCP Servers
  34. Agent System
  35. Built-in Agents
  36. Sub-Agent System
  37. Memory Management
  38. Cross-Platform Support
  39. Platform Compatibility
  40. Changelog
  41. v1.4.2
  42. v1.3.4
  43. License

AggRoot - AI Coding Assistant

A powerful, extensible AI coding assistant built with Node.js and TypeScript. It provides file operations, web search, code execution, Git integration, and more through a modern DDD + plugin architecture.

Node.js Version License: MIT

中文文档

Table of Contents

Core Features

  • TypeScript First: Full TypeScript support with strict type checking and modern ES modules
  • DDD + Plugin Architecture: Clean domain-driven design with hot-pluggable plugins
  • Extensible Tool System: 10 tool plugins providing 30+ built-in tools, easily extensible
  • Multi AI Agents: Code agent, chat agent, and specialized sub-agents
  • Smart Memory: Context-aware memory with auto-compression and project-level persistence
  • Advanced File Operations: Read, Write, Edit, Glob, Grep, DirectoryTree with smart pagination and outline mode
  • Web Tools: Web search, web fetch, and HTTP requests with automatic encoding handling
  • Code Intelligence: Execute, validate, format, analyze, refactor, and search code symbols
  • Git Integration: Full Git operations with cross-platform support
  • Stock Quotes: Real-time stock quotes and market data
  • Modern CLI Interface: Interactive terminal UI with split-screen layout and Markdown rendering
  • Skills System: Reusable skill templates (explain, refactor, test, debug, and more)
  • MCP Integration: Model Context Protocol for external tool integration
  • Security Controls: Built-in risk control, safe command execution, and dangerous command interception
  • Cross-Platform: Seamless operation on Windows, Linux, and macOS
  • Session Management: Multi-session support with history, undo, and export
  • YOLO Mode: Toggle auto-execution mode to skip tool confirmation prompts

CLI Interface

AggRoot provides a modern terminal UI with a split-screen layout:

┌──────────────────────────────────────────────────────────────┐
│                                                              │
│                     Output Area                              │
│              (scrollable conversation history)               │
│              (Markdown rendering support)                    │
│                                                              │
├──────────────────────────────────────────────────────────────┤  ← top separator
│ Agent> _                                                     │  ← input line
├──────────────────────────────────────────────────────────────┤  ← bottom separator
│ deepseek-chat | Token: 1234/5678 | Mode: coding             │  ← status bar
└──────────────────────────────────────────────────────────────┘

CLI Features

  • Split-Screen Layout: Clear separation between output and input areas
  • Visual Separators: Double-line separators clearly mark the input area
  • Status Bar: Shows current model, token usage, and working mode
  • Thinking Animation: Animated status display during AI processing
  • Raw Mode Input: Full keyboard support including arrow keys and history navigation
  • Quick Menus:
    • Press / to view commands
    • Press $ to select a model
    • Press # to select an agent
    • Press @ to insert a file reference
  • Markdown Rendering: Rich text formatting for AI responses

CLI Commands

CommandAliasDescription
/help/h, /?Show help information
/model <id>—Switch AI model
/agents—List all available agents
/switch [n]—Switch session (by number)
/reset—Reset current session
/sessions—List all sessions
/undo [path]—Undo file changes
/memory—Manage project memory (list/add/delete/search)
/init—Generate AGGROOT.md project documentation
/yolo—Toggle auto-execution mode (skip confirmations)
/export [format]—Export conversation
/config—Show current configuration
/history—Show command history
/clear/clsClear screen
/exit/quit, /qExit program

Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • AI provider API key (DeepSeek, OpenAI, etc.)

Installation

# Install globally via npm
npm install -g aggroot

# Run the assistant (CLI mode)
aggroot

Web Gateway Mode

Start the web gateway server with built-in frontend:

# Start gateway (serves frontend + API on port 8642)
aggroot gateway

# Custom port and host
aggroot gateway --port 8080 --host 0.0.0.0

# Disable frontend static serving (API only)
aggroot gateway --no-static

# Custom static directory
aggroot gateway --static-dir /path/to/frontend/dist
EndpointDescription
http://localhost:8642Web frontend (SPA)
http://localhost:8642/healthHealth check
http://localhost:8642/v1/chat/completionsOpenAI-compatible chat API
http://localhost:8642/v1/modelsAvailable models
ws://localhost:8642/wsWebSocket chat

Configuration

Environment Variables

Create a .env file in your project directory or set environment variables directly:

# === AI Providers (at least one required) ===
DEEPSEEK_API_KEY=your_deepseek_api_key       # DeepSeek (default provider)
OPENAI_API_KEY=your_openai_api_key           # OpenAI GPT
CLAUDE_API_KEY=your_claude_api_key           # Anthropic Claude
ZHIPU_API_KEY=your_zhipu_api_key             # Zhipu AI
KIMI_API_KEY=your_kimi_api_key               # Kimi (Moonshot)
MINIMAX_API_KEY=your_minimax_api_key         # MiniMax

# === Ollama (Local Models) ===
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL_NAME=llama3.2

# === Shell Configuration ===
DEFAULT_SHELL=auto          # auto | powershell | cmd | bash | nushell | wsl
SHELL_TIMEOUT=30000         # Shell command timeout (ms)
CODE_EXECUTION_TIMEOUT=30   # Code execution timeout (seconds)

# === Session Management ===
MAX_SESSION_HISTORY=50       # Max messages per session
SESSION_TIMEOUT=60           # Session timeout (minutes)

# === Logging ===
LOG_LEVEL=info              # debug | info | warn | error | fatal

# === Security ===
SAFE_MODE=true              # Enable safe mode for code execution
DANGEROUS_COMMANDS=rm -rf,format,del /f /q,shutdown,reboot

Important: At least one AI provider API key is required. DeepSeek is the default provider.

Usage

Interactive Mode

Start AggRoot and interact with the AI assistant:

aggroot

Then type your questions or instructions naturally:

Agent> Read the README.md file and summarize it
Agent> Search for all TypeScript files in the src directory
Agent> Run the test suite and fix any failing tests
Agent> What's the current git status?

Quick Menus

  • $ — Open model selection menu
  • # — Open agent selection menu
  • @ — Insert file reference
  • / — Show command list

YOLO Mode

Enable YOLO mode to auto-execute tools without confirmation:

Agent> /yolo
✅ YOLO mode enabled - tools will auto-execute

Session Management

/sessions          # List all sessions
/switch 2          # Switch to session 2
/reset             # Reset current session
/export markdown   # Export conversation as Markdown

Memory Management

/memory            # Show memory stats
/memory list       # List all project memories
/memory add        # Add a new memory
/memory search     # Search memories

Available Tools

Core Tools (@aggroot/core-tools)

File Operations:

ToolDescription
ReadRead file contents with smart pagination, outline mode, and context search
WriteCreate new files or overwrite existing ones
EditPrecise file editing with diff-style replacement (minimizes token consumption)
GlobFind files by name/path pattern (e.g., **/*.ts, src/**/*.py)
GrepSearch file contents with regex (preferred tool for finding code)
DirectoryTreeQuickly list directory tree structure with configurable depth and exclusions

User Interaction:

ToolDescription
AskUserAsk the user questions with multi-select or free-text input

Planning:

ToolDescription
EnterPlanModeEnter plan mode to break down complex tasks before execution
ExitPlanModeExit plan mode and submit the plan for approval

Code Tools (@aggroot/code-tools)

ToolDescription
CodeExecuteSafely execute TypeScript/JavaScript code with timeout control
CodeValidateValidate code syntax with TypeScript compiler (real type checking)
CodeFormatFormat code with configurable indentation
CodeAnalyzeAnalyze code for symbols, complexity, imports/exports, and issues
CodeSearchUnified symbol search (definitions, references, workspace symbols)
CodeRefactorCode refactoring operations (extract function, rename, organize imports)

Git Tools (@aggroot/git-tools)

ToolDescription
GitStatusShow working tree status
GitDiffShow differences between commits, or between commits and working tree
GitLogShow commit logs
GitBranchList, create, or delete branches
GitShowShow various types of objects (commits, tags, trees, etc.)
GitAddStage file contents
GitCommitRecord changes to the repository
GitPushPush to remote repositories
GitPullPull from remote repositories
GitCheckoutSwitch branches or restore working tree files
GitRemoteManage remote repository sets
GitStashStash changes in a dirty working directory

Web Tools (@aggroot/web-tools)

ToolDescription
WebSearchSearch the web (with query optimization)
WebFetchFetch web content from URLs (auto-retry with multiple URLs)
HttpRequestMake HTTP requests (GET, POST, PUT, DELETE, PATCH)

Shell Tools (@aggroot/shell-tools)

ToolDescription
ShellExecute shell commands with security controls and timeout

Important: Prefer core tools (read/write/edit/glob/grep) for file operations over shell commands. Use Shell only for system-level operations that core tools cannot accomplish.

Todo Tools (@aggroot/todo-tools)

ToolDescription
TodoCreateCreate a new todo item
TodoListList all todo items
TodoUpdateUpdate a todo item
TodoDeleteDelete a todo item
TodoCompleteMark a todo item as completed

Skill Tools (@aggroot/skill-tools)

ToolDescription
SkillInvoke a skill by name (reusable task template)
ListSkillsList all available skills

MCP Tools (@aggroot/mcp-tools)

ToolDescription
MCPModel Context Protocol integration for connecting external tool servers

Risk Control Tools (@aggroot/risk-control-tools)

Security and risk management tools for safe command execution and domain reputation checks.

Stock Tools (@aggroot/stock-tools)

ToolDescription
StockQuoteGet real-time stock quotes

Skills System

AggRoot includes a built-in skills system that provides reusable templates for common tasks:

Built-in Skills:

  • explain — Explain code or concepts
  • refactor — Refactor code to improve quality
  • test — Generate test cases
  • document — Generate documentation
  • debug — Debug issues and errors
  • analyze — Analyze codebase structure
  • security-check — Security audit and vulnerability scanning
  • commit — Generate meaningful commit messages

Using Skills:

Agent> /explain this function
Agent> /refactor src/utils/helpers.ts
Agent> /test src/domain/agent/

MCP Integration

AggRoot supports the Model Context Protocol (MCP) for integrating external tool servers:

  • Connect MCP-compatible tool servers
  • Dynamically discover and use external tools
  • Supports stdio, HTTP, WebSocket, and SSE transport protocols
  • Auto-reconnect (with exponential backoff) and health monitoring
  • Configure MCP servers at project or user level

Configuration

MCP servers are configured via .aggroot/mcp.json (project-level) or ~/.aggroot/mcp.json (user-global):

{
  "servers": [
    {
      "name": "powerpoint-server",
      "transport": {
        "type": "stdio",
        "command": "uvx",
        "args": ["--from", "office-powerpoint-mcp-server", "ppt_mcp_server"]
      },
      "enabled": true
    },
    {
      "name": "word-document-server",
      "transport": {
        "type": "stdio",
        "command": "uvx",
        "args": ["--from", "office-word-mcp-server", "word_mcp_server"]
      },
      "enabled": true
    }
  ],
  "settings": {
    "defaultTimeout": 30000,
    "autoReconnect": true
  }
}

Pre-configured MCP Servers

ServerPackageDescription
powerpoint-serveroffice-powerpoint-mcp-serverCreate, edit, and manipulate PowerPoint presentations (34 tools: charts, shapes, tables, gradients, etc.)
word-document-serveroffice-word-mcp-serverCreate, read, and manipulate Word documents (42 tools: paragraphs, tables, images, formatting, etc.)

Installing MCP Servers

# Option 1: Use uvx (recommended — no global install needed, requires uv/uvx)
# Already configured in mcp.json, just ensure uv/uvx is installed

# Option 2: Global pip install
pip install office-powerpoint-mcp-server office-word-mcp-server

Note: The name in the config determines the tool prefix. For example, powerpoint-server generates tools like mcp_powerpoint-server_create_presentation.

Agent System

AggRoot features a powerful agent system with multiple specialized agents for different tasks:

Built-in Agents

AgentNameDescription
Code AgentCode DeityProfessional coding assistant — directive refactoring, code generation, multi-file collaboration with sub-agent support
Content AgentContent CreatorContent creation assistant — articles, copywriting, professional PPT presentations and Word documents (via MCP)
Resume AgentResume OptimizerResume optimization expert — diagnostics, STAR rewriting, keyword analysis, Word document formatting (via MCP)
Companion AgentXiao AiWarm and caring virtual companion — cute and friendly, supports web search and file operations
Lei Jun AssistantLei Jun ClassmateLei Jun-style assistant — investment insights, stock analysis, business strategy
Investment AgentInvestment MasterInvestment analysis expert — data-driven stock analysis (A-shares and HK stocks), quotes/financials/technical/news
Ops AgentOps MasterSystem operations expert — system administration, environment management, deployment
Risk Control AgentRisk DetectiveRisk detective — payment fraud detection, phishing detection, domain reputation, security scanning

Sub-Agent System

The Code Agent can delegate tasks to specialized sub-agents:

  • Explore Agent: Quick read-only codebase exploration with parallel tool calls
  • Plan Agent: Plan and design tasks
  • Code Reviewer Agent: Code review and quality analysis
  • General Purpose Agent: Complex multi-step tasks

Sub-agents run autonomously and return complete output, enabling efficient task decomposition and parallel execution.

Memory Management

AggRoot includes an intelligent memory system:

  • Context-Aware Memory: Automatically tracks conversation context with auto-compression when needed
  • Project Memory: Cross-session persistent project-level memory
  • Memory Commands: /memory list, /memory add, /memory delete, /memory search
  • Auto-Compression: Intelligently summarizes old conversations to stay within token limits
  • File Tracking: Tracks file changes during conversations with undo support

Cross-Platform Support

AggRoot is designed to work seamlessly across all major operating systems:

PlatformArchitectureShell SupportNotes
Windowsx64, arm64PowerShell, CMD, Git Bash, Nushell, WSLAuto encoding detection (GBK/UTF-8)
Linuxx64, arm64Bash, Zsh, Fish—
macOSx64, arm64 (Apple Silicon)Zsh, BashNative Apple Silicon support

Platform Compatibility

FeatureWindowsLinuxmacOS
File Operations✅✅✅
Shell Commands✅ (Git Bash / Nushell / PowerShell)✅✅
Web Tools✅✅✅
Git Integration✅✅✅
Encoding Support✅ (GBK/UTF-8)✅ (UTF-8)✅ (UTF-8)

Changelog

v1.4.2

  • Menu Selection Echo Fix: Commands selected from the quick menu (via /, $, #) now correctly display the echo line (e.g., Code Deity ❯ /help) just like manually typed commands
  • /clear Command Fix: Eliminated excessive blank lines when executing /clear — now properly clears the visible area without affecting scrollback history
  • Multi-Step Output Fix: Fixed blank line issues in multi-step output commands (e.g., /upgrade) where the echo line was being overwritten by subsequent output
  • Split-Screen Rendering Improvements: Refactored addOutput() to correctly handle the transition from input echo to AI output, preventing text overlap and cursor positioning errors

v1.3.4

  • Nushell Shell Support: Added Nushell (nu) as a supported shell on Windows, with automatic detection via common install paths and PATH lookup
  • Updated Shell Priority: Default shell priority on Windows is now Git Bash > Nushell > PowerShell
  • Smart Shell Syntax: System prompt now generates shell syntax compatible with the detected default shell instead of always assuming Git Bash
  • Bug Fixes:
    • Read tool auto-corrects ../ relative paths via searchFilePath fallback
    • SubAgent robust summary round with tool result fallback when no output
    • Glob tool description clarifies it matches files only, not directories

License

This project is licensed under the MIT License — see the LICENSE file for details.

版本与发布记录

@aggroot-team/aggroot 共发布 71 个版本,首次发布于 2026/05/28;过去 12 个月发布了 71 个版本。

版本发布日期距今
1.13.14latest2026/11/061 天前
1.13.132026/11/052 天前
1.13.122026/11/043 天前
1.13.112026/11/043 天前
1.13.102026/11/043 天前
1.13.92026/11/034 天前

关于 @aggroot-team/aggroot 的常见问题

@aggroot-team/aggroot 是什么?

AggRoot - AI Assistant (Node.js/TypeScript Version)

如何安装 @aggroot-team/aggroot?

在项目目录运行 npm install @aggroot-team/aggroot,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 aggroot,可以用 npx aggroot 直接运行。

@aggroot-team/aggroot 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aggroot-team__aggroot 是否存在。

@aggroot-team/aggroot 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aggroot-team/aggroot 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aggroot-team/aggroot 可以商用吗?

@aggroot-team/aggroot 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aggroot-team/aggroot 的下载量有多少?

根据 npm 官方下载统计,@aggroot-team/aggroot 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,036 次,日均约 68 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aggroot-team/aggroot 还在维护吗?

最新版本 1.13.14 发布于 2026/11/06(1 天前);至今共发布 71 个版本,其中过去 12 个月发布了 71 个;首次发布于 2026/05/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。