publish
通过 SSH 将本地文件或目录发布到远程服务器。
CLI 用法
bash
npx t-comm publish [options]选项
| 选项 | 说明 | 默认值 |
|---|---|---|
-s, --source <string> | 源文件或目录路径 | - |
-t, --target <string> | 远程目标目录 | - |
-n, --name <ip> | 服务器主机名/IP | - |
-p, --password <string> | 服务器密码 | - |
-o, --port <number> | 服务器端口 | 36000 |
示例
bash
# 发布目录到远程服务器
npx t-comm publish \
-s ./dist \
-t /data/www/my-site \
-n 10.0.0.1 \
-p "my-password" \
-o 22
# 使用默认端口
npx t-comm publish \
-s ./build \
-t /home/deploy/app \
-n server.example.com \
-p "password"注意事项
- 所有参数均为必填(端口除外,默认 36000)
- 底层通过 shell 脚本执行 SSH 传输
- 适用于内网服务器部署场景