设置

参考

环境变量

路径与身份验证

变量默认值描述
GROK_HOME~/.grokConfig、auth、sessions、skills、plugins 和 logs 的 home 目录。
XAI_API_KEY不使用 browser/session login 时使用的 API key(CI 和 headless)。

模型与更新

变量默认值描述
GROK_DEFAULT_MODELcatalog / configSession 默认模型(与 -m / --model 含义相同)。
GROK_WEB_SEARCH_MODELbuilt-inweb_search 工具使用的模型。
GROK_MODELS_BASE_URL自定义 inference base URL;模型列表来自 {base}/models
GROK_MODELS_LIST_URL{GROK_MODELS_BASE_URL}/models模型列表 URL 与默认值不同时进行覆盖。
GROK_XAI_API_BASE_URLhttps://api.x.ai/v1API-key auth 使用的 xAI API base。
GROK_DISABLE_AUTOUPDATERunset(允许更新)设置后禁止当前 process 的 auto-updater(CI/containers)。

工具、sandbox 与功能

变量默认值描述
GROK_SANDBOXoffSandbox profile:offworkspaceread-onlystrict(或自定义 profile 名称)。与 --sandbox 相同。
GROK_SANDBOX_AUTO_ALLOW_BASH0在活动 sandbox 中自动允许 bash(1/0)。
GROK_RESPECT_GITIGNORE未设置时使用 config强制 search/read tools 按 gitignore 过滤(1/0);覆盖 [tools] respect_gitignore
GROK_WEB_FETCH0启用 web_fetch 工具(1/0)。出于安全考虑默认关闭。
GROK_WEB_FETCH_PROXYweb_fetch 的 egress proxy URL。
GROK_MEMORY0启用 cross-session memory(1/0)。
GROK_SUBAGENTS0启用 subagents / task 工具(1/0)。
GROK_AGENTgrok-build内置 Agent 名称、profile 或 Agent 定义的绝对路径。
GROK_WRITE_FILE1禁用 write 工具时使用 0(read-only sessions)。
GROK_TOOL_SEARCH1为大型 toolset 按需发现 MCP 工具(1/0)。
GROK_LSP_TOOLS0启用 LSP code-intel 工具(1/0)。

UI 与外观

变量默认值描述
GROK_THEMEbuilt-in颜色主题。
GROK_SHOW_THINKING_BLOCKS1在 TUI 中显示 thinking/reasoning blocks(1/0)。
GROK_GROUP_TOOL_VERBS1折叠连续的 read/search/list 工具行(1/0)。
GROK_COLLAPSED_EDIT_BLOCKS0将 edits 折叠为单行 +N/-M 摘要(1/0)。
GROK_PROMPT_SUGGESTIONS1每个 turn 后显示下一 prompt 的 ghost text(1/0)。
GROK_SCROLL_SPEED50Mouse/trackpad 滚动速度(1100)。
GROK_SCROLL_MODEauto滚动输入:autowheeltrackpad
GROK_SCROLL_LINES未设置时使用 config每个滚动 tick 的行数(110)。
GROK_INVERT_SCROLL0反转垂直滚动方向(1/0)。
GROK_DEFAULT_SELECTED_PERMISSIONalways_allow_all_sessions第一次 permission prompt 中预先选择的行。
GROK_REMEMBER_TOOL_APPROVALS0显示每个工具的“Always allow …”选项(1/0)。
GROK_MOUSE_REPORTING_TOGGLE0Scrollback 中的 Ctrl+R 切换 terminal mouse capture(1/0)。
GROK_DISPLAY_REFRESH_AUTO_CADENCE0让 stream/scroll cadence 与 display refresh rate 匹配(1/0)。

MCP、logging 与 proxy

变量默认值描述
GROK_MCP_STARTUP_TIMEOUT_SECS30全局 MCP startup handshake timeout,单位为。每个 server 的 startup_timeout_sec 仍优先。
MCP_TIMEOUTsame stackClaude-compatible MCP startup timeout,单位为毫秒(在 GROK_MCP_STARTUP_TIMEOUT_SECS 之前检查)。
GROK_LOG_FILE将 logs 写入此路径(TUI 捕获 stderr 时很有用)。
RUST_LOGGROK_LOG_FILE 和 headless stderr 的 log filter(例如 debug)。
GROK_CRASH_HANDLER0Panic 时在 $GROK_HOME/crash/ 下写入报告(1/0)。
HTTPS_PROXY / HTTP_PROXY / NO_PROXYsystemOutbound traffic 使用的标准 HTTP(S) proxy variables。

