@xcanwin/manyoyo 3.4.5 → 3.5.2

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 CHANGED
@@ -1,4 +1,4 @@
1
- [English](docs/README_EN.md) | << [中文](README.md) >>
1
+ **<[中文](README.md)>** | [English](docs/README_EN.md)
2
2
 
3
3
  ---
4
4
 
@@ -39,32 +39,31 @@ npm install -g .
39
39
 
40
40
  ## 2. 安装 podman
41
41
 
42
- - 安装 [podman](https://podman.io/docs/installation)
42
+ 2.1 安装 [podman](https://podman.io/docs/installation)
43
+ 2.2 拉取基础镜像
44
+
45
+ ```bash
46
+ podman pull ubuntu:24.04
47
+ ```
43
48
 
44
49
  ## 3. 编译镜像
45
50
 
46
- 安装 manyoyo 后,可以使用内置命令构建镜像:
51
+ 以下命令只需执行一条:
47
52
 
48
53
  ```bash
49
- # 拉取基础镜像
50
- podman pull ubuntu:24.04
51
-
52
54
  # 使用 manyoyo 构建镜像(推荐,自动使用缓存加速)
53
55
  manyoyo --ib # 默认构建 full 版本(推荐)
54
- manyoyo --ib --iba TOOL=common # 构建常见组件版本
56
+ manyoyo --ib --iba TOOL=common # 构建常见组件版本(python,nodejs,claude)
55
57
  manyoyo --ib --iba TOOL=go,codex,java,gemini # 构建自定义组件版本
56
- manyoyo --ib --iba --iba GIT_SSL_NO_VERIFY=true # 构建 full 版本且git跳过ssl认证
57
- manyoyo --ib full --in myimage --iv 2.0.0 # 自定义镜像名称和版本,得到 myimage:2.0.0-full
58
- manyoyo --ip # 清理悬空镜像和 <none> 镜像
59
-
58
+ manyoyo --ib --iba GIT_SSL_NO_VERIFY=true # 构建 full 版本且跳过gitssl验证
59
+ manyoyo --ib --in myimage --iv 2.0.0 # 自定义镜像名称和版本,得到 myimage:2.0.0-full
60
60
  # 工作原理:
61
61
  # - 首次构建:自动下载 Node.js、JDT LSP、gopls 等到 docker/cache/
62
62
  # - 2天内再次构建:直接使用本地缓存,速度提升约 5 倍
63
63
  # - 缓存过期后:自动重新下载最新版本
64
64
 
65
65
  # 或手动构建(不推荐)
66
- iv=1.4.0 && podman build -t localhost/xcanwin/manyoyo:$iv-full -f docker/manyoyo.Dockerfile . --build-arg TOOL=full --no-cache
67
- podman image prune -f
66
+ iv=1.0.0 && podman build -t localhost/xcanwin/manyoyo:$iv-full -f docker/manyoyo.Dockerfile . --build-arg TOOL=full --no-cache
68
67
  ```
69
68
 
70
69
  ## 4. 使用方法
@@ -94,7 +93,10 @@ manyoyo -n test -x /bin/bash
94
93
  manyoyo -n test -x echo "hello world"
95
94
 
96
95
  # 删除容器
97
- manyoyo -n test --rm
96
+ manyoyo -n test --crm
97
+
98
+ # 清理悬空镜像和 <none> 镜像
99
+ manyoyo --irm
98
100
  ```
99
101
 
100
102
  ### 环境变量
@@ -173,11 +175,10 @@ manyoyo -y oc # 或: opencode
173
175
  # 创建支持 Docker-in-Docker 的容器
174
176
  manyoyo -n docker-dev -m dind -x /bin/bash
175
177
 
176
- # 在容器内启动 dockerd
177
- nohup dockerd &
178
+ podman ps -a # 现在可以在容器内使用 podman 命令
178
179
 
179
- # 现在可以在容器内使用 docker 命令
180
- docker ps -a
180
+ nohup dockerd & # 在容器内启动 dockerd
181
+ docker ps -a # 现在可以在容器内使用 docker 命令
181
182
  ```
182
183
 
183
184
  #### 挂载 Docker Socket 开发
@@ -185,10 +186,11 @@ docker ps -a
185
186
  ```bash
186
187
  # 挂载 Docker Socket(危险的!!!容器可以访问和执行宿主机的一切)
187
188
  # 创建挂载 /var/run/docker.sock 的容器
188
- manyoyo -n socket-dev -m mdsock -x /bin/bash
189
+ manyoyo -n socket-dev -m sock -x /bin/bash
190
+
191
+ podman ps -a # 现在可以在容器内使用 podman 命令
189
192
 
190
- # 现在可以在容器内使用 docker 命令
191
- docker ps -a
193
+ docker ps -a # 现在可以在容器内使用 docker 命令
192
194
  ```
193
195
 
194
196
  ### 命令行选项
@@ -199,21 +201,21 @@ docker ps -a
199
201
  | `--hp PATH` | `--host-path` | 设置宿主机工作目录(默认:当前路径) |
200
202
  | `-n NAME` | `--cn`, `--cont-name` | 设置容器名称 |
201
203
  | `--cp PATH` | `--cont-path` | 设置容器工作目录 |
204
+ | `--crm` | `--cont-remove` | 删除容器 |
205
+ | `-m MODE` | `--cm`, `--cont-mode` | 设置容器模式(common, dind, sock) |
202
206
  | `--in NAME` | `--image-name` | 指定镜像名称 |
203
207
  | `--iv VERSION` | `--image-ver` | 指定镜像版本 |
208
+ | `--ib` | `--image-build` | 构建镜像 |
209
+ | `--iba XXX=YYY` | `--image-build-arg` | 构建镜像时传参给dockerfile |
210
+ | `--irm` | `--image-remove` | 清理悬空镜像和 `<none>` 镜像 |
204
211
  | `-e STRING` | `--env` | 设置环境变量 |
205
212
  | `--ef FILE` | `--env-file` | 从文件加载环境变量 |
206
213
  | `-v STRING` | `--volume` | 绑定挂载卷 |
207
- | `--rm` | `--rmc`, `--remove-cont` | 删除容器 |
208
214
  | `--sp CMD` | `--shell-prefix` | 临时环境变量(作为 -s 的前缀) |
209
215
  | `-s CMD` | `--shell` | 指定要执行的命令 |
210
216
  | `--` | `--ss`, `--shell-suffix` | 命令参数(作为 -s 的后缀) |
211
217
  | `-x CMD` | `--sf`, `--shell-full` | 完整命令(替代 --sp, -s 和 --) |
212
218
  | `-y CLI` | `--yolo` | 无需确认运行 AI 智能体 |
213
- | `-m MODE` | `--cm`, `--cont-mode` | 设置容器模式(common, dind, mdsock) |
214
- | `--ib` | `--image-build` | 构建镜像 |
215
- | `--iba XXX=YYY` | `--image-build-arg` | 构建镜像时传参给dockerfile |
216
- | `--ip` | `--image-prune` | 清理悬空镜像和 `<none>` 镜像 |
217
219
  | `--install NAME` | | 安装 manyoyo 命令 |
218
220
  | `-V` | `--version` | 显示版本 |
219
221
  | `-h` | `--help` | 显示帮助 |
@@ -229,8 +231,8 @@ docker ps -a
229
231
 
230
232
  ### 系统要求
231
233
 
232
- - Node.js >= 24.0.0
233
- - DockerPodman
234
+ - Node.js >= 22.0.0
235
+ - PodmanDocker
234
236
 
235
237
  ### 卸载
236
238
 
package/bin/manyoyo.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // ==============================================================================
4
- // MANYOYO - AI Agent CLI Sandbox
4
+ // manyoyo - AI Agent CLI Sandbox - xcanwin
5
5
  // ==============================================================================
6
6
 
7
7
  const { execSync, spawnSync } = require('child_process');
@@ -62,6 +62,9 @@ function sleep(ms) {
62
62
  // ==============================================================================
63
63
 
64
64
  function showHelp() {
65
+ console.log(`MANYOYO - AI Agent CLI Sandbox`);
66
+ console.log(`https://github.com/xcanwin/manyoyo`);
67
+ console.log("");
65
68
  console.log(`${BLUE}Usage:${NC}`);
66
69
  console.log(` ${MANYOYO_NAME} [OPTIONS]`);
67
70
  console.log(` ${MANYOYO_NAME} [--hp HOST_PATH] [-n CONTAINER_NAME] [--cp CONTAINER_PATH] [--ef ENV_FILE] [--sp COMMAND] [-s COMMAND] [-- COMMAND]`);
@@ -71,23 +74,23 @@ function showHelp() {
71
74
  console.log(" --hp|--host-path PATH 设置宿主机工作目录 (默认当前路径)");
72
75
  console.log(" -n|--cn|--cont-name NAME 设置容器名称");
73
76
  console.log(" --cp|--cont-path PATH 设置容器工作目录");
77
+ console.log(" --crm|--cont-remove 删除-n指定容器");
78
+ console.log(" -m|--cm|--cont-mode STRING 设置容器嵌套容器模式");
79
+ console.log(" 例如 common, dind, sock");
74
80
  console.log(" --in|--image-name NAME 指定镜像名称");
75
81
  console.log(" --iv|--image-ver VERSION 指定镜像版本");
82
+ console.log(" --ib|--image-build 构建镜像");
83
+ console.log(" --iba|--image-build-arg XXX=YYY 构建镜像时传参给dockerfile");
84
+ console.log(" --irm|--image-remove 清理悬空镜像和 <none> 镜像");
76
85
  console.log(" -e|--env XXX=YYY 设置环境变量");
77
86
  console.log(" --ef|--env-file ENV_FILE 设置环境变量通过文件");
78
87
  console.log(" -v|--volume XXX:YYY 绑定挂载卷");
79
- console.log(" --rm|--remove-cont 删除-n容器");
80
88
  console.log(" --sp|--shell-prefix COMMAND 临时环境变量 (作为-s前缀)");
81
89
  console.log(" -s|--shell COMMAND 指定命令执行");
82
90
  console.log(" --|--shell-suffix COMMAND 指定命令参数, --后面全部直传 (作为-s后缀)");
83
91
  console.log(" -x|--shell-full COMMAND 指定完整命令执行, -x后面全部直传 (代替--sp和-s和--命令)");
84
92
  console.log(" -y|--yolo CLI 使AGENT无需确认 (代替-s命令)");
85
93
  console.log(" 例如 claude / c, gemini / gm, codex / cx, opencode / oc");
86
- console.log(" -m|--cm|--cont-mode STRING 设置容器嵌套容器模式");
87
- console.log(" 例如 common, dind, mdsock");
88
- console.log(" --ib|--image-build 构建镜像");
89
- console.log(" --iba|--image-build-arg XXX=YYY 构建镜像时传参给dockerfile");
90
- console.log(" --ip|--image-prune 清理悬空镜像和 <none> 镜像");
91
94
  console.log(" --install NAME 安装manyoyo命令");
92
95
  console.log(" 例如 docker-cli-plugin");
93
96
  console.log(" -V|--version 显示版本");
@@ -113,7 +116,7 @@ function getHelloTip(containerName, defaultCommand) {
113
116
  console.log(`⚫ 执行首次命令 : ${GREEN}${MANYOYO_NAME} -n ${containerName}${NC}`);
114
117
  console.log(`⚫ 执行指定命令 : ${GREEN}${MANYOYO_NAME} -n ${containerName} -x /bin/bash${NC}`);
115
118
  console.log(`⚫ 执行指定命令 : ${GREEN}docker exec -it ${containerName} /bin/bash${NC}`);
116
- console.log(`⚫ 删除容器 : ${MANYOYO_NAME} -n ${containerName} --rm`);
119
+ console.log(`⚫ 删除容器 : ${MANYOYO_NAME} -n ${containerName} --crm`);
117
120
  console.log("");
118
121
  }
119
122
 
@@ -213,9 +216,9 @@ function setContMode(mode) {
213
216
  console.log(`${GREEN}✅ 开启安全的容器嵌套容器模式, 手动在容器内启动服务: nohup dockerd &${NC}`);
214
217
  break;
215
218
  case 'mount-docker-socket':
216
- case 'mdsock':
219
+ case 'sock':
217
220
  case 's':
218
- CONT_MODE = "--privileged --volume /var/run/docker.sock:/var/run/docker.sock";
221
+ CONT_MODE = "--privileged --volume /var/run/docker.sock:/var/run/docker.sock --env DOCKER_HOST=unix:///var/run/docker.sock --env CONTAINER_HOST=unix:///var/run/docker.sock";
219
222
  console.log(`${RED}⚠️ 开启危险的容器嵌套容器模式, 危害: 容器可访问宿主机文件${NC}`);
220
223
  break;
221
224
  default:
@@ -594,6 +597,12 @@ function parseArguments(argv) {
594
597
  i += 2;
595
598
  break;
596
599
 
600
+ case '--crm':
601
+ case '--cont-remove':
602
+ SHOULD_REMOVE = true;
603
+ i += 1;
604
+ break;
605
+
597
606
  case '--in':
598
607
  case '--image-name':
599
608
  IMAGE_NAME = args[i + 1];
@@ -624,13 +633,6 @@ function parseArguments(argv) {
624
633
  i += 2;
625
634
  break;
626
635
 
627
- case '--rm':
628
- case '--rmc':
629
- case '--remove-cont':
630
- SHOULD_REMOVE = true;
631
- i += 1;
632
- break;
633
-
634
636
  case '--sp':
635
637
  case '--shell-prefix':
636
638
  EXEC_COMMAND_PREFIX = args[i + 1] + " ";
@@ -682,8 +684,8 @@ function parseArguments(argv) {
682
684
  i += 2;
683
685
  break;
684
686
 
685
- case '--ip':
686
- case '--image-prune':
687
+ case '--irm':
688
+ case '--image-remove':
687
689
  pruneDanglingImages();
688
690
  process.exit(0);
689
691
 
@@ -79,6 +79,11 @@ RUN <<EOX
79
79
  tar zip unzip gzip make sqlite3 \
80
80
  supervisor
81
81
 
82
+ # 安装 podman
83
+ case ",$TOOL," in *,full,*|*,podman,*)
84
+ apt-get install -y --no-install-recommends podman
85
+ ;; esac
86
+
82
87
  # 安装 docker
83
88
  case ",$TOOL," in *,full,*|*,docker,*)
84
89
  apt-get install -y --no-install-recommends docker.io
package/docs/README_EN.md CHANGED
@@ -1,4 +1,4 @@
1
- << [English](README_EN.md) >> | [中文](../README.md)
1
+ [中文](../README.md) | **<[English](README_EN.md)>**
2
2
 
3
3
  ---
4
4
 
@@ -39,32 +39,31 @@ npm install -g .
39
39
 
40
40
  ## 2. Install podman
41
41
 
42
- - Install [podman](https://podman.io/docs/installation)
42
+ 2.1 Install [podman](https://podman.io/docs/installation)
43
+ 2.2 Pull base image
44
+
45
+ ```bash
46
+ podman pull ubuntu:24.04
47
+ ```
43
48
 
44
49
  ## 3. Build Image
45
50
 
46
- After installing manyoyo, use the built-in command to build images:
51
+ Only one of the following commands needs to be executed:
47
52
 
48
53
  ```bash
49
- # Pull base image
50
- podman pull ubuntu:24.04
51
-
52
54
  # Build using manyoyo (Recommended, auto-cache enabled)
53
55
  manyoyo --ib # Build full version by default (Recommended)
54
- manyoyo --ib --iba TOOL=common # Build common version
56
+ manyoyo --ib --iba TOOL=common # Build common version (python,nodejs,claude)
55
57
  manyoyo --ib --iba TOOL=go,codex,java,gemini # Build custom combination
56
- manyoyo --ib --iba --iba GIT_SSL_NO_VERIFY=true # Build the full version and skip Git SSL verification
57
- manyoyo --ib all --in myimage --iv 2.0.0 # Customize the image name and version to produce myimage:2.0.0-all
58
- manyoyo --ip # Clean dangling images and <none> images
59
-
58
+ manyoyo --ib --iba GIT_SSL_NO_VERIFY=true # Build the full version and skip Git SSL verification
59
+ manyoyo --ib --in myimage --iv 2.0.0 # Customize the image name and version to produce myimage:2.0.0-full
60
60
  # How it works:
61
61
  # - First build: Auto-downloads Node.js, JDT LSP, gopls etc. to docker/cache/
62
62
  # - Rebuild within 2 days: Uses local cache, ~5x faster
63
63
  # - After cache expires: Auto-downloads latest versions
64
64
 
65
65
  # Or build manually (Not recommended)
66
- iv=1.4.0 && podman build -t localhost/xcanwin/manyoyo:$iv-all -f docker/manyoyo.Dockerfile . --build-arg TOOL=all --no-cache
67
- podman image prune -f
66
+ iv=1.0.0 && podman build -t localhost/xcanwin/manyoyo:$iv-full -f docker/manyoyo.Dockerfile . --build-arg TOOL=full --no-cache
68
67
  ```
69
68
 
70
69
  ## 4. Usage
@@ -94,7 +93,10 @@ manyoyo -n test -x /bin/bash
94
93
  manyoyo -n test -x echo "hello world"
95
94
 
96
95
  # Remove container
97
- manyoyo -n test --rm
96
+ manyoyo -n test --crm
97
+
98
+ # Clean dangling images and <none> images
99
+ manyoyo --irm
98
100
  ```
99
101
 
100
102
  ### Environment Variables
@@ -173,11 +175,10 @@ After exiting a container session, you'll be prompted with options:
173
175
  # Create a container with Docker-in-Docker support
174
176
  manyoyo -n docker-dev -m dind -x /bin/bash
175
177
 
176
- # Inside the container, start dockerd
177
- nohup dockerd &
178
+ podman ps -a # Now you can use podman commands inside the container
178
179
 
179
- # Now you can use docker commands inside the container
180
- docker ps -a
180
+ nohup dockerd & # Inside the container, start dockerd
181
+ docker ps -a # Now you can use docker commands inside the container
181
182
  ```
182
183
 
183
184
  #### Mount Docker socket Development
@@ -185,10 +186,11 @@ docker ps -a
185
186
  ```bash
186
187
  # Mount Docker socket (dangerous!!! containers can access and execute everything on the host)
187
188
  # Create a container mounting /var/run/docker.sock
188
- manyoyo -n socket-dev -m mdsock -x /bin/bash
189
+ manyoyo -n socket-dev -m sock -x /bin/bash
190
+
191
+ podman ps -a # Now you can use podman commands inside the container
189
192
 
190
- # Now you can use docker commands inside the container
191
- docker ps -a
193
+ docker ps -a # Now you can use docker commands inside the container
192
194
  ```
193
195
 
194
196
  ### Command-Line Options
@@ -199,21 +201,21 @@ docker ps -a
199
201
  | `--hp PATH` | `--host-path` | Set host working directory (default: current path) |
200
202
  | `-n NAME` | `--cn`, `--cont-name` | Set container name |
201
203
  | `--cp PATH` | `--cont-path` | Set container working directory |
204
+ | `--crm` | `--cont-remove` | Remove container |
205
+ | `-m MODE` | `--cm`, `--cont-mode` | Set container mode (common, dind, sock) |
202
206
  | `--in NAME` | `--image-name` | Specify image name |
203
207
  | `--iv VERSION` | `--image-ver` | Specify image version |
208
+ | `--ib` | `--image-build` | Build image |
209
+ | `--iba` | `--image-build-arg` | Pass arguments to a Dockerfile during image build |
210
+ | `--irm` | `--image-remove` | Clean dangling images and `<none>` images |
204
211
  | `-e STRING` | `--env` | Set environment variable |
205
212
  | `--ef FILE` | `--env-file` | Load environment variables from file |
206
213
  | `-v STRING` | `--volume` | Bind mount volume |
207
- | `--rm` | `--rmc`, `--remove-cont` | Remove container |
208
214
  | `--sp CMD` | `--shell-prefix` | Temporary environment variable (prefix for -s) |
209
215
  | `-s CMD` | `--shell` | Specify command to execute |
210
216
  | `--` | `--ss`, `--shell-suffix` | Command arguments (suffix for -s) |
211
217
  | `-x CMD` | `--sf`, `--shell-full` | Full command (replaces --sp, -s, and --) |
212
218
  | `-y CLI` | `--yolo` | Run AI agent without confirmation |
213
- | `-m MODE` | `--cm`, `--cont-mode` | Set container mode (common, dind, mdsock) |
214
- | `--ib` | `--image-build` | Build image |
215
- | `--iba` | `--image-build-arg` | Pass arguments to a Dockerfile during image build |
216
- | `--ip` | `--image-prune` | Clean dangling images and `<none>` images |
217
219
  | `--install NAME` | | Install manyoyo command |
218
220
  | `-V` | `--version` | Show version |
219
221
  | `-h` | `--help` | Show help |
@@ -229,8 +231,8 @@ docker ps -a
229
231
 
230
232
  ### Requirements
231
233
 
232
- - Node.js >= 24.0.0
233
- - Docker or Podman
234
+ - Node.js >= 22.0.0
235
+ - Podman or Docker
234
236
 
235
237
  ### Uninstall
236
238
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "3.4.5",
4
- "imageVersion": "1.6.2",
3
+ "version": "3.5.2",
4
+ "imageVersion": "1.6.3",
5
5
  "description": "AI Agent CLI Security Sandbox",
6
6
  "keywords": [
7
7
  "ai", "agent", "sandbox", "docker", "cli", "container", "development"
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "homepage": "https://github.com/xcanwin/manyoyo",
26
26
  "engines": {
27
- "node": ">=14.0.0"
27
+ "node": ">=22.0.0"
28
28
  },
29
29
  "files": [
30
30
  "bin/manyoyo.js",