Docs配置配置参考
返回文档
配置

配置参考

config.yaml 中所有 YeePilot 配置选项的完整参考

最后更新: 2026年3月1日

配置文件

YeePilot 的配置存储在 ~/.yeepilot/config.yaml。该文件在初始设置时自动创建,可以手动编辑或通过 yeepilot setup 命令进行修改。

yaml
# 最小配置示例
ai:
  provider: openai
  model: gpt-4o
 
security:
  mode: strict
 
personality:
  language: en

要使用默认值重新生成配置,请运行:

bash
yeepilot setup --reset

AI 设置

ai: 部分控制 YeePilot 使用的 AI 提供商和模型,以及与语言模型的交互方式。

yaml
ai:
  provider: openai
  model: gpt-4o
  api_key: ""
  base_url: ""
  max_tokens: 4096
  token_mode: normal
  conversation_max_history: 10
  output_truncate_length: 500
  max_response_length: 102400
  engine: v2
  autonomy_profile: guarded
  think_mode: "off"
  agent_mode: false

provider

使用的 AI 后端。支持的值:openaianthropicopenrouter

yaml
ai:
  provider: openai

model

具体的模型标识符。必须是所选提供商的有效模型 ID。

提供商示例模型
openaigpt-4o, gpt-4o-mini, o3-mini
anthropicclaude-sonnet-4-20250514, claude-haiku-4-20250414
openrouteropenai/gpt-4o, anthropic/claude-sonnet-4-20250514

api_key

配置提供商的 API 密钥。虽然可以在此处设置,但推荐通过 yeepilot setup --auth 使用操作系统密钥环或环境变量以获得更好的安全性。

yaml
ai:
  api_key: "sk-..."

base_url

覆盖默认 API 端点。适用于代理、本地模型或替代的 API 兼容服务。

yaml
ai:
  provider: openai
  base_url: "http://localhost:11434/v1"

max_tokens

AI 每次回复可生成的最大 Token 数。默认:4096

yaml
ai:
  max_tokens: 8192

token_mode

控制 YeePilot 管理 Token 使用量的积极程度。默认:normal

  • normal -- 完整上下文和详细回复。
  • saver -- 更短的系统提示、压缩的历史记录、更积极的上下文压缩。显著降低费用。
yaml
ai:
  token_mode: saver

conversation_max_history

在对话上下文中保留的先前消息数量。默认:10。较低的值减少 Token 使用量并让 AI 专注于最近的任务。

yaml
ai:
  conversation_max_history: 10

output_truncate_length

包含在 AI 上下文中的命令输出最大字符数。默认:500。防止大量输出消耗您的 Token 预算。

yaml
ai:
  output_truncate_length: 500

max_response_length

AI 回复大小的硬限制,以字节为单位。默认:102400(100 KB)。

yaml
ai:
  max_response_length: 102400

engine

执行引擎版本。默认:v2

  • v2 -- 当前引擎,支持智能体循环、工具调用和多步骤执行。
  • legacy -- 无工具调用的单轮命令生成。
yaml
ai:
  engine: v2

autonomy_profile

控制 AI 在不请求确认的情况下执行命令的自由度。默认:guarded

  • high -- 自动执行 SAFE 和 MODERATE 命令。只有 DANGEROUS 命令需要确认。
  • guarded -- 自动执行 SAFE 命令。MODERATE 和 DANGEROUS 命令需要确认。
  • strict_review -- 每个命令在执行前都需要明确确认,无论风险等级如何。
yaml
ai:
  autonomy_profile: guarded

think_mode

为支持的提供商(Anthropic、OpenAI 推理模型)启用扩展推理。默认:off

  • off -- 无扩展思考。
  • on -- 使用提供商默认预算启用思考。
  • low -- 最小思考预算。
  • medium -- 适合复杂任务的中等思考预算。
  • high -- 最高思考预算,用于最困难的问题。
yaml
ai:
  think_mode: medium

您也可以在会话中使用 /think 斜杠命令切换。

agent_mode

启用 AI 智能体循环,允许 AI 链接多个工具调用和命令以完成复杂任务。默认:false

yaml
ai:
  agent_mode: true

安全设置

security: 部分控制命令安全检查、确认要求和审计日志。

