快速开始
优先从 GitHub Releases 下载对应平台的预编译版本:
从 Crates.io 安装
Section titled “从 Crates.io 安装”cargo install rautogit clone https://github.com/demohiiiii/rauto.gitcd rautocargo build --release编译完成后,二进制位于 target/release/rauto。
rauto 当前默认使用 linux profile,因此你可以先从 Linux 主机开始:
rauto exec "uname -a" \ --host 192.168.1.10 \ --username root \ --password '******'如果目标是 Cisco、Huawei 等网络设备,建议显式指定 --device-profile:
rauto exec "show version" \ --host 192.168.1.1 \ --username admin \ --password '******' \ --device-profile cisco启动本地 Web 控制台
Section titled “启动本地 Web 控制台”rauto web --bind 127.0.0.1 --port 3000然后访问 http://127.0.0.1:3000。
Web 控制台适合做这些事情:
- 管理连接配置、模板、命令流模板
- 执行命令、事务、工作流和编排
- 查看异步任务、历史录制、黑名单和备份
推荐的最小上手路径
Section titled “推荐的最小上手路径”1. 先测试连接
Section titled “1. 先测试连接”rauto connection test \ --host 192.168.1.1 \ --username admin \ --password '******' \ --device-profile cisco2. 保存一个连接配置
Section titled “2. 保存一个连接配置”rauto connection add core-sw-01 \ --host 192.168.1.1 \ --username admin \ --ssh-port 22 \ --device-profile cisco \ --ssh-security balanced之后可以直接按名称复用:
rauto exec "show version" --connection core-sw-013. 查看可用设备 profile
Section titled “3. 查看可用设备 profile”rauto device list内置 profile 继承自 rneter,常见包括:
- 网络厂商:
cisco、huawei、h3c、juniper、fortinet、arista等 - 服务器:
linux
默认 profile 是 linux
Section titled “默认 profile 是 linux”如果你连的是网络设备,而不是 Linux 主机,请显式指定:
--device-profile ciscoupload 依赖目标支持 SFTP
Section titled “upload 依赖目标支持 SFTP”rauto upload 适合 Linux 等暴露 sftp 子系统的主机;很多网络设备并不支持这一点。
建议从保存连接开始
Section titled “建议从保存连接开始”一旦你进入模板、命令流、事务和编排阶段,优先使用 --connection <name> 会让命令更短,也更利于复用。