跳到主要内容

配置参考

Anyy 默认从 active Anyy home 中的 config.yaml 读取 profile 配置;如果某个命令 接受并收到 --config PATH,则使用该路径。解析器只接受已知 YAML 字段,因此拼错的 top-level 字段会失败,而不是被静默忽略。

带注释的起点见 configs/config.example.yaml

推荐路径

首次配置优先使用 setup commands,不要手写 YAML:

anyy setup
anyy setup model
anyy setup channels telegram --write-config

使用 anyy config 渲染 resolved summary,并用 doctor 验证本地文件:

anyy config --home ~/.anyy
anyy doctor --home ~/.anyy
anyy doctor --config ./candidate-config.yaml

本构建没有 anyy config setanyy config edit 子命令。Setup 没覆盖到的字段,请用 你的常规编辑器编辑 config.yaml

配置文件

顶层结构如下:

home: /root/.anyy
profile: default
timezone: ""
default_model: openai-compatible/your-model-name
main_model:
provider_id: openai-compatible
model: your-model-name
auxiliary_models: {}
agent:
max_turns: 90
providers: []
gateway: {}
channels: {}
toolsets: {}
computer_use: {}
tool_governance: {}
skills: {}
cron: {}
heartbeat: {}
memory: {}
mcp: {}
media_understanding: {}
media_generation: {}
tts: {}
voice: {}
channel_webhooks: {}
storage: {}
retention: {}
observability: {}

重要默认值:

字段默认值
profiledefault
agent.max_turns90
gateway.unix_socket<home>/anyy.sock
gateway.tcp.enabled省略时为 true
gateway.tcp.listen0.0.0.0:8765
gateway.tcp.modeopen
memory.maintenance_enabledtrue
memory.suggestion_ttl_days14
memory.daily_keep_days180
memory.daily_modedelete
memory.auto_dream_enabledtrue
memory.auto_dream_min_hours168
memory.auto_dream_min_user_turns50
memory.auto_dream_scan_interval8h
mcp.client.session_idle_ttl_ms300000
channel_webhooks.enabledfalse
channel_webhooks.listen127.0.0.1:8770
storage.hot_window_hours72
storage.preview_bytes1024
storage.raw_ttl_days30
注意

gateway.tcp.enabled 省略时默认为 true,listen address 为 0.0.0.0:8765,mode 为 open。 把 host 暴露到可信本地网络之外前,请检查 effective gateway listener。

Profile 选择

Profiles 会在加载 config 之前被选择。Config 中的 profile 字段是该 home 内保存的 profile name;CLI selection 决定加载哪个 home。

选择优先级:

  1. 支持时,命令的 --home PATH
  2. 全局 --profile NAME
  3. ANYY_HOME
  4. Profile root 下的 active profile。
  5. 默认 profile home。

示例:

anyy profile list
anyy profile create work --display-name "Work"
anyy --profile work status

Provider 配置

Providers 配置在 providers 下。每个 provider 需要 id、直接指定或通过已识别 provider profile 得到的 API mode、base URL,以及与 auth mode 兼容的 credentials。Provider 的单一入口是 Provider 集成;紧凑字段表见 Provider 配置参考

providers:
- id: openai-compatible
api_mode: openai-compatible
base_url: https://api.openai.com/v1
api_key_ref: env:OPENAI_API_KEY
default_model: your-model-name

支持的 API modes 是 openai-compatibleanthropic-messagesgoogle-geminiopenai-responsescodex-responses。支持的 auth modes 是 api_keyoauthnoneexternal_processaws_sdk

auth_mode: none 只接受本地 provider URL。

通用 secret references 使用以下 schemes:

Ref用途
secret:path/name持久的 profile-local service credentials。
env:NAME由 shell 或 service manager 注入的 credentials。
file:/absolute/path存储在 profile home 外部的 credentials。
literal:value仅用于本地测试或非 secret values。

Provider credential 字段会拒绝 literal:。请使用 credential_refapi_key_ref 搭配 env:file:secret:

模型

规范的模型选择方式是:

main_model:
provider_id: openai-compatible
model: your-model-name

