> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cowagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 常用命令

> CowAgent 常用命令参考：help、status、cancel、steer、config、context 等，可在对话中用 / 前缀或在终端中用 cow 前缀执行，用于查看运行状态、中止任务、修改配置和管理上下文。

以下命令支持在对话中使用 `/` 前缀，也支持在终端中使用 `cow` 前缀（部分命令仅对话可用）。

> [!TIP]
>
> 在 Web 控制台中输入 `/` 会自动弹出命令提示，支持键盘上下选择和 Tab 补全。

## help

显示所有可用命令的帮助信息。

```text theme={null}
/help
```

## status

查看当前会话和服务的运行状态，包括进程信息、模型配置、会话消息数量、已加载技能数量和已加载 MCP 数量（就绪/已配置）。

```text theme={null}
/status
```

输出示例：

```
🐮 CowAgent Status

Process: PID 12345 | Running 2h 15m
Version: 2.0.4
Channel: web
Model:   MiniMax-M3
Mode:    agent

Session: 12 messages | 8 skills loaded | 2/3 MCP ready
```

## cancel

中止当前会话正在运行的 Agent 任务。在 Agent 执行长时间任务（例如多轮工具调用、长流式输出）时，可随时发送 `/cancel`，Agent 会在下一次工具执行前停止。Web 端、微信、企业微信、飞书等各通道均可使用。

```text theme={null}
/cancel
```

## steer

在不中止任务的情况下，引导当前会话里正在运行的 Agent。指令会在下一个安全检查点注入：已经开始的工具可以执行完，尚未开始的工具会跳过。若当前没有运行中的任务，`/steer` 不会新建任务，也不会进入队列。所有聊天渠道均可使用。

```text theme={null}
/steer 先处理失败的测试
```

Web 控制台在回复进行中会显示“引导当前任务”按钮。普通消息仍按原有方式进入会话队列。

## config

查看或修改运行时配置。修改后立即生效，无需重启服务。

**查看所有可配置项：**

```text theme={null}
/config
```

**查看单个配置项：**

```text theme={null}
/config model
```

**修改配置项：**

```text theme={null}
/config model deepseek-flash
```

**支持修改的配置项：**

| 配置项 | 说明 | 示例值 |
| - | - | - |
| `model` | AI 模型名称 | `deepseek-flash` |
| `agent_max_context_tokens` | 最大上下文 tokens | `200000` |
| `agent_max_context_turns` | 最大上下文记忆轮次 | `30` |
| `agent_max_steps` | 单次任务最大决策步数 | `100` |
| `enable_thinking` | 是否启用深度思考模式 | `true` / `false` |

> [!NOTE]
>
> 修改 `model` 时，系统会自动匹配对应的模型调用方式。配置会写入 `config.json` 并持久保存。

## context

查看当前会话的上下文信息，包括消息数量、内容长度等统计。

```text theme={null}
/context
```

**清空当前会话上下文：**

```text theme={null}
/clear
```

> [!TIP]
>
> 清空上下文后，Agent 会"忘记"之前的对话内容，适用于切换话题或释放上下文空间。`/context clear` 仍作为别名兼容。

## compact

总结较早的对话轮次以释放上下文，最近几轮保持完整。与自动裁剪不同，无论当前 token 用量多少都会立即执行。

```text theme={null}
/compact
```

> [!TIP]
>
> 在开始长任务前使用 `/compact`，可以在不完全清空对话的前提下回收上下文空间。最近几轮及较早轮次的 LLM 总结会被保留。

## logs

查看最近的服务日志，默认显示最近 20 行，最多 50 行。

```text theme={null}
/logs
```

**指定行数：**

```text theme={null}
/logs 50
```

## version

显示当前 CowAgent 版本号。

```text theme={null}
/version
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.