@xcanwin/manyoyo 3.0.0 → 3.0.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 CHANGED
@@ -1,19 +1,23 @@
1
+ [English](docs/README_EN.md) | [ [中文](README.md) ]
2
+
3
+ ---
4
+
1
5
  # MANYOYO(慢悠悠)
2
6
 
3
7
  **MANYOYO** 是一款 AI 智能体提效安全沙箱,安全、高效、省 token,专为 Agent YOLO 模式设计,保障宿主机安全。
4
8
 
5
- 预装常见 Agent 与工具,进一步节省 token。循环自由切换 Agent 和 /bin/bash,进一步提效。
9
+ 预装常见 Agent 与工具,进一步节省 token。循环自由切换 Agent 和 `/bin/bash`,进一步提效。
6
10
 
7
- MANYOYO provides an isolated Docker/Podman container environment for running AI agent CLIs safely.
11
+ **MANYOYO** 提供隔离的 Docker/Podman 容器环境,用于安全运行 AI 智能体命令行工具。
8
12
 
9
13
  ## 功能亮点
10
14
 
11
- - **多Agent**:支持 claude code, gemini, codex, opencode
15
+ - **多智能体支持**:支持 claude code, gemini, codex, opencode
12
16
  - **安全隔离**:保护宿主机,支持安全容器嵌套(Docker-in-Docker)
13
- - **高效启动**:快捷开启常见 Agent YOLO / SOLO 模式(例如 claude --dangerously-skip-permissions)
17
+ - **快速启动**:快捷开启常见 Agent YOLO / SOLO 模式(例如 claude --dangerously-skip-permissions)
14
18
  - **便捷操作**:快速进入 `/bin/bash`
15
19
  - **会话恢复**:安装 Skills Marketplace 可快速恢复会话
16
- - **自定义灵活**:支持自定义 `BASEURL`、`AUTH_TOKEN` 等变量
20
+ - **灵活自定义**:支持自定义 `BASEURL`、`AUTH_TOKEN` 等变量
17
21
  - **配置管理**:快捷导入配置文件
18
22
  - **高级模式**:支持危险容器嵌套(mount-docker-socket)、自定义沙箱镜像
19
23
 
@@ -25,7 +29,7 @@ MANYOYO provides an isolated Docker/Podman container environment for running AI
25
29
 
26
30
  ## 2. 编译镜像
27
31
 
28
- ```
32
+ ```bash
29
33
  podman pull ubuntu:24.04
30
34
  iv=1.4.0-all && podman build -t localhost/xcanwin/manyoyo:$iv -f docker/manyoyo.Dockerfile . --build-arg EXT=all --no-cache
31
35
  podman image prune -f
@@ -33,13 +37,13 @@ podman image prune -f
33
37
 
34
38
  ## 3. 安装 manyoyo(选一种)
35
39
 
36
- ### Global Installation (Recommended)
40
+ ### 全局安装(推荐)
37
41
 
38
42
  ```bash
39
43
  npm install -g @xcanwin/manyoyo
40
44
  ```
41
45
 
42
- ### Local Development
46
+ ### 本地开发
43
47
 
44
48
  ```bash
45
49
  npm install -g .
@@ -47,57 +51,57 @@ npm install -g .
47
51
 
48
52
  ## 4. 使用方法
49
53
 
50
- ### Basic Commands
54
+ ### 基础命令
51
55
 
52
56
  ```bash
53
- # Show help
57
+ # 显示帮助
54
58
  manyoyo -h
55
59
 
56
- # Show version
60
+ # 显示版本
57
61
  manyoyo -V
58
62
 
59
- # List all containers
63
+ # 列出所有容器
60
64
  manyoyo -l
61
65
 
62
- # Create new container with environment file
66
+ # 创建新容器并使用环境文件
63
67
  manyoyo -n test --ef .env -y c
64
68
 
65
- # Resume existing session
69
+ # 恢复现有会话
66
70
  manyoyo -n test -- -c
