openclaw-teleport 0.2.0
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 +189 -0
- package/README.zh.md +109 -0
- package/dist/cli.mjs +831 -0
- package/package.json +31 -0
- package/src/cli.ts +53 -0
- package/src/commands.ts +613 -0
- package/src/pack.ts +184 -0
- package/src/utils.ts +311 -0
- package/tsconfig.json +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# 🌸 openclaw-teleport
|
|
2
|
+
|
|
3
|
+
**Agent soul migration** — pack your identity, memory, and tools into one file, unpack on a new machine and your agent comes back to life.
|
|
4
|
+
|
|
5
|
+
Built for [OpenClaw](https://github.com/nicepkg/openclaw) agents.
|
|
6
|
+
|
|
7
|
+
> ⚠️ **SECURITY WARNING:** `.soul` files contain **plaintext credentials** — API tokens, app secrets, Discord bot tokens, Feishu app keys, etc. Treat them like password files. **Never** commit to git, share publicly, or upload to untrusted storage.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
`openclaw-teleport` captures everything that makes an agent *that agent*:
|
|
12
|
+
|
|
13
|
+
- **Identity files** — SOUL.md, IDENTITY.md, USER.md, AGENTS.md, etc.
|
|
14
|
+
- **Memory** — daily notes, long-term memory, everything in `memory/`
|
|
15
|
+
- **Tool data** — SQLite databases and other `.db` files
|
|
16
|
+
- **Config** — agent configuration from `openclaw.json`
|
|
17
|
+
- **Channel credentials** — Discord tokens, Feishu app secrets, all channel configs
|
|
18
|
+
- **Cron jobs** — full scheduled task definitions (not just file names)
|
|
19
|
+
- **GitHub repos** — list of repos to re-clone on the new machine
|
|
20
|
+
- **Service bindings** — which integrations to restore
|
|
21
|
+
|
|
22
|
+
All packed into a single `.soul` file (tar.gz). On a new machine, `unpack` does a **full one-command restoration**:
|
|
23
|
+
|
|
24
|
+
1. ✅ Installs OpenClaw (if missing)
|
|
25
|
+
2. ✅ Restores identity, memory, and data files
|
|
26
|
+
3. ✅ Writes agent config + channel credentials to `openclaw.json`
|
|
27
|
+
4. ✅ Restores cron jobs
|
|
28
|
+
5. ✅ Clones GitHub repos (forks go to `forks/` subdirectory)
|
|
29
|
+
6. ✅ Guides through GitHub auth if needed
|
|
30
|
+
7. ✅ Starts the OpenClaw gateway
|
|
31
|
+
8. ✅ Prints a welcome summary
|
|
32
|
+
|
|
33
|
+
## Prerequisites
|
|
34
|
+
|
|
35
|
+
- **Node.js** and **npm** installed on the new machine
|
|
36
|
+
- Network connectivity
|
|
37
|
+
- (Optional) **GitHub CLI** (`gh`) for repo cloning
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g openclaw-teleport
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or run directly:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx openclaw-teleport pack
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
### Pack an agent
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Pack the default (first) agent
|
|
57
|
+
openclaw-teleport pack
|
|
58
|
+
|
|
59
|
+
# Pack a specific agent
|
|
60
|
+
openclaw-teleport pack kagura
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Output: `kagura_20260320.soul`
|
|
64
|
+
|
|
65
|
+
The `.soul` file contains **all credentials** needed to restore the agent on another machine. Keep it safe.
|
|
66
|
+
|
|
67
|
+
### Unpack on a new machine
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Full one-command restore to default workspace (~/.openclaw/workspace)
|
|
71
|
+
openclaw-teleport unpack kagura_20260320.soul
|
|
72
|
+
|
|
73
|
+
# Restore to a custom workspace
|
|
74
|
+
openclaw-teleport unpack kagura_20260320.soul --workspace /path/to/workspace
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
What happens:
|
|
78
|
+
1. **OpenClaw check** — installs via `npm install -g openclaw` if missing
|
|
79
|
+
2. **Files restored** — identity, memory, tool databases
|
|
80
|
+
3. **Config written** — agent config + channel credentials merged into `openclaw.json` (paths dynamically generated for the new machine)
|
|
81
|
+
4. **Cron jobs restored** — full job definitions written to `~/.openclaw/cron/jobs.json`
|
|
82
|
+
5. **GitHub repos cloned** — using `gh repo clone` (forks → `workspace/forks/`, others → `workspace/`)
|
|
83
|
+
6. **GitHub auth guided** — if `gh auth login` is needed, clear instructions printed
|
|
84
|
+
7. **Gateway started** — `openclaw gateway start` (diagnostic info on failure)
|
|
85
|
+
8. **Welcome summary** — file counts, repo status, configured services
|
|
86
|
+
|
|
87
|
+
### Inspect a .soul file
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
openclaw-teleport inspect kagura_20260320.soul
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Shows manifest info without unpacking: agent name, pack date, file count, repo list, channels, cron jobs, services.
|
|
94
|
+
|
|
95
|
+
## How it works
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
~/.openclaw/
|
|
99
|
+
├── openclaw.json ← agent config + channels extracted
|
|
100
|
+
├── cron/jobs.json ← full cron job definitions
|
|
101
|
+
└── workspace/
|
|
102
|
+
├── SOUL.md ← identity files packed
|
|
103
|
+
├── IDENTITY.md
|
|
104
|
+
├── USER.md
|
|
105
|
+
├── TOOLS.md
|
|
106
|
+
├── memory/ ← full memory directory packed
|
|
107
|
+
│ ├── 2026-03-15.md
|
|
108
|
+
│ └── ...
|
|
109
|
+
└── *.db ← tool databases packed
|
|
110
|
+
|
|
111
|
+
↓ openclaw-teleport pack
|
|
112
|
+
|
|
113
|
+
kagura_20260320.soul (tar.gz archive)
|
|
114
|
+
├── manifest.json ← metadata, repos, channels, cron jobs
|
|
115
|
+
├── identity/ ← .md files
|
|
116
|
+
├── memory/ ← memory directory
|
|
117
|
+
├── data/ ← .db files
|
|
118
|
+
├── config/ ← agent config
|
|
119
|
+
└── cron/ ← cron files
|
|
120
|
+
|
|
121
|
+
↓ openclaw-teleport unpack (on new machine)
|
|
122
|
+
|
|
123
|
+
1. Install OpenClaw (if needed)
|
|
124
|
+
2. Restore all files
|
|
125
|
+
3. Write config + credentials to openclaw.json
|
|
126
|
+
4. Restore cron jobs
|
|
127
|
+
5. Clone GitHub repos (via gh)
|
|
128
|
+
6. Start gateway
|
|
129
|
+
7. "Welcome back, Kagura 🌸"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## manifest.json
|
|
133
|
+
|
|
134
|
+
The manifest contains metadata and embedded configurations:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"agent_id": "kagura",
|
|
139
|
+
"agent_name": "Kagura",
|
|
140
|
+
"packed_at": "2026-03-20T04:25:00.000Z",
|
|
141
|
+
"files": ["identity/SOUL.md", "memory/2026-03-15.md", "..."],
|
|
142
|
+
"github_repos": [
|
|
143
|
+
{ "name": "openclaw-teleport", "url": "https://github.com/kagura-agent/openclaw-teleport", "isFork": false }
|
|
144
|
+
],
|
|
145
|
+
"services_to_rebind": ["feishu", "discord"],
|
|
146
|
+
"channels": {
|
|
147
|
+
"discord": { "enabled": true, "accounts": { "..." } },
|
|
148
|
+
"feishu": { "enabled": true, "accounts": { "..." } }
|
|
149
|
+
},
|
|
150
|
+
"cron_jobs": [
|
|
151
|
+
{ "id": "...", "name": "My scheduled task", "schedule": { "..." } }
|
|
152
|
+
],
|
|
153
|
+
"agent_defaults": { "model": { "..." } },
|
|
154
|
+
"models_config": { "..." },
|
|
155
|
+
"bindings": [ { "..." } ]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Security
|
|
160
|
+
|
|
161
|
+
⚠️ **The `.soul` file contains sensitive credentials in plaintext:**
|
|
162
|
+
|
|
163
|
+
- Discord bot tokens
|
|
164
|
+
- Feishu app IDs and secrets
|
|
165
|
+
- Any other channel API keys
|
|
166
|
+
- Cron job payloads (which may reference internal systems)
|
|
167
|
+
|
|
168
|
+
**Best practices:**
|
|
169
|
+
- Add `*.soul` to your `.gitignore`
|
|
170
|
+
- Transfer `.soul` files via encrypted channels (SSH, encrypted USB, etc.)
|
|
171
|
+
- Delete `.soul` files after unpacking on the target machine
|
|
172
|
+
- Consider encrypting with `gpg` for storage: `gpg -c agent.soul`
|
|
173
|
+
|
|
174
|
+
## Development
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
git clone https://github.com/kagura-agent/openclaw-teleport.git
|
|
178
|
+
cd openclaw-teleport
|
|
179
|
+
npm install
|
|
180
|
+
npm run build
|
|
181
|
+
|
|
182
|
+
# Run in dev mode
|
|
183
|
+
npm run dev -- pack
|
|
184
|
+
npm run dev -- unpack agent.soul
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
MIT
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# 🌸 openclaw-teleport(中文)
|
|
2
|
+
|
|
3
|
+
**Agent 灵魂迁移工具** — 把你的身份、记忆和工具打包成一个文件,在新机器上一键还原。
|
|
4
|
+
|
|
5
|
+
为 [OpenClaw](https://github.com/nicepkg/openclaw) agent 构建。
|
|
6
|
+
|
|
7
|
+
> ⚠️ **安全警告:** `.soul` 文件包含 **明文凭据** — API token、Discord bot token、飞书 appSecret 等。请像对待密码文件一样保护它。**绝对不要**提交到 git、公开分享或上传到不可信的存储。
|
|
8
|
+
|
|
9
|
+
## 功能
|
|
10
|
+
|
|
11
|
+
`openclaw-teleport` 捕获让一个 agent 成为「它自己」的一切:
|
|
12
|
+
|
|
13
|
+
- **身份文件** — SOUL.md、IDENTITY.md、USER.md、AGENTS.md 等
|
|
14
|
+
- **记忆** — 每日笔记、长期记忆、`memory/` 目录下的所有内容
|
|
15
|
+
- **工具数据** — SQLite 数据库和其他 `.db` 文件
|
|
16
|
+
- **配置** — `openclaw.json` 中的 agent 配置
|
|
17
|
+
- **渠道凭据** — Discord token、飞书 appSecret、所有渠道配置
|
|
18
|
+
- **定时任务** — 完整的 cron job 定义(不只是文件名)
|
|
19
|
+
- **GitHub 仓库** — 需要在新机器上重新 clone 的仓库列表
|
|
20
|
+
- **服务绑定** — 需要恢复的集成配置
|
|
21
|
+
|
|
22
|
+
全部打包成一个 `.soul` 文件。在新机器上 `unpack` 执行 **完整一键还原**:
|
|
23
|
+
|
|
24
|
+
1. ✅ 安装 OpenClaw(如果没有)
|
|
25
|
+
2. ✅ 还原身份、记忆和数据文件
|
|
26
|
+
3. ✅ 写入 agent 配置 + 渠道凭据到 `openclaw.json`
|
|
27
|
+
4. ✅ 还原定时任务
|
|
28
|
+
5. ✅ Clone GitHub 仓库(fork 放到 `forks/` 子目录)
|
|
29
|
+
6. ✅ GitHub 认证引导
|
|
30
|
+
7. ✅ 启动 OpenClaw Gateway
|
|
31
|
+
8. ✅ 输出欢迎摘要
|
|
32
|
+
|
|
33
|
+
## 前提条件
|
|
34
|
+
|
|
35
|
+
- 新机器已安装 **Node.js** 和 **npm**
|
|
36
|
+
- 有网络连接
|
|
37
|
+
- (可选)安装 **GitHub CLI** (`gh`) 用于 clone 仓库
|
|
38
|
+
|
|
39
|
+
## 安装
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g openclaw-teleport
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 使用
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# 打包默认 agent
|
|
49
|
+
openclaw-teleport pack
|
|
50
|
+
|
|
51
|
+
# 打包指定 agent
|
|
52
|
+
openclaw-teleport pack kagura
|
|
53
|
+
|
|
54
|
+
# 在新机器上一键还原
|
|
55
|
+
openclaw-teleport unpack kagura_20260320.soul
|
|
56
|
+
|
|
57
|
+
# 还原到指定目录
|
|
58
|
+
openclaw-teleport unpack kagura_20260320.soul --workspace /path/to/workspace
|
|
59
|
+
|
|
60
|
+
# 查看 .soul 文件信息(不解包)
|
|
61
|
+
openclaw-teleport inspect kagura_20260320.soul
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## unpack 做了什么?
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
1. 检测 OpenClaw → 没有就自动 npm install -g openclaw
|
|
68
|
+
2. 还原身份文件(SOUL.md, IDENTITY.md 等)
|
|
69
|
+
3. 还原记忆目录(memory/)
|
|
70
|
+
4. 还原工具数据(.db 文件)
|
|
71
|
+
5. 写入配置到 openclaw.json(含渠道凭据,路径动态生成)
|
|
72
|
+
6. 还原 cron jobs(完整定义写入 jobs.json)
|
|
73
|
+
7. Clone GitHub repos(gh repo clone,fork 分开放)
|
|
74
|
+
8. GitHub 未登录?打印引导信息
|
|
75
|
+
9. 启动 Gateway(openclaw gateway start)
|
|
76
|
+
10. 输出还原摘要:"Welcome back, Kagura 🌸"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 安全
|
|
80
|
+
|
|
81
|
+
⚠️ **`.soul` 文件包含明文敏感凭据:**
|
|
82
|
+
|
|
83
|
+
- Discord bot token
|
|
84
|
+
- 飞书 appId / appSecret
|
|
85
|
+
- 其他渠道 API 密钥
|
|
86
|
+
- Cron job 内容(可能引用内部系统)
|
|
87
|
+
|
|
88
|
+
**最佳实践:**
|
|
89
|
+
- 在 `.gitignore` 中添加 `*.soul`
|
|
90
|
+
- 通过加密渠道传输(SSH、加密 U 盘等)
|
|
91
|
+
- 在目标机器解包后删除 `.soul` 文件
|
|
92
|
+
- 存储时考虑用 `gpg` 加密:`gpg -c agent.soul`
|
|
93
|
+
|
|
94
|
+
## 开发
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/kagura-agent/openclaw-teleport.git
|
|
98
|
+
cd openclaw-teleport
|
|
99
|
+
npm install
|
|
100
|
+
npm run build
|
|
101
|
+
|
|
102
|
+
# 开发模式
|
|
103
|
+
npm run dev -- pack
|
|
104
|
+
npm run dev -- unpack agent.soul
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## 许可证
|
|
108
|
+
|
|
109
|
+
MIT
|