📦 claude-code-noninteractive-in-node

v1.0.0

通过 OpenClaw Node 将 Claude Code 作为非交互式编码代理在远程机器上调用。适用于:(1) 编码代理与 G... 位于不同机器时

0· 0·0 当前·0 累计
0

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install claude-code-noninteractive-in-node
镜像加速npx clawhub@latest install claude-code-noninteractive-in-node --registry https://cn.longxiaskill.com

技能文档

Claude Code Remote(OpenClaw Node) 通过 OpenClaw Node 在远程机器上以非交互模式调用 Claude Code。

Gateway ──exec host=node──→ Node ──bash -lc──→ claude --bare ──→ AI API

快速参考 场景 | 命令模板 短任务 | bash -lc 'cd && claude --bare -p "<任务>" --max-turns 10' 长任务流式 | bash -lc 'cd && claude --bare -p "<任务>" --output-format stream-json --verbose --include-partial-messages --max-turns 30' 全权限 | bash -lc 'cd && claude --bare -p "<任务>" --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages --max-turns 30' 只读分析 | bash -lc 'cd && claude --bare -p "<任务>" --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" --max-turns 10'

与本地差异 Aspect | Local | Remote (Node) Command wrapper | Direct | bash -lc '...' 必需 Project path | Native | 为速度使用 WSL/Linux 路径 Env loading | Shell-dependent | 必须在 .bashrc 交互守卫之前 Exec tool | Standard | host=node node=

权限模式 与 claude-code-local 四级相同,见 references/permissions.md。 Level | Remote 特注 1 Read | 安全—无文件写入 2 Analyze | bash -lc 可能需 Node 批准 3 Edit | 写入可能触发 Node 安全策略 4 Full | 某些 Node 会阻止特定写操作

Node 安全绕过 多行 heredocs → 先写脚本到 /tmp/ 内联 Python → 同上,用脚本文件 写操作 → 先备份:cp f f.bak.$(date +%F)

OpenClaw Exec 配置 { "command": "bash -lc 'cd && claude --bare -p \"\" --max-turns 10'", "host": "node", "node": "", "background": true, "timeout": 600 }

Worktree 设置 慢速跨文件系统挂载(如 WSL /mnt/c/)项目: git worktree add -b work-branch /home/user/project-worktree main 共享 git 数据,工作文件放在快速原生文件系统。

环境配置 确保非交互 shell 加载 API 凭证: # 在 ~/.bashrc 的交互守卫之前: export ANTHROPIC_API_KEY=sk-... # 交互守卫(保持原样): case $- in i) ;; *) return;; esac

时序与任务后 同 claude-code-local,见其 SKILL.md 的时序表与清单。

参考资料 references/permissions.md — 权限模式详解 references/troubleshooting.md — 远程特有故障模式

数据来源ClawHub ↗ · 中文优化:龙虾技能库