安装参数映射
bash 安装器使用长选项,Windows 安装器使用 PowerShell 参数;两边写入的配置字段一致。
macOS / Linux Windows PowerShell
--server URL -Server URL
--workspace PATH -Workspace PATH
--label NAME -Label NAME
--workspace-id ID -WorkspaceId ID
--device-id ID -DeviceId ID
--device-name NAME -DeviceName NAME
--interval MS -Interval MS
--shell-bin PATH -ShellBin PATH
--python-bin PATH -PythonBin PATH
--uninstall -Uninstall
只更新 agent 脚本
已有安装可以保留 config.json,只替换脚本并重启对应后台服务。
# macOS / Linux
curl -fsSL https://imago.example.com/device-agent.js \
-o ~/.imago/device-agent/imago-device-agent.js
chmod 700 ~/.imago/device-agent/imago-device-agent.js
# Windows PowerShell
Invoke-WebRequest -Uri 'https://imago.example.com/device-agent.js' `
-OutFile "$env:USERPROFILE\.imago\device-agent\imago-device-agent.js" `
-UseBasicParsing
代理和私有 Node
Windows 安装器会读取系统代理,也支持显式 -Proxy。如果 PATH 没有 Node,会放到本地私有目录。
# Windows PowerShell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
$ErrorActionPreference = 'Stop'
try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 } catch {}
$p = Join-Path $env:TEMP 'install-imago-device-agent.ps1'
Remove-Item $p -Force -ErrorAction SilentlyContinue
$imagoServer = 'https://imago.example.com'
Invoke-WebRequest -Uri "$imagoServer/install-device-agent.ps1" -OutFile $p -UseBasicParsing
& $p -Server $imagoServer -Proxy 'http://127.0.0.1:7890'
private node:
%USERPROFILE%\.imago\device-agent\node-runtime\
agent 运行时选项
这些是 imago-device-agent.js 支持的运行时选项;日常安装通常不需要手动传。
--once 只注册/心跳一次
--unregister 从服务器解绑该 device workspace
--no-tunnel 关闭本地命令 bridge
--mirror-files 上传文件快照到服务器 mirror,默认关闭
--tunnel-poll-interval agent 命令轮询间隔,默认 500 ms
--max-files mirror 模式下单次同步文件数上限