Skip to content

Commit 7c1f576

Browse files
authored
docs(tarko): restructure cli documentation into separate sections (#1610)
1 parent 08701d8 commit 7c1f576

File tree

14 files changed

+2913
-438
lines changed

14 files changed

+2913
-438
lines changed

multimodal/websites/tarko/docs/en/guide/_meta.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"collapsible": false,
1414
"collapsed": false
1515
},
16+
{
17+
"type": "dir",
18+
"name": "cli",
19+
"label": "CLI",
20+
"collapsible": false,
21+
"collapsed": false
22+
},
1623
{
1724
"type": "dir",
1825
"name": "tool",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"type": "file",
4+
"name": "overview",
5+
"label": "Overview"
6+
},
7+
{
8+
"type": "file",
9+
"name": "commands",
10+
"label": "Commands"
11+
},
12+
{
13+
"type": "file",
14+
"name": "configuration",
15+
"label": "Configuration"
16+
},
17+
{
18+
"type": "file",
19+
"name": "built-in-agents",
20+
"label": "Built-in Agents"
21+
}
22+
]
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: Built-in Agents
3+
description: Using pre-built agents included with Tarko CLI
4+
---
5+
6+
# Built-in Agents
7+
8+
Tarko CLI 包含三个内置 Agent,可以直接使用。
9+
10+
## 可用的 Agent
11+
12+
### `agent-tars`
13+
14+
高级任务自动化和推理系统。
15+
16+
```bash
17+
# 启动 Web UI
18+
tarko run agent-tars
19+
20+
# 无头模式
21+
tarko run agent-tars --headless --input "分析当前目录结构"
22+
23+
# 服务器模式
24+
tarko serve agent-tars
25+
```
26+
27+
### `omni-tars`
28+
29+
多模态 Agent,支持文本、图像、文件处理。
30+
31+
```bash
32+
# 启动 Web UI
33+
tarko run omni-tars
34+
35+
# 无头模式
36+
tarko run omni-tars --headless --input "分析这个图片"
37+
38+
# 服务器模式
39+
tarko serve omni-tars
40+
```
41+
42+
### `mcp-agent`
43+
44+
**Model Context Protocol** Agent,专门用于 Tool 集成。
45+
46+
```bash
47+
# 启动 Web UI
48+
tarko run mcp-agent
49+
50+
# 无头模式
51+
tarko run mcp-agent --headless --input "列出所有可用工具"
52+
53+
# 服务器模式
54+
tarko serve mcp-agent
55+
```
56+
57+
## 使用自定义 Agent
58+
59+
除了内置 Agent,你也可以创建自定义 Agent:
60+
61+
```typescript
62+
// my-agent.ts
63+
import { Agent } from '@tarko/agent';
64+
65+
class MyAgent extends Agent {
66+
constructor(options = {}) {
67+
super({
68+
...options,
69+
name: 'MyAgent',
70+
instructions: '你是一个专门的助手...'
71+
});
72+
}
73+
}
74+
75+
export default MyAgent;
76+
```
77+
78+
使用自定义 Agent:
79+
80+
```bash
81+
# 运行自定义 Agent
82+
tarko run ./my-agent.ts
83+
84+
# 部署自定义 Agent
85+
tarko serve ./my-agent.ts
86+
```
87+
88+
## Agent 架构
89+
90+
```mermaid
91+
graph TD
92+
A[CLI Input] --> B[Agent Selection]
93+
B --> C{Agent Type}
94+
95+
C -->|agent-tars| D[Advanced Reasoning]
96+
C -->|omni-tars| E[Multi-modal Processing]
97+
C -->|mcp-agent| F[Tool Integration]
98+
C -->|custom| G[Custom Logic]
99+
100+
D --> H[Tool Manager]
101+
E --> H
102+
F --> H
103+
G --> H
104+
105+
H --> I[LLM Provider]
106+
I --> J[Response]
107+
```
108+
109+
## 配置 Agent
110+
111+
`tarko.config.ts` 中配置默认 Agent:
112+
113+
```typescript
114+
import { AgentAppConfig } from '@tarko/interface';
115+
116+
const config: AgentAppConfig = {
117+
model: {
118+
provider: 'openai',
119+
id: 'gpt-4'
120+
},
121+
tool: {
122+
include: ['file_*', 'web_*']
123+
}
124+
};
125+
126+
export default config;
127+
```
128+
129+
## 下一步
130+
131+
- [CLI Commands](/guide/cli/commands) - 完整命令参考
132+
- [Configuration](/guide/cli/configuration) - 配置选项
133+
- [Tool Integration](/guide/basic/tool-call-engine) - 添加自定义 Tool

0 commit comments

Comments
 (0)