@tcb-sandbox/cli
v0.3.9
Published
Thin CLI client for tcb-remote-workspace HTTP API.
Maintainers
Readme
@tcb-sandbox/cli
TRW 的官方命令行工具:一种安装,两种用法。
安装
npm install -g @tcb-sandbox/cli
# 或
pnpm add -g @tcb-sandbox/cli两种用法
| 用法 | 命令 | 说明 |
|------|------|------|
| 本地起服务 | tcb-sandbox serve | 启动内置 TRW,默认 http://127.0.0.1:9000 |
| 只当客户端 | tcb-sandbox <tool> | 调用已有 TRW(远端或本地) |
快速开始
# 本地模式
tcb-sandbox serve
# 另开终端
tcb-sandbox --endpoint http://127.0.0.1:9000 --session-id my-session health
tcb-sandbox --session-id my-session write --path hello.txt --content "world"
tcb-sandbox --session-id my-session read --path hello.txt环境变量
export TRW_ENDPOINT=https://your-gateway.com
export TRW_SESSION_ID=your-session-id
# 然后可直接使用
tcb-sandbox health
tcb-sandbox bash --command "ls -la"命令列表
| 命令 | 说明 |
|------|------|
| serve / local | 启动本地 TRW |
| health | 健康检查 |
| read / write / edit | 文件操作 |
| bash | 执行命令 |
| grep / glob / ls | 搜索 |
| batch | 批量执行 |
| git-push | Git 提交 |
| add-mcp-servers / remove-mcp-servers / list-mcp-servers | MCP 管理 |
| mcporter | mcporter CLI |
| capability-* | 能力管理(6个) |
| secrets | 密钥管理 |
| files | 文件传输 |
| preview | 预览服务 |
| pty | PTY 终端 |
| snapshot | 快照管理 |
本地模式详情
# 默认端口 9000
tcb-sandbox serve
# 指定端口
tcb-sandbox serve --port 8080
# 使用自定义 TRW 入口(开发用)
export TCB_SANDBOX_TRW_ENTRY=/path/to/your/dist/index.js
tcb-sandbox serve限制
- 除
serve外所有命令都是纯 HTTP 客户端 - 需要有效的
endpoint和session-id - 文件传输受 6MB 限制
更多文档
docs/quick-start.md— 快速上手docs/local-mode.md— 本地模式详解docs/thin-client.md— 薄客户端说明
