Grok Bot软件基础设施AI 评分 · 72/100AI 辅助编辑·未发现明显提示词注入风险X

让 Grok Bot 安装 Claude Code、Codex CLI 与 acpx 并设定调用规则

输入:一段系统提示词 → 处理:Grok Bot 自动安装 CLI 工具、处理登录、验证执行 → 输出:可调用多模型编码 Agent 的环境与使用规则

经验丰富步骤提示词流程
给谁
希望在 Grok Bot 计算机上部署 Claude Code、Codex CLI 与 acpx,并建立跨模型调用规则的高级用户
你会得到
获得一个隔离在 ~/.local 的多编码 Agent 环境,含自动更新脚本与明确的调用边界规则
你需要
Claude Code · Codex

硬约束

需要 Grok Bot 计算机的 shell 访问权限;系统需满足 Node 22.13+(或准备下载 portable Node);需有 Claude、OpenAI、GitHub 账号用于交互式登录;全程不使用 sudo,所有安装限定在 ~/.local。

他们做了什么

作者 trevin 编写了一段完整提示词,让 Grok Bot 在计算机上自动安装 Claude Code、Codex CLI 与 acpx(acpx 用于跨模型调用),并建立何时使用这些编码 Agent 的规则。提示词涵盖安装路径、Node 版本处理、交互式登录、验证命令、自动更新脚本与五条使用边界规则。

效果如何

作者报告该提示词可交给 Grok Bot 直接执行,能打开跨模型订阅的编码场景(author_report)。未报告具体执行时间或失败案例。

值得知道

本站未实测此流程(reproduction=not_tested)。已知限制:系统 Node 版本若低于 22.13 需手动下载 portable Node;acpx 的 symlink 需手动替换为 wrapper 脚本;登录步骤必须用户交互接管,无法全自动;安装限定 ~/.local 不使用 sudo。作者另在 share.trev.in 提供相同内容的 markdown 版本。