yaml
security:
  mode: strict
  require_confirmation: true
  blocked_patterns:
    - "rm -rf /"
    - "mkfs"
    - "dd if=/dev/zero"
  audit_log_path: "~/.yeepilot/audit.log"
  audit_max_size_mb: 10
  audit_max_archives: 50

mode

整体安全态势。默认:strict

  • strict -- 最大安全性。大多数破坏性命令被完全阻止。推荐用于生产服务器。
  • moderate -- 平衡安全性。破坏性命令需要确认但不会被阻止。
  • permissive -- 最小限制。只有最危险的命令(如擦除磁盘)被阻止。仅适用于隔离的开发环境。
yaml
security:
  mode: strict

require_confirmation

是否在执行命令前提示确认。默认:true。设为 false 时,自主性配置文件决定哪些命令自动运行。

yaml
security:
  require_confirmation: true

blocked_patterns

完全阻止的额外命令模式。这些在 YeePilot 内置的 70+ 危险模式之上添加。

yaml
security:
  blocked_patterns:
    - "shutdown"
    - "reboot"
    - "halt"
    - "init 0"

audit_log_path

防篡改审计日志的文件路径。默认:~/.yeepilot/audit.log

yaml
security:
  audit_log_path: "/var/log/yeepilot/audit.log"

audit_max_size_mb

单个审计日志文件在轮换前的最大大小。默认:10 MB。

yaml
security:
  audit_max_size_mb: 10

audit_max_archives

保留的轮换审计日志文件数量。默认:50

yaml
security:
  audit_max_archives: 50

沙箱设置

sandbox: 部分配置命令执行隔离。沙箱设置限制命令可以做什么以保护您的系统。

yaml
sandbox:
  enabled: true
  use_namespaces: true
  network_access: true
  max_cpu_seconds: 300
  max_memory_mb: 512
  max_filesize_mb: 100
  max_processes: 64
  denied_paths:
    - "/etc/shadow"
    - "/root/.ssh"

enabled

启用或禁用执行沙箱。默认:true。禁用会移除所有执行限制。

yaml
sandbox:
  enabled: true

use_namespaces

使用 Linux 内核命名空间进行完全进程隔离(用户、PID、挂载、网络)。默认:true。仅在 Linux 上可用。在 macOS 和 Windows 上回退到进程级别限制。

yaml
sandbox:
  use_namespaces: true

network_access

允许命令访问网络。默认:true。设为 false 可完全隔离命令执行与网络的连接。

yaml
sandbox:
  network_access: false

max_cpu_seconds

单个命令可以消耗的最大 CPU 时间。默认:300 秒(5 分钟)。

yaml
sandbox:
  max_cpu_seconds: 300

max_memory_mb

命令可以使用的最大内存。默认:512 MB。

yaml
sandbox:
  max_memory_mb: 512

max_filesize_mb

命令可以创建的任何单个文件的最大大小。默认:100 MB。

yaml
sandbox:
  max_filesize_mb: 100

max_processes

命令可以派生的最大子进程数。默认:64

yaml
sandbox:
  max_processes: 64

denied_paths

命令不允许读取或写入的文件路径。在内置保护路径之上添加。

yaml
sandbox:
  denied_paths:
    - "/etc/shadow"
    - "/etc/passwd"
    - "/root/.ssh"
    - "/home/*/.ssh/id_*"

个性化设置

personality: 部分控制 YeePilot 与您交流的方式。

yaml
personality:
  tone: casual
  language: en
  use_emoji: true
  verbosity: normal

tone

AI 回复的对话语气。默认:casual

  • casual -- 友好、对话式的回复。
  • professional -- 正式、简洁的回复。适合工作环境。
  • minimal -- 最少的解释。只有命令和结果。
yaml
personality:
  tone: professional

language

YeePilot 界面和 AI 回复的语言。默认:en

  • en -- English
  • de -- German(Deutsch)
  • auto -- 从系统区域设置检测
yaml
personality:
  language: auto

use_emoji

在 AI 回复和状态消息中包含表情符号。默认:true

yaml
personality:
  use_emoji: false

verbosity

AI 在回复中包含的详细程度。默认:normal

  • brief -- 简短、直接的解释。
  • normal -- 带有上下文的平衡解释。
  • detailed -- 包含背景信息的详尽解释。
yaml
personality:
  verbosity: detailed

TUI 设置

tui: 部分自定义终端用户界面的外观和行为。

yaml
tui:
  theme: auto
  stats_panel: true
  code_line_numbers: true
  live_stream_panel_enabled: true
  live_stream_panel_height: 12