67
71
 
68
- # Execute command in interactive shell
72
+ # 在交互式 shell 中执行命令
69
73
  manyoyo -n test -x /bin/bash
70
74
 
71
- # Execute custom command
75
+ # 执行自定义命令
72
76
  manyoyo -n test -x echo "hello world"
73
77
 
74
- # Remove container
78
+ # 删除容器
75
79
  manyoyo -n test --rm
76
80
  ```
77
81
 
78
- ### Environment Variables
82
+ ### 环境变量
79
83
 
80
- #### String Format
84
+ #### 字符串格式
81
85
 
82
86
  ```bash
83
- # Direct
87
+ # 直接传递
84
88
  manyoyo -e "VAR=value" -x env
85
89
 
86
- # Multiple
90
+ # 多个变量
87
91
  manyoyo -e "A=1" -e "B=2" -x env
88
92
  ```
89
93
 
90
- #### File Format
94
+ #### 文件格式
91
95
 
92
96
  ```bash
93
- # From file
97
+ # 从文件加载
94
98
  manyoyo --ef .env -x env
95
99
  ```
96
100
 
97
- Environment files (`.env`) support the following formats:
101
+ 环境文件(`.env`)支持以下格式:
98
102
 
99
103
  ```bash
100
- # With export statement
104
+ # 使用 export 语句
101
105
  export ANTHROPIC_BASE_URL="https://api.anthropic.com"
102
106
  # export CLAUDE_CODE_OAUTH_TOKEN="sk-xxxxxxxx"
103
107
  export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxx"
@@ -108,107 +112,107 @@ export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
108
112
  export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
109
113
  export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-5"
110
114
 
111
- # Simple key=value
115
+ # 简单的键值对
112
116
  API_KEY=your-api-key-here
113
117
 
114
- # Quoted values (quotes will be stripped)
118
+ # 带引号的值(引号会被移除)
115
119
  MESSAGE="Hello World"
116
120
  PATH='/usr/local/bin'
117
121
  ```
118
122
 
119
- ### AI CLI Shortcuts (skip permissions)
123
+ ### AI CLI 快捷方式(跳过权限确认)
120
124
 
121
125
  ```bash
122
126
  # Claude Code
123
- manyoyo -y c # or: claude, cc
127
+ manyoyo -y c # 或: claude, cc
124
128
 
125
129
  # Gemini
126
- manyoyo -y gm # or: gemini, g
130
+ manyoyo -y gm # 或: gemini, g
127
131
 
128
132
  # Codex
129
- manyoyo -y cx # or: codex
133
+ manyoyo -y cx # 或: codex
130
134
 
131
135
  # OpenCode
132
- manyoyo -y oc # or: opencode
136
+ manyoyo -y oc # 或: opencode
133
137
  ```
134
138
 
135
- ### Interactive Session Management
139
+ ### 交互式会话管理
136
140
 
137
- After exiting a container session, you'll be prompted with options:
141
+ 退出容器会话后,系统将提示您选择操作:
138
142
 
139
- - `y` - Keep container running in background (default)
140
- - `n` - Delete the container
141
- - `1` - Re-enter with the original command
142
- - `s` - Execute a new command
143
- - `i` - Enter interactive shell
143
+ - `y` - 保持容器在后台运行(默认)
144
+ - `n` - 删除容器
145
+ - `1` - 使用首次命令重新进入
146
+ - `x` - 执行新命令
147
+ - `i` - 进入交互式 shell
144
148
 
145
- ### Container Modes
149
+ ### 容器模式
146
150
 
147
- #### Docker-in-Docker Development
151
+ #### Docker-in-Docker 开发
148
152
 
149
153
  ```bash
150
- # Docker-in-Docker (safe nested containers)
151
- # Create a container with Docker-in-Docker support
154
+ # Docker-in-Docker(安全的嵌套容器)
155
+ # 创建支持 Docker-in-Docker 的容器
152
156
  manyoyo -n docker-dev -m dind -x /bin/bash