步骤

  1. 安装 CLI 工具到 ~/.local

    让 Grok Bot 执行安装步骤,将所有工具放在 ~/.local 以 survive 计算机更新。依次:用 curl 安装 Claude Code 原生安装器;检查 Node 版本,若低于 22.13 则下载 portable Node 22 到 ~/.local/node22 并加入 PATH;用 Node 22 的 npm 全局安装 Codex 与 acpx 到 ~/.local;手动替换 acpx 的 symlink 为调用 Node 22 的 sh wrapper;按需安装 gh 独立二进制到 ~/.local/bin。

    运行提示词 · 来源原文。交给 Grok Bot 的系统提示词/指令字段,启动安装流程

    Set up Claude Code, Codex CLI, and acpx on your computer, and add rules for when to use them.
    
    Install
    - Install everything under `~/.local` so it survives computer updates. Don't use sudo or put anything in /usr.
    - Claude Code: use the native installer (`curl -fsSL https://t.co/HbvsPfGOOW | bash`). Make sure `~/.local/bin` is on PATH.
    - acpx needs Node 22.13 or newer. If the system node is older, download a portable Node 22 .tar.gz to ~/.local/node22 and put its bin folder on PATH in ~/.bashrc and ~/.profile.
    - Codex: `npm i -g @openai/codex --prefix ~/.local` (use Node 22's npm).
    - acpx: `npm i -g acpx --prefix ~/.local`. Then replace the `~/.local/bin/acpx` symlink with a small sh wrapper that runs Node 22's node on acpx's dist/cli.js. Delete the symlink first so you don't overwrite cli.js.
    - `gh`: if it's missing, install the standalone binary to `~/.local/bin`.
  2. 交互式登录

    Grok Bot 在需要登录时暂停并通知用户接管桌面。依次完成:Claude 账号登录(claude.ai)、Codex 的 ChatGPT 登录、以及 gh auth login(若 gh 未认证)。登录完成后,Grok Bot 执行验证命令确认状态。

    运行提示词 · 来源原文。交给 Grok Bot 的系统提示词/指令字段,处理交互式登录

    Logins (interactive, I'll do these)
    - Stop and tell me when each login is ready for me to take over on your desktop: claude (https://t.co/sHiUPYz83S account), codex (ChatGPT sign-in), and gh auth login if gh isn't already authenticated.
    - Afterward, verify with `claude auth status`, `codex login status`, and `gh auth status`.
  3. 验证 acpx 调用

    在临时文件夹中运行 acpx 命令,分别调用 claude 和 codex 执行测试指令,确认两者返回 OK 且退出码为 0。

    运行提示词 · 来源原文。交给 Grok Bot 的系统提示词/指令字段,执行验证

    Validate
    - In a temp folder, run: `acpx --cwd <tmp> --approve-reads --non-interactive-permissions deny claude exec "Reply with exactly: OK"`. Then run the same command with codex. Both should return OK and exit 0.
  4. 编写自动更新脚本

    创建 ~/.local/bin/update-ai-clis 脚本,用于更新全部三个工具(并在之后重写 acpx wrapper)。设置日常例行任务运行该脚本,脚本不触碰登录状态,仅在出错或版本变化时通知用户。

    运行提示词 · 来源原文。交给 Grok Bot 的系统提示词/指令字段,创建更新机制

    Keep updated
    - Write `~/.local/bin/update-ai-clis` to update all three (and rewrite the acpx wrapper afterward). Create a daily routine that runs it, reinstalls anything missing, never touches logins, and only messages me if something breaks or a version changes.
  5. 设定使用规则并保存到记忆

    将五条调用边界规则写入 Grok Bot 记忆:默认不使用这些 CLI;仅在请求、第二意见、对比或点名时使用;优先用 acpx 做自动化/无头运行;直接调用 CLI 仅限登录、更新和用户接管的交互会话;每次运行限定单一仓库或临时文件夹;默认只读,需用户批准才可写;禁止推送、合并、部署或外发;输出需标注由哪个 Agent 产生。

    运行提示词 · 来源原文。交给 Grok Bot 的系统提示词/指令字段,保存使用规则到记忆

    Usage rules (save to memory)
    - Don't use Claude Code, Codex, or acpx by default. My normal assistant and Cursor agents handle everyday work.
    - Use them on request, or for second-opinion reviews, head-to-head comparisons, or when I ask for one by name.
    - Prefer acpx for any automated or headless run. Use the CLIs directly only for logins, updates, and interactive sessions I take over.
    - Keep each run scoped to one repo or scratch folder. Allow reads only unless I approve writes. Never push, merge, deploy, or send anything through them.
    - Show me what they produced and say which agent produced it.

可复制提示词

搭建指导 · 来源原文。Grok Bot 的系统提示词/指令输入,启动完整安装与规则配置流程

这一段是提示词,页面不会在这里插入广告。

Set up Claude Code, Codex CLI, and acpx on your computer, and add rules for when to use them.

Install
- Install everything under `~/.local` so it survives computer updates. Don't use sudo or put anything in /usr.
- Claude Code: use the native installer (`curl -fsSL https://t.co/HbvsPfGOOW | bash`). Make sure `~/.local/bin` is on PATH.
- acpx needs Node 22.13 or newer. If the system node is older, download a portable Node 22 .tar.gz to ~/.local/node22 and put its bin folder on PATH in ~/.bashrc and ~/.profile.
- Codex: `npm i -g @openai/codex --prefix ~/.local` (use Node 22's npm).
- acpx: `npm i -g acpx --prefix ~/.local`. Then replace the `~/.local/bin/acpx` symlink with a small sh wrapper that runs Node 22's node on acpx's dist/cli.js. Delete the symlink first so you don't overwrite cli.js.
- `gh`: if it's missing, install the standalone binary to `~/.local/bin`.

Logins (interactive, I'll do these)
- Stop and tell me when each login is ready for me to take over on your desktop: claude (https://t.co/sHiUPYz83S account), codex (ChatGPT sign-in), and gh auth login if gh isn't already authenticated.
- Afterward, verify with `claude auth status`, `codex login status`, and `gh auth status`.

Validate
- In a temp folder, run: `acpx --cwd <tmp> --approve-reads --non-interactive-permissions deny claude exec "Reply with exactly: OK"`. Then run the same command with codex. Both should return OK and exit 0.

Keep updated
- Write `~/.local/bin/update-ai-clis` to update all three (and rewrite the acpx wrapper afterward). Create a daily routine that runs it, reinstalls anything missing, never touches logins, and only messages me if something breaks or a version changes.

Usage rules (save to memory)
- Don't use Claude Code, Codex, or acpx by default. My normal assistant and Cursor agents handle everyday work.
- Use them on request, or for second-opinion reviews, head-to-head comparisons, or when I ask for one by name.
- Prefer acpx for any automated or headless run. Use the CLIs directly only for logins, updates, and interactive sessions I take over.
- Keep each run scoped to one repo or scratch folder. Allow reads only unless I approve writes. Never push, merge, deploy, or send anything through them.
- Show me what they produced and say which agent produced it.

将整段提示词一次性交给 Grok Bot;安装过程中需在登录环节人工接管桌面完成认证。

来源

一段提示词让 Grok Bot 在你电脑上装好 Claude Code、Codex CLI 与 acpx,并写下何时调用哪个编码 Agent 的规则 · trevin · X · 2026-10-16T18:01:08.000Z

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例