1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# hey 配置文件示例
# 复制到 ~/.config/hey/config.toml 即可使用(路径见 docs/DESIGN.md §8)
# 值里的 ${VAR} 会展开为环境变量(如 ${OPENAI_API_KEY})。
# ---------------------------------------------------------------- 必填:一个 provider
# 最简配置只需一个 [provider.xxx],hey 会自动发现。
# protocol 三选一:openai | anthropic | google
[]
= "openai"
= "https://api.openai.com/v1"
= "${OPENAI_API_KEY}"
= ["gpt-4o"]
= "medium" # 推理深度:off | minimal | low | medium | high | xhigh | max
= 128000 # 上下文窗口上限(不设则用模型默认值)
# 备用:Anthropic
# [provider.anthropic]
# protocol = "anthropic"
# base_url = "https://api.anthropic.com/v1"
# api_key = "${ANTHROPIC_API_KEY}"
# models = ["claude-sonnet-4-5"]
# 备用:本地 Ollama(无需 api_key)
# [provider.ollama]
# protocol = "openai"
# base_url = "http://localhost:11434/v1"
# models = ["qwen2.5:7b"]
# ---------------------------------------------------------------- agent(通常不需要改)
[]
= 20 # 单轮最大工具调用次数(防失控)
= 40000 # 上下文预算,超了自动压缩
= true # 无依赖的工具并行执行
# ---------------------------------------------------------------- MCP 工具(按需取消注释)
# 本地 MCP(stdio):文件系统工具
# [mcp.filesystem]
# command = "npx"
# args = ["-y", "@modelcontextprotocol/server-filesystem", "."]
# 远程 MCP(HTTP):MCP 官方服务器
# [mcp.context7]
# url = "https://mcp.context7.com/mcp"
# respawn = false # 崩溃时立即报错(默认:静默重启)
# ---------------------------------------------------------------- 代理(如需要)
# [proxy]
# url = "http://127.0.0.1:7890" # HTTP(S)_PROXY / ALL_PROXY 环境变量优先级更高
# connect_timeout_secs = 30
# read_timeout_secs = 0 # 0 = 不超时(流式响应时必须)
# ---------------------------------------------------------------- 权限(默认全权限,按需收紧)
# [permission]
# allow = [
# "bash: git status",
# "bash: cargo build",
# "bash: cargo test",
# "read_file: ",
# "grep: ",
# ]
# ---------------------------------------------------------------- 工具
[]
= 120 # bash 单次执行超时(秒),0 = 不超时
# shell = "bash" # Windows 可改为 "powershell" 或 "pwsh"