跳到正文
Skillpedia
智能体14k · #11327

grok-build

它能做什么

这项技能从终端以编程智能体的方式运行 Grok Build CLI。适合希望在明确权限下运行、编写脚本或检查 Grok 编程会话的开发者。

适用场景

  • ✓当你想用 Grok Build 命令行工具运行一项编程任务的时候。
  • ✓当你需要为脚本或 CI 任务进行非交互式运行的时候。
  • ✓当你想查看或恢复某个 Grok 编程会话的时候。

技能链接

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/grok-build/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/grok-build/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想在我的项目上运行 Grok Build 来修复一个失败的测试,不需要打开聊天窗口。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会检查 grok 工具是否已安装,阅读其帮助输出,并以你选择的模式运行任务。工作过程中,它会明确标示权限和沙盒设置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Grok Build CLI

Operate Grok Build from a terminal while keeping execution mode, permissions, sandboxing, session state, and output handling explicit.

Start with Local Evidence

  1. Confirm that the CLI is available:

    command -v grok
    grok version
    
  2. Inspect the installed command before giving version-sensitive advice:

    grok --help
    grok <subcommand> --help
    
  3. Inspect the configuration discovered for the target workspace when behavior depends on rules, skills, plugins, hooks, or MCP servers:

    grok --cwd /path/to/repo inspect
    grok --cwd /path/to/repo inspect --json
    
  4. Treat current official documentation and installed help as authoritative when they differ from this bundled reference.

Choose an Execution Mode

  • Run grok with no arguments for the interactive TUI.
  • Run grok "<initial prompt>" to open the TUI with an initial task.
  • Run grok -p "<prompt>" for one non-interactive turn that prints a result and exits.
  • Run grok agent stdio for an ACP client that communicates over stdin/stdout.
  • Run grok dashboard to open the Agent Dashboard.

Prefer headless mode for scripts, CI, bots, and agent orchestration. Prefer ACP only when the caller implements the ACP JSON-RPC lifecycle and consumes session/update chunks.

Authenticate

Use an interactive login on a developer machine:

grok login

Use device-code authentication in headless or remote environments:

grok login --device-auth

Use a locally cached login or provide XAI_API_KEY only to the process that needs it. Never print, persist, or commit credentials. Use grok logout to clear cached credentials.

Run Headlessly

Use an explicit working directory and output format:

grok --no-auto-update \
  --cwd /path/to/repo \
  --sandbox workspace \
  -p "Inspect the repository and explain the failing test." \
  --output-format json

Choose output according to the consumer:

  • Use plain for humans.
  • Use json for one final machine-readable object.
  • Use streaming-json for newline-delimited incremental events.
  • Add --json-schema '<schema>' when the installed CLI supports constrained structured output.

Pass --no-auto-update in scripts and CI to suppress background update checks. Do not parse interactive TUI rendering in automation.

Control Permissions and Isolation

Treat permissions and sandboxing as separate controls:

  • Use permission rules to decide whether a tool call may run.
  • Use a sandbox profile to limit what an approved call may access.
  • Prefer --sandbox workspace for normal repository changes.
  • Prefer --sandbox read-only for review and auditing.
  • Prefer --sandbox strict for an untrusted repository, then add narrow permission rules.
  • Use --allow <RULE> and --deny <RULE> for per-run policy; remember that deny rules win.
  • Use --always-approve only when the environment and command scope justify unattended execution. Pair it with a suitable sandbox and explicit deny rules.

Do not describe --always-approve as equivalent to sandboxing. The sandbox is off by default unless configured or selected.

Manage Sessions and Worktrees

Continue or resume intentionally:

grok -c
grok --resume <session-id>
grok --resume

Use --session-id <UUID> for a new named session, not to resume an existing one. Add --fork-session when branching from a resumed session.

Use a worktree when concurrent work could collide:

grok --worktree --ref main "Fix the flaky test"
grok --worktree=feature-name "Implement the feature"

Preview removal with grok worktree rm --dry-run <id> before deleting a worktree. Do not assume deleting a session removes its worktree.

Diagnose Before Editing Configuration

Use built-in inspection and diagnostics first:

grok inspect --json
grok mcp list --json
grok mcp doctor
grok plugin list
grok models

Prefer grok mcp add, grok mcp remove, and plugin subcommands over manually editing configuration when the CLI supports the requested operation. Keep secrets in environment variables rather than command history or committed configuration.

Read the Bundled References

Verify destructive commands suc

常见问题

它会在没有我授权的情况下运行吗?

不会。只有在你明确要求使用 Grok Build 时,才会加载这项技能。

如果没有安装 grok 怎么办?

智能体会停止,并向你提供安装和登录的指引。

它能管理会话和 worktree 吗?

能。这项技能涵盖会话、worktree、权限、沙盒以及 MCP 服务器。

详情

作者的原始描述

Operate the Grok Build CLI (`grok`), including interactive and headless runs, authentication, sessions, worktrees, permissions, sandboxing, MCP servers, plugins, inspection, updates, and automation output. Load only when the user explicitly authorizes this skill or names Grok Build / grok-build. Before any command, confirm the `grok` binary is available; if missing, stop and give install or auth guidance.

repo: XiaomiMiMo/MiMo-Code

热度

GitHub 星标
14k
排名
#11327
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能