153
157
 
154
- # Inside the container, start dockerd
158
+ # 在容器内启动 dockerd
155
159
  nohup dockerd &
156
160
 
157
- # Now you can use docker commands inside the container
161
+ # 现在可以在容器内使用 docker 命令
158
162
  docker run hello-world
159
163
  ```
160
164
 
161
- #### Mount Docker socket Development
165
+ #### 挂载 Docker Socket 开发
162
166
 
163
167
  ```bash
164
- # Mount Docker socket (dangerous - container can access host)
168
+ # 挂载 Docker Socket(危险 - 容器可以访问宿主机)
165
169
  manyoyo -n socket-dev -m mdsock -x docker ps
166
170
  ```
167
171
 
168
- ### Command-Line Options
169
-
170
- | Option | Aliases | Description |
171
- |--------|---------|-------------|
172
- | `-l` | `--ls`, `--list` | List all manyoyo containers |
173
- | `--hp PATH` | `--host-path` | Set host working directory (default: current path) |
174
- | `-n NAME` | `--cn`, `--cont-name` | Set container name |
175
- | `--cp PATH` | `--cont-path` | Set container working directory |
176
- | `--in NAME` | `--image-name` | Specify image name |
177
- | `--iv VERSION` | `--image-ver` | Specify image version |
178
- | `-e STRING` | `--env` | Set environment variable |
179
- | `--ef FILE` | `--env-file` | Load environment variables from file |
180
- | `-v STRING` | `--volume` | Bind mount volume |
181
- | `--rm` | `--rmc`, `--remove-cont` | Remove container |
182
- | `--sp CMD` | `--shell-prefix` | Temporary environment variable (prefix for -s) |
183
- | `-s CMD` | `--shell` | Specify command to execute |
184
- | `--` | `--ss`, `--shell-suffix` | Command arguments (suffix for -s) |
185
- | `-x CMD` | `--sf`, `--shell-full` | Full command (replaces --sp, -s, and --) |
186
- | `-y CLI` | `--yolo` | Run AI agent without confirmation |
187
- | `-m MODE` | `--cm`, `--cont-mode` | Set container mode (common, dind, mdsock) |
188
- | `--install NAME` | | Install manyoyo command |
189
- | `-V` | `--version` | Show version |
190
- | `-h` | `--help` | Show help |
172
+ ### 命令行选项
173
+
174
+ | 选项 | 别名 | 描述 |
175
+ |------|------|------|
176
+ | `-l` | `--ls`, `--list` | 列出所有 manyoyo 容器 |
177
+ | `--hp PATH` | `--host-path` | 设置宿主机工作目录(默认:当前路径) |
178
+ | `-n NAME` | `--cn`, `--cont-name` | 设置容器名称 |
179
+ | `--cp PATH` | `--cont-path` | 设置容器工作目录 |
180
+ | `--in NAME` | `--image-name` | 指定镜像名称 |
181
+ | `--iv VERSION` | `--image-ver` | 指定镜像版本 |
182
+ | `-e STRING` | `--env` | 设置环境变量 |
183
+ | `--ef FILE` | `--env-file` | 从文件加载环境变量 |
184
+ | `-v STRING` | `--volume` | 绑定挂载卷 |
185
+ | `--rm` | `--rmc`, `--remove-cont` | 删除容器 |
186
+ | `--sp CMD` | `--shell-prefix` | 临时环境变量(作为 -s 的前缀) |
187
+ | `-s CMD` | `--shell` | 指定要执行的命令 |
188
+ | `--` | `--ss`, `--shell-suffix` | 命令参数(作为 -s 的后缀) |
189
+ | `-x CMD` | `--sf`, `--shell-full` | 完整命令(替代 --sp, -s --) |
190
+ | `-y CLI` | `--yolo` | 无需确认运行 AI 智能体 |
191
+ | `-m MODE` | `--cm`, `--cont-mode` | 设置容器模式(common, dind, mdsock |
192
+ | `--install NAME` | | 安装 manyoyo 命令 |
193
+ | `-V` | `--version` | 显示版本 |
194
+ | `-h` | `--help` | 显示帮助 |
191
195
 
192
196
  ## 其他说明
193
197
 
194
- ### Default Configuration
198
+ ### 默认配置
195
199
 
196
- - **Container Name**: `myy-{MMDD-HHMM}` (auto-generated based on current time)
197
- - **Host Path**: Current working directory
198
- - **Container Path**: Same as host path
199
- - **Image**: `localhost/xcanwin/manyoyo:xxx`
200
+ - **容器名称**:`myy-{月日-时分}`(基于当前时间自动生成)
201
+ - **宿主机路径**:当前工作目录
202
+ - **容器路径**:与宿主机路径相同
203
+ - **镜像**:`localhost/xcanwin/manyoyo:xxx`
200
204
 
201
- ### Requirements
205
+ ### 系统要求
202
206
 
203
- - Node.js >= 14.0.0
204
- - Docker or Podman
207
+ - Node.js >= 24.0.0
208
+ - Docker Podman
205
209
 
206
- ### Remove
210
+ ### 卸载
207
211
 
208
212
  ```bash
