Install or refresh OneCLI as NanoClaw's gateway provider. Use when setup selects OneCLI, an existing OneCLI-backed install is migrated to the gateway seam, or i
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-add-onecli-0bc8da0c6290 ,按照其中的说明把「add-onecli」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
This skill owns the full OneCLI integration. NanoClaw core supplies the generic gateway seam and existing skill engine.
Copy the package's native adapter, tests, and agent guidance into their normal NanoClaw paths. NanoClaw core owns the approval workflow.
payload/src/gateway-providers/onecli-files.ts -> src/gateway-providers/onecli-files.ts
payload/src/gateway-providers/onecli-files.test.ts -> src/gateway-providers/onecli-files.test.ts
payload/src/gateway-providers/onecli.ts -> src/gateway-providers/onecli.ts
payload/src/gateway-providers/onecli.test.ts -> src/gateway-providers/onecli.test.ts
payload/src/gateway-providers/onecli-install.test.ts -> src/gateway-providers/onecli-install.test.ts
payload/container/skills/onecli-gateway/SKILL.md -> container/skills/onecli-gateway/SKILL.md
payload/container/skills/onecli-gateway/instructions.md -> container/skills/onecli-gateway/instructions.md
payload/docs/onecli-upgrades.md -> docs/onecli-upgrades.md
The provider file makes the only product registration call. It translates OneCLI sessions and native approval events into the generic contract.
import './onecli.js';
@onecli-sh/sdk@2.2.1
The setup script safely reuses a healthy existing installation, installs the pinned local gateway when absent, or uses NANOCLAW_ONECLI_API_HOST and NANOCLAW_ONECLI_API_TOKEN for a remote gateway.
pnpm exec tsx .claude/skills/add-onecli/scripts/setup.ts
pnpm run build
pnpm exec vitest run src/gateway-providers/onecli-files.test.ts src/gateway-providers/onecli-install.test.ts src/gateway-providers/onecli.test.ts src/gateway-providers/gateway-provider-registry.test.ts src/gateway-approval-coordinator.test.ts
The setup consumer writes NANOCLAW_GATEWAY_PROVIDER=onecli only after every directive above succeeds. Claude authentication is then completed through scripts/auth.ts; credentials never enter an agent container.
During an atomic NanoClaw upgrade, scripts/detect.ts identifies an older implicit OneCLI installation so the generic updater can preserve that choice before the service restarts.