alink-cli 0.6.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -48
- package/bin/agentlink.js +159 -454
- package/dist/NodeSqliteClient-BUlNQAY0.mjs +191 -0
- package/dist/NodeSqliteClient-BUlNQAY0.mjs.map +1 -0
- package/dist/bin.mjs +68667 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/daemon.js +168 -147
- package/dist/qr.js +22 -22
- package/package.json +36 -27
package/README.md
CHANGED
|
@@ -1,59 +1,25 @@
|
|
|
1
|
-
#
|
|
1
|
+
# alink-cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
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.
|
|
6
|
-
|
|
7
|
-
## Quick start
|
|
8
|
-
|
|
9
|
-
在控制台“添加机器”拿到机器凭证(`al1.…` 整串),然后在工作机上:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npx alink-cli --token al1.xxxxxxxx
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
首次成功连上后,凭证会存到 `~/.agentlink/credential`(权限 `0600`)。之后在同一台机器上**直接裸跑**即可,命令行 token 只需出现这一次;裸跑会默认转入后台,日志在 `~/.agentlink/daemon.log`:
|
|
3
|
+
一条命令把当前电脑上的 Claude Code、Codex、Gemini、Qwen、Kimi 等编码 agent 接入 AgentLink。
|
|
16
4
|
|
|
17
5
|
```bash
|
|
18
6
|
npx alink-cli
|
|
19
7
|
```
|
|
20
8
|
|
|
21
|
-
|
|
9
|
+
首次运行会在本机生成 E2EE 密钥并打印二维码;在 `https://link.harmopath.com` 登录 GitHub 后扫码或粘贴即可。凭证保存到 `~/.agentlink/credential`(`0600`),之后重复同一命令即可上线。
|
|
22
10
|
|
|
23
11
|
```bash
|
|
24
|
-
npx alink-cli
|
|
25
|
-
npx alink-cli
|
|
26
|
-
npx alink-cli
|
|
12
|
+
npx alink-cli --hub wss://your-hub.example.com
|
|
13
|
+
npx alink-cli --dir /path/to/project
|
|
14
|
+
npx alink-cli --pair
|
|
15
|
+
npx alink-cli qr
|
|
16
|
+
npx alink-cli credential status
|
|
27
17
|
```
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| `--hub <wss://…>` | 要连接的 hub 地址。 | `wss://link.harmopath.com`(官方 hub) |
|
|
35
|
-
| `--dir <path>` | 工作目录根,可重复给多次;运行时可用其下任意子目录,网页里以目录树浏览。 | 当前目录 `process.cwd()` |
|
|
36
|
-
| `--tunnel` | 不连任何 hub:本地起一个 hub + 免费 Cloudflare 隧道,打印公网链接(需 `cloudflared`)。与 `--hub` 互斥。 | — |
|
|
37
|
-
| `credential [status|path|show|set|clear]` | 查看路径、明文显示、手动覆盖或删除本机保存的凭证。 | `~/.agentlink/credential` |
|
|
38
|
-
| `qr` | 在终端打印本机凭证二维码,同时输出整串凭证供手动粘贴。 | 读取已保存凭证 |
|
|
39
|
-
| `status` / `logs -f` / `stop` / `restart` | 查看、跟随日志、停止或重启后台 daemon。 | — |
|
|
40
|
-
| `--help`, `-h` | 显示用法。 | — |
|
|
41
|
-
|
|
42
|
-
## 自建 hub Self-hosting
|
|
43
|
-
|
|
44
|
-
连自己的 [agentlink-hub](https://www.npmjs.com/package/agentlink-hub) 时给 `--hub` 即可;单租户 hub 不需要预先铸凭证——不带 `--token` 时会自动生成一个并打印访问链接:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npx alink-cli --hub wss://your-host:8080
|
|
48
|
-
# → prints: open https://your-host:8080/?token=<uuid>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
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.
|
|
52
|
-
|
|
53
|
-
## 凭证与端到端加密 Credential & E2EE
|
|
54
|
-
|
|
55
|
-
凭证是这台机器的**远程执行凭据**,请妥善保管:公网请务必用 `wss://`(TLS)。多租户凭证(`al1.` 前缀)里的第四段是端到端加密(E2EE)主密钥——它**只留在本机、从不上网**,daemon 把它单独归档到 `~/.agentlink/enckeys.json`(`0600`),hub 永远只看到密文。撤销某台机器:在控制台里重新添加即可让旧凭证失效。
|
|
56
|
-
|
|
57
|
-
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.
|
|
19
|
+
- `--hub`:Hub 地址,默认 `wss://link.harmopath.com`。
|
|
20
|
+
- `--dir`:默认工作目录,缺省为当前目录。
|
|
21
|
+
- `--pair`:忽略已保存凭证并重新配对。
|
|
22
|
+
- `--token`:导入完整机器凭证。
|
|
23
|
+
- `--legacy`:临时运行旧 daemon;默认始终是 daemon-t3。
|
|
58
24
|
|
|
59
|
-
|
|
25
|
+
Node.js 22.16+。连接为出站 WebSocket,无需端口转发;Hub 只转发 E2EE 密文。
|