209
213
  npm uninstall -g @xcanwin/manyoyo
210
214
  ```
211
215
 
212
- ## License
216
+ ## 许可证
213
217
 
214
218
  MIT
package/bin/manyoyo.js CHANGED
@@ -589,7 +589,7 @@ async function handlePostExit(defaultCommand) {
589
589
  console.log("");
590
590
  getHelloTip(CONTAINER_NAME, defaultCommand);
591
591
 
592
- const reply = await askQuestion(`❔ 会话已结束。是否保留此后台容器 ${CONTAINER_NAME}? [ y=默认保留, n=删除, 1=首次命令进入, s=执行命令, i=交互式SHELL ]: `);
592
+ const reply = await askQuestion(`❔ 会话已结束。是否保留此后台容器 ${CONTAINER_NAME}? [ y=默认保留, n=删除, 1=首次命令进入, x=执行命令, i=交互式SHELL ]: `);
593
593
  console.log("");
594
594
 
595
595
  const firstChar = reply.trim().toLowerCase()[0];
@@ -605,7 +605,7 @@ async function handlePostExit(defaultCommand) {
605
605
  const newArgs = ['-n', CONTAINER_NAME];
606
606
  process.argv = [process.argv[0], process.argv[1], ...newArgs];
607
607
  await main();
608
- } else if (firstChar === 's') {
608
+ } else if (firstChar === 'x') {
609
609
  const command = await askQuestion('❔ 输入要执行的命令: ');
610
610
  console.log(`${GREEN}✅ 离开当前连接,执行命令。${NC}`);
611
611
  const newArgs = ['-n', CONTAINER_NAME, '-x', command];
@@ -0,0 +1,218 @@
1
+ [ [English](README_EN.md) ] | [中文](../README.md)
2
+
3
+ ---
4
+
5
+ # MANYOYO (Man-Yo-Yo)
6
+
7
+ **MANYOYO** is an AI agent security sandbox that is safe, efficient, and token-saving. Designed specifically for Agent YOLO mode to protect the host machine.
8
+
9
+ Pre-installed with common agents and tools to further save tokens. Freely switch between agents and `/bin/bash` in a loop for enhanced efficiency.
10
+
11
+ **MANYOYO** provides an isolated Docker/Podman container environment for running AI agent CLIs safely.
12
+
13
+ ## Key Features
14
+
15
+ - **Multi-Agent Support**: Supports claude code, gemini, codex, opencode
16
+ - **Security Isolation**: Protects host machine, supports safe nested containers (Docker-in-Docker)
17
+ - **Quick Launch**: Quickly enable common Agent YOLO / SOLO mode (e.g., claude --dangerously-skip-permissions)
18
+ - **Convenient Operations**: Quick access to `/bin/bash`
19
+ - **Session Recovery**: Install Skills Marketplace to quickly resume sessions
20
+ - **Flexible Customization**: Support custom `BASEURL`, `AUTH_TOKEN`, and other variables
21
+ - **Configuration Management**: Quick import of configuration files
22
+ - **Advanced Mode**: Supports dangerous nested containers (mount-docker-socket), custom sandbox images
23
+
24
+ # Usage
25
+
26
+ ## 1. Install podman
27
+
28
+ - Install [podman](https://podman.io/docs/installation)
29
+
30
+ ## 2. Build Image
31
+
32
+ ```
33
+ podman pull ubuntu:24.04
34
+ iv=1.4.0-all && podman build -t localhost/xcanwin/manyoyo:$iv -f docker/manyoyo.Dockerfile . --build-arg EXT=all --no-cache
35
+ podman image prune -f
36
+ ```
37
+
38
+ ## 3. Install manyoyo (Choose One)
39
+
40
+ ### Global Installation (Recommended)
41
+
42
+ ```bash
43
+ npm install -g @xcanwin/manyoyo
44
+ ```
45
+
46
+ ### Local Development
47
+
48
+ ```bash
49
+ npm install -g .
50
+ ```
51
+
52
+ ## 4. Usage
53
+
54
+ ### Basic Commands
55
+
56
+ ```bash
57
+ # Show help
58
+ manyoyo -h
59
+
60
+ # Show version
61
+ manyoyo -V
62
+
63
+ # List all containers
64
+ manyoyo -l
65
+
66
+ # Create new container with environment file
67
+ manyoyo -n test --ef .env -y c
68
+
69
+ # Resume existing session
70
+ manyoyo -n test -- -c
71
+
72
+ # Execute command in interactive shell
73
+ manyoyo -n test -x /bin/bash
74
+
75
+ # Execute custom command
76
+ manyoyo -n test -x echo "hello world"
77
+
78
+ # Remove container
79
+ manyoyo -n test --rm
80
+ ```
81
+
82
+ ### Environment Variables
83
+
84
+ #### String Format
85
+
86
+ ```bash
87
+ # Direct
88
+ manyoyo -e "VAR=value" -x env
89
+
90
+ # Multiple
91
+ manyoyo -e "A=1" -e "B=2" -x env
92
+ ```
93
+
94
+ #### File Format
95
+
96
+ ```bash
97
+ # From file
98
+ manyoyo --ef .env -x env
99
+ ```
100
+
101
+ Environment files (`.env`) support the following formats:
102
+
103
+ ```bash
104
+ # With export statement
105
+ export ANTHROPIC_BASE_URL="https://api.anthropic.com"
106
+ # export CLAUDE_CODE_OAUTH_TOKEN="sk-xxxxxxxx"
107
+ export ANTHROPIC_AUTH_TOKEN="sk-xxxxxxxx"
108
+ export API_TIMEOUT_MS=3000000
109
+ export ANTHROPIC_MODEL="claude-sonnet-4-5"
110
+ export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5"
111
+ export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-5"
112
+ export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"
113
+ export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-5"
114
+
115
+ # Simple key=value
116
+ API_KEY=your-api-key-here
117
+
118
+ # Quoted values (quotes will be stripped)
119
+ MESSAGE="Hello World"
120
+ PATH='/usr/local/bin'
121
+ ```
122
+
123
+ ### AI CLI Shortcuts (skip permissions)
124
+
125
+ ```bash
126
+ # Claude Code
127
+ manyoyo -y c # or: claude, cc
128
+
129
+ # Gemini
130
+ manyoyo -y gm # or: gemini, g
131
+
132
+ # Codex
133
+ manyoyo -y cx # or: codex
134
+
135
+ # OpenCode
136
+ manyoyo -y oc # or: opencode
137
+ ```
138
+
139
+ ### Interactive Session Management
140
+
141
+ After exiting a container session, you'll be prompted with options:
142
+
143
+ - `y` - Keep container running in background (default)
144
+ - `n` - Delete the container
145
+ - `1` - Re-enter with the original command
146
+ - `x` - Execute a new command
147
+ - `i` - Enter interactive shell
148
+
149
+ ### Container Modes
150
+
151
+ #### Docker-in-Docker Development
152
+
153
+ ```bash
154
+ # Docker-in-Docker (safe nested containers)
155
+ # Create a container with Docker-in-Docker support
156
+ manyoyo -n docker-dev -m dind -x /bin/bash
157
+
158
+ # Inside the container, start dockerd
159
+ nohup dockerd &
160
+
161
+ # Now you can use docker commands inside the container
162
+ docker run hello-world
163
+ ```
164
+
165
+ #### Mount Docker socket Development
166
+
167
+ ```bash
168
+ # Mount Docker socket (dangerous - container can access host)
169
+ manyoyo -n socket-dev -m mdsock -x docker ps
170
+ ```
171
+
172
+ ### Command-Line Options
173
+
174
+ | Option | Aliases | Description |
175
+ |--------|---------|-------------|
176
+ | `-l` | `--ls`, `--list` | List all manyoyo containers |
177
+ | `--hp PATH` | `--host-path` | Set host working directory (default: current path) |
178
+ | `-n NAME` | `--cn`, `--cont-name` | Set container name |
179
+ | `--cp PATH` | `--cont-path` | Set container working directory |
180
+ | `--in NAME` | `--image-name` | Specify image name |
181
+ | `--iv VERSION` | `--image-ver` | Specify image version |
182
+ | `-e STRING` | `--env` | Set environment variable |
183
+ | `--ef FILE` | `--env-file` | Load environment variables from file |
184
+ | `-v STRING` | `--volume` | Bind mount volume |
185
+ | `--rm` | `--rmc`, `--remove-cont` | Remove container |
186
+ | `--sp CMD` | `--shell-prefix` | Temporary environment variable (prefix for -s) |
187
+ | `-s CMD` | `--shell` | Specify command to execute |
188
+ | `--` | `--ss`, `--shell-suffix` | Command arguments (suffix for -s) |
189
+ | `-x CMD` | `--sf`, `--shell-full` | Full command (replaces --sp, -s, and --) |
190
+ | `-y CLI` | `--yolo` | Run AI agent without confirmation |
191
+ | `-m MODE` | `--cm`, `--cont-mode` | Set container mode (common, dind, mdsock) |
192
+ | `--install NAME` | | Install manyoyo command |
193
+ | `-V` | `--version` | Show version |
194
+ | `-h` | `--help` | Show help |
195
+
196
+ ## Additional Information
197
+
198
+ ### Default Configuration
199
+
200
+ - **Container Name**: `myy-{MMDD-HHMM}` (auto-generated based on current time)
201
+ - **Host Path**: Current working directory
202
+ - **Container Path**: Same as host path
203
+ - **Image**: `localhost/xcanwin/manyoyo:xxx`
204
+
205
+ ### Requirements
206
+
207
+ - Node.js >= 24.0.0
208
+ - Docker or Podman
209
+
210
+ ### Uninstall
211
+
212
+ ```bash
213
+ npm uninstall -g @xcanwin/manyoyo
214
+ ```
215
+
216
+ ## License
217
+
218
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "AI Agent CLI Security Sandbox",
5
5
  "keywords": [
6
6
  "ai", "agent", "sandbox", "docker", "cli", "container", "development"
@@ -26,8 +26,9 @@
26
26
  "node": ">=14.0.0"
27
27
  },
28
28
  "files": [
29
- "manyoyo.js",
29
+ "bin/manyoyo.js",
30
30
  "README.md",
31
+ "docs/README_EN.md",
31
32
  "LICENSE",
32
33
  "docker/manyoyo.Dockerfile"
33
34
  ]