RightNow CLI
更新于
rightnow 命令在为你的模型提供服务的机器上,完成优化中你这一方的工作。它获取套件、检查套件、用套件提供服务、与原版引擎并排验证,并能回滚。
安装
在 Linux 或 macOS 上,安装程序会在安装任何内容之前检查已签名的二进制文件:
它会把 rightnow 放到 ~/.local/bin,从不修改你的 shell 配置文件。如果 ~/.local/bin 不在你的 PATH 中,它会打印需要添加的那一行。
在 Windows 上,在 PowerShell 中运行以下命令。它会在安装任何内容之前检查同一个签名:
| 平台 | 套件步骤 |
|---|---|
linux-x64 | 是 |
linux-arm64 | 是 |
linux-x64-musl | 是 |
linux-arm64-musl | 是 |
darwin-arm64 | 否 |
darwin-x64 | 否 |
windows-x64 | 否 |
套件的预热、提供服务、验证和回滚只在 Linux 上运行。其他所有命令在所有平台上都能运行。
每个二进制文件旁边都有 SHA256SUMS,其中是它的校验和,并由 SHA256SUMS.sig 签名。
登录
在机器上运行 rightnow login。它会打印一个代码,由工作区所有者在 RightNow 控制台中批准。CLI 不会发送你机器的任何信息。
登录信息保存在系统的钥匙串中。在没有钥匙串的机器上,比如 GPU 服务器,它保存在只有你的用户才能读取的文件中。rightnow whoami 会显示这台机器登录的工作区。
命令
版本 2.0.0 的命令:
| 命令 | 作用 |
|---|---|
rightnow version | Print the CLI's version. |
rightnow doctor | Read this machine: GPU, driver, which GPUs are in use (free_gpus), engine, systemd, disk, user. Sends nothing. |
rightnow trace import <file> --out <out> | Make a trace from your own request log (JSONL or CSV). Prompts in the log are never read further or copied. |
rightnow trace metrics --url <url> --out <out> | Make a trace from the engine's own /metrics page over a window, with no change to serving (vLLM). |
rightnow trace record --upstream <upstream> --out <out> | Record a trace by passing the client's requests through to your engine for a while. Numbers only, never any text. |
rightnow trace check <file> | Check a trace file against the contract (rightnow-trace.v1). |
rightnow trace show <file> | Show everything a trace would send: its fields and its first rows. |
rightnow login | Sign in from this machine with a code the workspace owner approves in the RightNow console. Sends no machine details. Already signed in: says so and starts nothing. |
rightnow logout | Sign out: end this machine's session on the server, then delete the saved sign-in. |
rightnow whoami | The workspace this machine is signed in to. |
rightnow runs | Your optimization runs and whether each kit is ready. |
rightnow run <id> | One run: its order, its state, its result and its kit. |
rightnow trace upload <file> --run <run> | Send a checked trace (numbers only) to a run that has not started. Check it first with trace show. |
rightnow kit pull <id> | Download a paid kit, check its signature and every file, and unpack it into a folder that becomes its kit home. Installs nothing. |
rightnow kit check <dir> | Check a pulled kit folder against its signed list (signature, every file's size and sha256) and whether it fits this machine. Runs nothing. Under --json, made_for and this_machine hold what fit and fits hold. fit and fits go away in 0.2. |
rightnow kit warm <dir> | Run the kit's warm step once before traffic (it fills the GPU driver's cache the kit was measured with). |
rightnow kit serve <dir> | Check the kit folder again, then run the engine with the kit (serve.sh) in the foreground until you stop it (Ctrl-C). Words after -- go to the engine. With --json (and over MCP) nothing runs: the exact line comes back for your own process manager. |
rightnow kit verify <dir> | Run the kit's own verify program (the engine without the kit, then with it, on this machine's GPU), show the numbers, parity first. Use a GPU that is not serving. Sends nothing unless --post. Its work folder, with the engines' caches and the result, is rightnow/verify/<kit id> in your cache folder ($XDG_CACHE_HOME, else ~/.cache) and stays after the run. Set XDG_CACHE_HOME to keep it off a small home disk. |
rightnow kit rollback <dir> | Check the kit folder again, then run the engine as it was before the kit (serve-stock.sh) in the foreground until you stop it (Ctrl-C). Words after -- go to the engine. With --json (and over MCP) nothing runs: the exact line comes back for your own process manager. |
rightnow update <dir> | Take the newest kit of the run you serve: download it beside the kit in use, check it, warm it, verify it on this machine, then switch (the kit before stays for --back). Run it on a GPU that is not serving, or pass --no-verify. --check only says whether there is one. |
rightnow mcp | Serve these commands as tools to a coding agent over MCP (stdio). |
这个版本包含跟踪命令,但运行目前还不使用跟踪:每个请求都在标准负载下测量。
每个命令都接受 --json:它会输出一个 JSON 文档,退出码表示命令以何种方式结束。
这些步骤会在你的机器上运行套件自带的程序:rightnow kit warm, rightnow kit serve, rightnow kit verify, rightnow kit rollback, rightnow update。运行每个步骤之前,请先阅读它。
你的编程智能体
编程智能体可以替你完成每个步骤。把这段提示词复制给它,并用你的运行 ID 替换 RUN_ID:
或者把这些命令作为工具交给智能体:把这个 MCP 服务器添加到它的设置中。
每个工具都会告诉智能体的宿主它只是读取还是会更改你的机器,这样宿主可以在更改之前询问你。
受限或离线的机器
在受限的网络中,请允许通过 HTTPS 访问 CLI 及其安装程序会连接的这三个主机:
| 主机 | 用途 |
|---|---|
www.rightnowai.co | 安装程序、登录和你的运行。 |
releases.rightnowai.co | CLI 的文件及其已签名的校验和。 |
storage.googleapis.com | 你的套件文件。 |
要把套件放到没有互联网的机器上:
联网拉取
在能访问这些主机的机器上,用
rightnow kit pull拉取套件。复制
把整个套件文件夹和
rightnow二进制文件复制到离线机器上。套件的步骤会从那台机器上的文件夹读取你的模型,所以也要复制模型的权重。离线检查
在那台机器上运行
rightnow kit check。它只读取本地文件:对照套件的签名清单检查每个文件,无需网络,也无需登录。
除非你加上需要网络的 --post,否则 rightnow kit verify 不会发送任何内容。
退出码
| 代码 | 含义 |
|---|---|
0 | 成功。 |
1 | 失败。消息会说明原因。 |
2 | 命令、标志或值不正确。 |
3 | CLI 拒绝了该步骤。 |
4 | 这台机器尚未登录。 |
5 | 找不到该运行、套件或文件。 |
6 | 付款尚未到账。 |
7 | 无法连接到 RightNow,或它未接受此次调用。error.code 会说明是哪一种,not_open 表示停止并告知用户。 |
8 | 这台机器还没有准备好执行该步骤。 |