theme

终端界面的颜色主题。默认:auto(匹配终端背景)。

可用主题:autodarklightneon 等。

yaml
tui:
  theme: neon

stats_panel

显示带有 Token 使用量、费用和会话信息的统计面板。默认:true

yaml
tui:
  stats_panel: true

code_line_numbers

在 TUI 显示的代码块中显示行号。默认:true

yaml
tui:
  code_line_numbers: true

live_stream_panel_enabled

显示一个在命令执行时实时流式传输命令输出的面板。默认:true

yaml
tui:
  live_stream_panel_enabled: true

live_stream_panel_height

实时流面板的行数。默认:12

yaml
tui:
  live_stream_panel_height: 16

保险库设置

vault: 部分配置加密凭据保险库,用于存储数据库密码和 API 令牌等密钥。

yaml
vault:
  enabled: true
  start_locked: true
  auto_lock_duration: "15m"
  bruteforce_protection_enabled: true

enabled

启用加密保险库功能。默认:true

yaml
vault:
  enabled: true

start_locked

YeePilot 启动时保险库是否应处于锁定状态,需要您解锁。默认:true

yaml
vault:
  start_locked: true

auto_lock_duration

在此不活动期后自动锁定保险库。默认:15m。支持 Go 持续时间格式(例如 5m1h30s)。

yaml
vault:
  auto_lock_duration: "30m"

bruteforce_protection_enabled

启用暴力破解保护,在多次失败后限制解锁尝试。默认:true

yaml
vault:
  bruteforce_protection_enabled: true

平台设置

platform: 部分配置与 YeePilot 平台服务的连接。

yaml
platform:
  server_url: "https://yee.to"

server_url

YeePilot 平台服务器的 URL。默认:https://yee.to。仅在使用自托管平台实例时更改此值。

yaml
platform:
  server_url: "https://yee.to"

更新设置

update: 部分控制自动更新行为。

yaml
update:
  auto_check: true
  check_interval_hours: 1

auto_check

YeePilot 启动时自动检查更新。默认:true

yaml
update:
  auto_check: true

check_interval_hours

检查更新的频率,以小时为单位。默认:1

yaml
update:
  check_interval_hours: 24

文件设置

files: 部分控制 /file 命令用于上传文件作为 AI 上下文的行为。

yaml
files:
  max_entries: 20
  max_file_size: 102400
  max_total: 524288
  upload_dir: ""

max_entries

可以附加到会话的最大文件数量。默认:20

yaml
files:
  max_entries: 20

max_file_size

单个文件的最大大小,以字节为单位。默认:102400(100 KB)。

yaml
files:
  max_file_size: 102400

max_total

所有附加文件的最大总大小,以字节为单位。默认:524288(512 KB)。

yaml
files:
  max_total: 524288

upload_dir

临时文件上传的自定义目录。留空使用系统默认值。

yaml
files:
  upload_dir: "/tmp/yeepilot-files"

完整配置示例

以下是包含所有部分和常用调整值的综合配置文件:

yaml
ai:
  provider: openai
  model: gpt-4o
  max_tokens: 4096
  token_mode: normal
  conversation_max_history: 10
  output_truncate_length: 500
  max_response_length: 102400
  engine: v2
  autonomy_profile: guarded
  think_mode: "off"
  agent_mode: false
 
security:
  mode: strict
  require_confirmation: true
  blocked_patterns: []
  audit_log_path: "~/.yeepilot/audit.log"
  audit_max_size_mb: 10
  audit_max_archives: 50
 
sandbox:
  enabled: true
  use_namespaces: true
  network_access: true
  max_cpu_seconds: 300
  max_memory_mb: 512
  max_filesize_mb: 100
  max_processes: 64
  denied_paths: []
 
personality:
  tone: casual
  language: en
  use_emoji: true
  verbosity: normal
 
tui:
  theme: auto
  stats_panel: true
  code_line_numbers: true
  live_stream_panel_enabled: true
  live_stream_panel_height: 12
 
vault:
  enabled: true
  start_locked: true
  auto_lock_duration: "15m"
  bruteforce_protection_enabled: true
 
platform:
  server_url: "https://yee.to"
 
update:
  auto_check: true
  check_interval_hours: 1
 
files:
  max_entries: 20
  max_file_size: 102400
  max_total: 524288