alink-cli
v0.4.2
Published
一条命令把工作机接入 AgentLink,随时随地遥控本机的编码 agent。One command to link your machine to AgentLink and control your coding agents from anywhere.
Downloads
949
Maintainers
Readme
agentlink
在工作机上一条命令把本机接入 AgentLink,随时随地从手机 / 网页遥控本机安装的编码 agent(Claude Code / Codex CLI / JoyCode)。连接是出站的——走 NAT / 防火墙无需端口转发、无需 VPN,断线自动重连。
One command on your work machine links it to AgentLink so you can drive your local coding agents (Claude Code / Codex CLI / JoyCode) from anywhere. The connection dials out, so it just works behind NAT/firewalls; it reconnects automatically.
Quick start
在控制台“添加机器”拿到机器凭证(al1.… 整串),然后在工作机上:
npx alink-cli --token al1.xxxxxxxx首次成功连上后,凭证会存到 ~/.agentlink/credential(权限 0600)。之后在同一台机器上直接裸跑即可,命令行 token 只需出现这一次:
npx alink-cli参数 Options
| 参数 | 说明 | 默认值 |
| --- | --- | --- |
| --token <token> | 机器凭证(控制台生成的 al1.… 整串)。也可用环境变量 AGENTLINK_TOKEN 提供(--token 优先)。 | 依次取 AGENTLINK_TOKEN → ~/.agentlink/credential |
| --hub <wss://…> | 要连接的 hub 地址。 | wss://link.harmopath.com(官方 hub) |
| --dir <path> | 工作目录根,可重复给多次;运行时可用其下任意子目录,网页里以目录树浏览。 | 当前目录 process.cwd() |
| --tunnel | 不连任何 hub:本地起一个 hub + 免费 Cloudflare 隧道,打印公网链接(需 cloudflared)。与 --hub 互斥。 | — |
| --help, -h | 显示用法。 | — |
自建 hub Self-hosting
连自己的 agentlink-hub 时给 --hub 即可;单租户 hub 不需要预先铸凭证——不带 --token 时会自动生成一个并打印访问链接:
npx alink-cli --hub wss://your-host:8080
# → prints: open https://your-host:8080/?token=<uuid>Point --hub at your own hub to skip the official one entirely. Against a single-tenant hub no minted credential is needed — without --token a fresh one is generated and the access link printed. The connection is outbound (works behind NAT, no port forwarding) and reconnects automatically; use wss:// (TLS) for anything public.
凭证与端到端加密 Credential & E2EE
凭证是这台机器的远程执行凭据,请妥善保管:公网请务必用 wss://(TLS)。多租户凭证(al1. 前缀)里的第四段是端到端加密(E2EE)主密钥——它只留在本机、从不上网,daemon 把它单独归档到 ~/.agentlink/enckeys.json(0600),hub 永远只看到密文。撤销某台机器:在控制台里重新添加即可让旧凭证失效。
The credential grants remote code execution on this machine — keep it safe and use wss:// (TLS) on any public hub. The trailing segment of an al1. credential is the end-to-end encryption key; it never leaves this machine, so the hub only ever sees ciphertext.
完整文档 Full docs: github.com/baichen99/agentlink · MIT