default_model: provider/model 仍作为兼容 alias 存在,并且必须包含已知 provider id。 辅助模型 slot 位于 auxiliary_models

auxiliary_models:
fallback:
- provider_id: openai-compatible
model: fallback-model
allow_reasoning_drop: true
image_understanding:
- provider_id: vision-compatible
model: vision-model

Model 和 provider capability flags 是精确覆盖。省略某个 capability key 会保留 provider profile 默认值;设置 truefalse 则覆盖它。模型路由和 fallback 行为见 配置模型;完整字段列表见 Provider 配置参考

工具治理

toolsets 控制默认可见的 groups;tool_governance.overrides 可以覆盖单个 tool 的 risk 和 execution policy。选择顺序、默认可见工具集、可选工具集和 MCP 工具集命名见 工具集参考

toolsets:
default:
- web
- sessions
- memory
- tasks
- automation
- clarify
- file
- messaging
- skills
- subagents
- terminal
- tts

示例 config 中有意不默认暴露 computer_use

Skills

Skills 配置位于开放的 skills map 下。Anyy 当前读取这些 keys:

skills:
external_roots:
- ~/.agents/skills
- ${TEAM_SKILLS_ROOT}
disabled:
- skill_user_abc123
disabled_by_surface:
tui:
- experimental-skill
api:
- /internal-command
字段类型默认值含义
external_rootsstring list、comma string,或兼容 string list 的值<home>/skills 之后、system skills 之前扫描的额外 skill roots。支持 ~$VAR${VAR} 展开。缺失环境变量的 root 会被跳过。
disabledstring list 或 comma string全局隐藏匹配的 skills。每个条目可以是 skill ID、skill name 或 command name。
disabled_by_surfacesurface name 到 list/string 的 map仅在某个 surface 隐藏匹配 skills,例如 tuicliapichannelweixincron

<home>/skills 仍然是 CLI install 和 agent-managed skill writes 的 managed root。 External roots 和 system skills 会被扫描进 catalog,但不是 anyy skills installanyy skills uninstall 或 agent create/edit/patch writes 的目标。

参见 Skills 系统Skill 管理

渠道

Channels 配置在 channels.<name> 下。每个 block 使用 enabled,通常也使用 account_id; channel-specific fields 和 secret refs 列在渠道参考

channels:
telegram:
enabled: true
account_id: personal
token_ref: secret:telegram/personal/token
dm_policy: pairing
group_policy: mention

channel_webhooks 是独立配置。它控制支持 verified webhook routes 的 adapters 共享的 webhook listener:

channel_webhooks:
enabled: false
listen: 127.0.0.1:8770

MCP

MCP 分 client side 和 server side:

mcp:
client:
enabled: false
session_idle_ttl_ms: 300000
servers: {}
server:
enabled: false
transport: stdio

当 MCP server policy 字段省略时,runtime 默认是 tools.default_risk: readtools.approval_policy: nonetools.execution_policy: directanyy mcp add 路径会为外部 server 写入更保守的 policy:tools.default_risk: runtime-hightools.execution_policy: confirm

尽量使用 anyy mcp addanyy mcp configure,而不是手写 server blocks。 工作流见 MCP 集成;全部 client/server 字段、传输规则、 secret-ref 校验和 policy 值见 MCP 配置参考

语音与媒体

media_understanding 控制入站 image、audio 和 video understanding。media_generation 控制 输出 image generation。tts 配置 speech synthesis providers;voice.auto_tts 控制 voice/audio conversations 是否默认用语音回复。

media_generation:
image:
enabled: true
default_aspect_ratio: square
timeout_ms: 120000
max_bytes: 5242880
tts:
provider: openai
timeout_ms: 60000
voice:
auto_tts: false

配置 TTS provider 并不会自动把每个回复都变成音频;voice reply behavior 单独控制。

Dashboard

Dashboard 通常用 CLI flags 启动,而不是静态 config:

anyy dashboard [--home PATH] [--socket PATH] [--listen ADDR] [--no-open]
anyy dashboard lan [--home PATH] [--socket PATH]

LAN mode 是显式的,因为它会把 dashboard URL 暴露给同一网络上的其他可信设备。