Cursor / Claude 兼容性扫描器

所有扫描器默认均为开启true / 1false / 0):

变量描述
GROK_CURSOR_SKILLS_ENABLED扫描 Cursor skills 目录。
GROK_CURSOR_RULES_ENABLED扫描 .cursor/rules/
GROK_CURSOR_AGENTS_ENABLED扫描 Cursor Agent 定义。
GROK_CURSOR_MCPS_ENABLED扫描 Cursor mcp.json
GROK_CURSOR_HOOKS_ENABLED扫描 Cursor hooks。
GROK_CLAUDE_SKILLS_ENABLED扫描 Claude skills。
GROK_CLAUDE_RULES_ENABLED扫描 Claude rules。
GROK_CLAUDE_AGENTS_ENABLED扫描 CLAUDE.md / CLAUDE.local.md
GROK_CLAUDE_MCPS_ENABLED扫描 Claude MCP config。
GROK_CLAUDE_HOOKS_ENABLED扫描 Claude hooks。

TOML Values

项目 .grok/config.toml 仅提供 [mcp_servers][plugins][permission]。其他 section 应放在用户配置(~/.grok/config.toml$GROK_HOME/config.toml)中。

[models]

设置值 / 默认值描述
defaultmodel id(例如 "grok-build"新 sessions 使用的模型。
web_searchmodel id客户端 web_search 工具使用的模型。
default_reasoning_effort支持时使用 effort level默认模型的默认 reasoning effort。
session_summarymodel idSession 摘要使用的模型。
image_descriptionmodel id图像描述使用的模型。
extra_headersmap应用于每个模型的 headers(per-model keys 优先)。
temperature / top_p / max_completion_tokensnumbers全局 sampling 默认值。
max_retriesnumber全局 inference retry 默认值。
stream_tool_callstrue / false全局 tool-call streaming request shape(某些 BYOK endpoint 需要 false)。
allowed_modelsglob list限制 model picker / default / -m selection。
hidden_modelsid list从 picker 隐藏(仍可通过 -m 使用)。
disabled_modelsid list从 catalog 中移除(优先于 hidden)。

[model.<id>]

Custom / BYOK models(OpenAI-compatible 或 Anthropic Messages)。优先使用 env_key,不要硬编码 api_key

设置值 / 默认值描述
modelstring发送给 API 的 Model id。
base_urlURLProvider endpoint。
namestringModel picker 中的 label。
descriptionstring可选描述。
api_keystring内联 API key(优先使用 env_key)。
env_keyenv var name保存 API key 的环境变量。
api_backendchat_completionsresponsesmessagesProtocol。
temperature / top_p / max_completion_tokensnumbersSampling。
context_windowtokensContext window 大小(决定 auto-compact timing)。
extra_headersmapPer-request headers。
supports_backend_searchtrue / falseEndpoint 是否支持 Grok 托管的服务器端搜索工具。
supports_reasoning_effort / reasoning_effortbool / effort支持时使用的 reasoning controls。
stream_tool_callstrue / falsePer-model tool-call streaming。
max_retries / inference_idle_timeout_secsnumbersReliability。

[mcp_servers.<name>]

urlcommandargsenvheaders 等 string field 支持 ${VAR} 展开。Headers 还可以使用 {{session_id}}

stdio

设置值 / 默认值描述
commandstringExecutable(例如 npx)。
argsstring arrayArguments。
envmapProcess environment。
cwdpathProcess 的工作目录。

HTTP / remote

设置值 / 默认值描述
urlURLHTTP/SSE MCP endpoint。
headersmapRequest headers。
bearer_token_env_varenv var name从环境变量注入 Authorization: Bearer

通用设置

设置值 / 默认值描述
enabledtrue启用或禁用 server。
startup_timeout_sec30Startup handshake timeout(秒)。
tool_timeout_sec6000默认的每次 tool-call timeout(秒)。
tool_timeoutsmap name → secondsPer-tool timeout 覆盖。

[tools][toolset.*]

设置Section值 / 默认值描述
respect_gitignore[tools]true / false(默认 falsetrue 时,search 和 read tools 跳过 gitignored 文件。
file_toolset[toolset]standard(默认)hashlineFile edit tool scheme。
timeout_secs[toolset.bash]seconds(默认 120Foreground bash command timeout。
output_byte_limit[toolset.bash]bytes(默认 20000捕获的 bash output 上限。
max_timeout_secs[toolset.bash]seconds(默认 36000模型请求的 foreground timeout 上限。
auto_background_on_timeout[toolset.bash]true / false(默认 trueTimeout 时自动将命令转入后台。
proxy_endpoint[toolset.web_fetch]URLweb_fetch 的 egress proxy。
allowed_domains[toolset.web_fetch]string arrayweb_fetch 的 domain allowlist 覆盖。

[sandbox]config.toml

设置值 / 默认值描述
profileoff(默认)workspaceread-onlystrict(或 custom)Filesystem sandbox profile。Custom profile 名称在 sandbox.toml 中定义。
auto_allow_bashtrue / false(默认 falseSandbox profile 活动时跳过 bash permission prompt。

sandbox.toml 自定义 profiles

~/.grok/sandbox.toml(用户)或 .grok/sandbox.toml(项目)中定义 custom profiles。使用 [sandbox] profile = "…"(位于 config.toml 中)、--sandboxGROK_SANDBOX 激活。内置名称(offworkspaceread-onlystrictdevbox)不能重新定义为 custom profiles。

TOML

[profiles.project]
extends = "workspace"
restrict_network = false
read_only = ["/data"]
read_write = ["/tmp/scratch"]
# Kernel-enforced deny (read + write/rename). Entries with *, ?, or [ are globs.
deny = ["/data/shared-secrets", "**/.env", "**/*.pem"]
设置值 / 默认值描述
extendsworkspace(省略时默认)devboxread-onlystrict要继承的内置 profile。
restrict_networktrue / false限制 network access(执行时使用 Linux seccomp)。
read_onlypath list额外 read-only paths。
read_writepath list额外 read-write paths。
denypath 或 glob listKernel-enforced deny,适用于 read 和 write/rename。条目包含 *?[ 时为 glob(例如 **/.env**/*.pem)。

当 sandbox 可以应用时,非空 deny list 在 kernel level 执行。在 Linux 上,read-deny 需要 bubblewrap。操作指南请参阅 Sandbox。Managed pins 请参阅 Enterprise 部署

[session][cli][hints]

设置Section值 / 默认值描述
auto_compact_threshold_percent[session]0–100(默认 85Context 用量达到此百分比时自动压缩。
load_envrc[session]true / false(默认 true.envrc variables 注入 bash。
auto_update[cli]true / false(未设置时默认开启)启动时检查 CLI updates。
channel[cli]stablealphaRelease channel preference。
show_tips[cli]true / falseStartup tips。
new_session_worktree_mode[hints]askalwaysnever(默认 never/new 是否提供 worktree
fork_worktree_mode[hints]askalwaysnever(默认 ask/fork 是否提供 worktree。

[ui][ui.display_refresh][ui.contextual_hints]

设置Section值 / 默认值描述
compact_mode[ui]true / false(默认 false更紧凑的 message padding,也可用 /compact-mode
screen_mode[ui]fullscreen(未设置时默认)minimal普通 grok 的默认 render mode。需要重启。
show_timestamps[ui]true / false(默认 true消息旁显示时钟时间,也可用 /timestamps
show_timeline[ui]true / false(默认 false使用每个 turn 的 tick rail 代替 scrollbar。
page_flip_on_send[ui]true / false(默认 true将已发送 prompt 对齐到 viewport 顶部。
max_thoughts_width[ui]40500(默认 120Thoughts panel 的 column width。
combine_queued_prompts[ui]true / false(默认 false将连续普通 follow-up 合并成一个 turn。
theme[ui]theme name 或 auto / system(默认 Grok Night)颜色主题。auto 跟随 OS Light/Dark,也可用 /theme
auto_dark_theme[ui]theme name(默认 groknighttheme = "auto" 且 OS 为 Dark 时使用的主题。
auto_light_theme[ui]theme name(默认 grokdaytheme = "auto" 且 OS 为 Light 时使用的主题。
simple_mode[ui]true / false(默认 truetrue 时使用 Readline prompt editing;为 false 时使用实验性 vim prompt keys。
vim_mode[ui]true / false(默认 falseScrollback 中使用 Vim keys(不影响 prompt),也可用 /vim-mode
prompt_suggestions[ui]true / false(默认 true每个 turn 后显示下一 prompt 的 ghost text(按 Tab 接受)。
mouse_reporting_toggle[ui]true / false(默认 falseScrollback 中的 Ctrl+R 切换 terminal mouse capture。
keep_text_selection[ui]flash(默认)holdword_select应用内 selection:短暂闪烁、保持或双击选择单词。
cursor_blink[ui]true / false(未设置时继承 terminal)强制 block cursor 闪烁(true)或保持稳定(false)。
show_thinking_blocks[ui]true / false(默认 trueStreaming 时显示 thinking/reasoning blocks。
group_tool_verbs[ui]true / false(默认 true将连续 read/search/list 工具行折叠成一个摘要。
collapsed_edit_blocks[ui]true / false(默认 false将 edits 显示为单行 +N/-M 摘要。
render_mermaid[ui]auto(默认)onoffMermaid diagrams:可点击的打开行(auto/on)或 raw source(off)。
scroll_speed[ui]1100(默认 50Mouse/trackpad 滚动速度 multiplier。
scroll_mode[ui]auto(默认)wheeltrackpad自动检测错误时强制 wheel 或 trackpad。
scroll_lines[ui]110(未设置时使用 terminal profile)Wheel 和 trackpad 每个 scroll tick 的行数。
invert_scroll[ui]true / false(默认 false反转垂直滚动方向。
permission_mode[ui]defaultaskautoalways-approve默认 tool-permission 行为。Enterprise lock 使用 requirements.toml
default_selected_permission[ui]always_allow_all_sessions(默认)allow_command_alwaysallow_oncerejectSession 第一次 prompt 中预先选择的 approval 行。
remember_tool_approvals[ui]true / false(默认 false显示每个工具的“Always allow …”选项。需要重启。
cancel_subagents_on_turn_cancel[ui]ask(未设置时默认)always_stopalways_continue取消仍有 subagents 运行的 turn 时的行为。
hunk_tracker_mode[ui]agent_only(默认)all_dirtyoffFile-change hunk tracking。需要重启。
fork_secondary_model[ui]model id(默认:main default)Fork 时 secondary Agent 使用的模型。
voice_keybind_enabled[ui]true / false(默认 true为 voice dictation 启用 Ctrl+Space / F8(关闭时 /voice 仍可用)。
voice_capture_mode[ui]hold(默认)toggleHold-to-talk 或按下切换 voice capture。
voice_stt_language[ui]language code 或 auto(默认 en / [voice].languageDictation 的 Speech-to-text language。
auto_cadence_enabled[ui.display_refresh]true / false(默认 false让 stream/scroll cadence 与 display refresh rate 匹配。需要重启。
undo[ui.contextual_hints]true / false(默认 trueCtrl+Z 恢复被清空的 prompt draft。
plan_mode[ui.contextual_hints]true / false(默认 true对规划型 prompts 建议 plan 模式(Shift+Tab)。
image_input[ui.contextual_hints]true / false(默认 true模型接受图像时显示 clipboard image paste 提示。
send_now[ui.contextual_hints]true / false(默认 true排队 mid-turn follow-up 后,在空 prompt 上按 Enter 会立即发送。
small_screen[ui.contextual_hints]true / false(默认 true在较矮 terminal 上建议 /compact-mode
word_select[ui.contextual_hints]true / false(默认 true使用 fold/nav selection 双击后,指向 settings 中的 Word select。
ssh_wrap[ui.contextual_hints]true / false(默认 trueSSH 缺少 clipboard sink 时推荐 grok wrap

[permission]

适用于项目 scope 和用户 scope。评估顺序:deny > ask > allow

设置描述
allow / deny / askrule string arrays紧凑规则,例如 Bash(git *)Read(src/**)Edit(**/*.rs)MCPTool(server__*)
rules{ action, tool, pattern? } array详细形式。actionallowdenyasktoolanybasheditreadgrepmcpwebfetch

[features][subagents][memory]

设置Section值 / 默认值描述
web_fetch[features]true / false启用 web_fetch 工具。
lsp_tools[features]true / false(默认关闭)提供 LSP 工具。
write_file[features]true / false(默认开启)启用 write 工具。
tool_search[features]true / false(默认开启)MCP tool search / discovery。
enabled[subagents]true / falseSubagent / task 工具总开关。
toggle[subagents.toggle]subagent → bool map启用或禁用单个 subagent 类型。
models[subagents.models]subagent → model id mapPer-subagent model routing。
enabled[memory]true / false(默认关闭)Cross-session memory 总开关。

[skills][plugins][compat.*]

设置Section描述
paths[skills] / [plugins]path lists额外 skill 或 plugin 目录。
disabled[skills] / [plugins]name lists发现但不激活。
enabled[plugins]name lists显式启用 plugins(项目 plugins 可能默认关闭)。
skills / rules / agents / mcps / hooks[compat.cursor] / [compat.claude]true / false(默认 true扫描 Cursor 或 Claude harness 目录。