返回顶部
a

acp-remote远程ACP连接

Connect to remote ACP server and execute commands via imclaw-cli.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
136
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

acp-remote

ACP 远程连接

连接到远程 ACP(代理客户端协议)服务器,并使用 imclaw-cli 执行命令。

前置条件

自动安装依赖

在使用此技能前,请确保已安装 imclaw-cli 和 acpx。运行以下命令自动安装:

bash

安装 acpx(ACP 协议支持)


if ! command -v acpx &> /dev/null; then
npm install -g acpx@latest
fi

安装 imclaw-cli

if ! command -v imclaw-cli &> /dev/null; then curl -fsSL https://raw.githubusercontent.com/smallnest/imclaw/main/scripts/install.sh | bash fi

手动安装

安装 acpx

bash
npm install -g acpx@latest

安装 imclaw-cli

通过 GitHub Releases 安装:

bash

1. 检测平台


OS=$(uname -s | tr [:upper:] [:lower:])
ARCH=$(uname -m)
[ $ARCH = x86_64 ] && ARCH=amd64
[ $ARCH = aarch64 ] && ARCH=arm64

2. 获取最新版本号

LATEST=$(curl -s https://api.github.com/repos/smallnest/imclaw/releases/latest | grep tag_name | sed -E s/.([^]+)./\1/)

3. 下载并解压

curl -sL https://github.com/smallnest/imclaw/releases/download/${LATEST}/imclaw${OS}${ARCH}.tar.gz | tar xz -C /tmp

4. 安装到 PATH

mkdir -p ~/bin mv /tmp/imclaw-cli ~/bin/ chmod +x ~/bin/imclaw-cli

5. 确保 ~/bin 在 PATH 中

echo export PATH=$HOME/bin:$PATH >> ~/.bashrc # 或 ~/.zshrc

验证安装

bash
imclaw-cli --help
acpx --version

配置

设置远程服务器 URL 和可选的认证令牌:

bash

默认服务器(使用默认值时可以省略)


export IMCLAW_SERVER=ws://your-server:8080/ws

认证令牌(如果服务器需要认证)

export IMCLAW_TOKEN=your-secret-token

或通过命令行直接传递。

服务器配置

IMClaw 服务器使用命令行标志(无需配置文件):

bash

使用默认设置启动服务器


imclaw

自定义端口和认证令牌

imclaw --port 9000 --token my-secret-token

显示帮助

imclaw --help
标志默认值描述
-H, --host0.0.0.0服务器主机地址
-p, --port
8080 | 服务器端口 | | --timeout | 30 | 默认超时时间(秒) | | --token | | 认证令牌(空值表示无需认证) |

使用方法

单次模式(推荐)

bash

基本用法


imclaw-cli --server ws://your-server:8080/ws -p 你好

带认证令牌

imclaw-cli --server ws://your-server:8080/ws --token your-token -p 你好

使用特定代理

imclaw-cli --server ws://your-server:8080/ws --agent codex -p 分析这段代码

JSON 输出

imclaw-cli --server ws://your-server:8080/ws --format json -p 列出文件

继续会话

bash

第一条消息创建会话,返回会话 ID


imclaw-cli --server ws://your-server:8080/ws -p 阅读 README.md

使用相同会话继续

imclaw-cli --server ws://your-server:8080/ws --session -p 总结内容

参数

参数描述
--serverACP 服务器的 WebSocket URL(默认:ws://localhost:8080/ws)
--token
认证令牌(如果需要) | | -p, --prompt | 提示消息(单次模式) | | --session | 要继续的会话 ID | | --agent | 代理类型:claude、codex 等(默认:claude) | | --format | 输出格式:text、json、quiet(默认:text) | | --approve-all | 自动批准所有权限请求 | | --approve-reads | 自动批准读取,写入时提示(默认) | | --deny-all | 拒绝所有权限请求 | | --allowed-tools | 逗号分隔的工具名称(默认:Bash、Read、Write) | | --cwd | 工作目录 | | --timeout | 最大等待时间(秒) | | --model | 代理模型 ID |

示例

在远程执行 Shell 命令

bash
imclaw-cli --server ws://remote-server:8080/ws \
--agent claude \
--approve-all \
-p 运行 df -h 并显示磁盘使用情况

分析远程代码库

bash
imclaw-cli --server ws://remote-server:8080/ws \
--cwd /path/to/project \
-p 审查 main.go 文件并提出改进建议

通过 SSH 隧道使用

bash

首先创建 SSH 隧道


ssh -L 8080:localhost:8080 user@remote-server -N &

通过 localhost 连接

imclaw-cli --server ws://localhost:8080/ws -p 来自远程的问候

使用令牌的安全连接

bash

配置了 auth_token 的服务器


imclaw-cli \
--server wss://secure-server:8080/ws \
--token your-secret-token \
-p 执行分析任务

环境变量

为方便起见,可以设置以下环境变量:

bash

在 ~/.bashrc 或 ~/.zshrc 中


export IMCLAW_SERVER=ws://your-server:8080/ws
export IMCLAW_TOKEN=your-token

然后直接运行:
bash
imclaw-cli --server $IMCLAWSERVER --token $IMCLAWTOKEN -p 你好

提示

  1. 1. 会话复用:保存首次响应的会话 ID 以继续对话
  2. 权限控制:使用 --approve-all 进行非交互式自动化
  3. 输出解析:使用 --format json 进行程序化处理
  4. 工具限制:使用 --allowed-tools 限制代理可执行的操作
  5. 工作目录:文件操作时始终指定 --cwd

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 acp-remote-1775920742 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 acp-remote-1775920742 技能

通过命令行安装

skillhub install acp-remote-1775920742

下载

⬇ 下载 acp-remote v1.0.0(免费)

文件大小: 2.8 KB | 发布时间: 2026-4-12 08:37

v1.0.0 最新 2026-4-12 08:37
Initial release of acp-remote

- Connects to remote ACP servers and executes commands using imclaw-cli.
- Auto-installs and verifies required dependencies: imclaw-cli and acpx.
- Provides setup instructions for both automatic and manual installation.
- Details configuration options, usage parameters, and sample command-line usage.
- Supports authentication, SSH tunneling, file operations, and session management.
- Includes tips for session reuse, permission control, and output formatting.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部