工具
Commander ships with 18 built-in tools (exposed to the LLM by default, out of 48 tool classes available in the codebase) across 8 categories, each designed for production use with caching, error handling, and rollback support. Every tool comes with:
本文说明 工具 在 Commander 中的职责、使用方式与相关模块。命令与代码路径与产品保持一致。
bash
import { Tool, ToolContext } from '@commander/core';
class MyCustomTool implements Tool {
name = 'my-tool';
description = 'Does something useful';
async execute(context: ToolContext, args: any) {
return { success: true, data: ... };要点
- 与英文源文档语义对齐;API 与 CLI 以 monorepo 为准
- 需要可运行示例时,优先使用 快速开始 中的
cliEntry.ts路径 - 指标口径:25 提供商 · 5 拓扑 · 18 工具 · 6700+ 测试