@xcanwin/manyoyo 3.5.0 → 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 +21 -19
- package/bin/manyoyo.js +19 -17
- package/docs/README_EN.md +21 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
57
|
-
manyoyo --ib
|
|
58
|
-
manyoyo --ip # 清理悬空镜像和 <none> 镜像
|
|
59
|
-
|
|
58
|
+
manyoyo --ib --iba GIT_SSL_NO_VERIFY=true # 构建 full 版本且跳过git的ssl验证
|
|
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.
|
|
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 --
|
|
96
|
+
manyoyo -n test --crm
|
|
97
|
+
|
|
98
|
+
# 清理悬空镜像和 <none> 镜像
|
|
99
|
+
manyoyo --irm
|
|
98
100
|
```
|
|
99
101
|
|
|
100
102
|
### 环境变量
|
|
@@ -199,21 +201,21 @@ docker ps -a # 现在可以在容器内使用 docker 命令
|
|
|
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, sock) |
|
|
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` | 显示帮助 |
|
package/bin/manyoyo.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// ==============================================================================
|
|
4
|
-
//
|
|
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, sock");
|
|
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} --
|
|
119
|
+
console.log(`⚫ 删除容器 : ${MANYOYO_NAME} -n ${containerName} --crm`);
|
|
117
120
|
console.log("");
|
|
118
121
|
}
|
|
119
122
|
|
|
@@ -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 '--
|
|
686
|
-
case '--image-
|
|
687
|
+
case '--irm':
|
|
688
|
+
case '--image-remove':
|
|
687
689
|
pruneDanglingImages();
|
|
688
690
|
process.exit(0);
|
|
689
691
|
|
package/docs/README_EN.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
57
|
-
manyoyo --ib
|
|
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.
|
|
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 --
|
|
96
|
+
manyoyo -n test --crm
|
|
97
|
+
|
|
98
|
+
# Clean dangling images and <none> images
|
|
99
|
+
manyoyo --irm
|
|
98
100
|
```
|
|
99
101
|
|
|
100
102
|
### Environment Variables
|
|
@@ -199,21 +201,21 @@ docker ps -a # Now you can use docker commands inside the container
|
|
|
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, sock) |
|
|
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 |
|