文档CLI

CLI

可用命令和参数的完整列表。

命令

命令描述用法
neovate交互模式neovate
neovate "prompt"带有初始提示的交互模式neovate "explain this project"
neovate -q "prompt"静默模式,仅输出结果neovate -q "explain this project"
cat file | neovate -q "prompt"处理管道内容cat file | neovate -q "explain"
neovate -c从上次会话恢复neovate -c
neovate -r <session_id>从特定会话恢复neovate -r foo123
neovate config配置管理查看 设置
neovate mcpMCP 服务器管理查看 MCP
neovate commit提交更改neovate commit
neovate update更新 Neovate Codeneovate update

选项

参数描述
--append-system-prompt <append_system_prompt>追加系统提示
--approval-mode <approval_mode>指定批准模式,选项:yoloautoEditdefault
-c, --continue从上次会话恢复
--cwd <cwd>指定工作目录
-h, --help显示帮助
--language <language>指定语言,选项:enzh
-m, --model <model_id>指定模型,格式:provider_id/model_id
--mcp-config <mcp_config>指定 MCP 服务器配置(包含”mcpServers”对象的 JSON 字符串或文件路径)
--output-format <output_format>指定输出格式,选项:stream-jsonjsontext,必须与 --quiet 一起使用
--output-style <output_style>指定输出样式(名称或路径)
--plan-model <plan_model>指定规划模型
--plugin <plugin>指定插件
-q, --quiet静默模式,仅输出结果
-r, --resume <resume>指定恢复,格式:session_id
--system-prompt <system_prompt>指定系统提示
-v, --version显示版本

指定 MCP 服务器

您可以使用 --mcp-config 来指定要使用的 MCP 服务器。此配置支持 JSON 字符串和文件路径两种方式。

# 使用 JSON 字符串
neovate -q --output-format stream-json "hello" --mcp-config '{"mcpServers": {"my-mcp-server": {"type": "stdio", "command": "my-mcp-server", "args": ["--port", "8080"]}}}'
 
# 使用文件路径
neovate -q --output-format stream-json "hello" --mcp-config ~/.neovate/mcp-config.json

指定系统提示

系统提示可以定义智能体的行为和偏好。如果您想使用自定义系统提示,有几种方法可以做到。

使用 --output-style

您可以使用 --output-style 来指定自定义输出样式。它支持内置输出样式的名称和输出样式文件的路径。

因此您可以创建一个输出样式 Markdown 文件,然后与 --output-style 一起使用。

首先,创建 miao.md 文件。

---
name: Miao
description: Adds "miao~~~" after every sentence for a cute cat-like style
---
 
You are an interactive CLI tool that helps users with software engineering tasks, but with a cute cat-like personality.
 
# Miao Style Active
 
You should add "miao~~~" after every sentence. A sentence is typically defined as text ending with a period (.), exclamation mark (!), or question mark (?). Apply this consistently throughout your responses.
 
Examples:
- "I'll help you with that miao~~~"
- "Let me check the file first miao~~~"
- "The function works correctly miao~~~"
 
Keep your technical accuracy and helpfulness while adding this cute touch to make interactions more fun and engaging.

然后您可以将其与 --output-style 一起使用。

neovate -q --output-style "./miao.md" "hello"