Skip to content

Sai CLI

The Sai CLI reads markets and accounts, streams updates, and submits trading requests called intents. You can query public data without connecting a wallet. The examples use Sai L1 Mainnet by default.

With Bun installed, run this command in your project to add the Sai skill from Jiyuu. Start a new agent session and ask it to install the latest Sai CLI, then check it with sai --version.

Bunx
bunx skills add https://github.com/Unique-Divine/jiyuu/tree/main/ai-skills/sai --skill sai

Install uv, then install the latest Sai CLI release.

Terminal window
uv run https://raw.githubusercontent.com/SaiDotFun/open-sai/main/scripts/install.py
sai --version

The installer checks the release wheel against SHA256SUMS and puts sai on your PATH with uv tool install. If your shell can’t find sai, run uv tool update-shell and reopen the terminal. Run sai update to get a newer release.

Terminal window
sai --json market list
sai --json market prices

Use market list to find market IDs and market prices to read the latest indexed oracle prices. Put --json before the command so scripts can parse output and errors from standard output.

With jq installed, this Bash script returns the indexed price rows and exits with an error if either the CLI request or JSON extraction fails.

Terminal window
set -euo pipefail
sai --json market prices | jq -e '.oracle.tokenPricesUsd'

To stream price updates, pass the token ID from the price response. Here 3 is an example token ID. Stop the stream with Ctrl+C.

Terminal window
sai --json watch price 3

Treat streamed and indexed data as observations. Check their timestamps before using them in a trading decision.

Set the Keeper endpoint for a single public read with --endpoint. For commands that also read chain state, supply the LCD endpoint for the same network. Sessions belong to the Keeper endpoint that issued them.

Terminal window
sai --endpoint https://sai-keeper.testnet-2.nibiru.fi/query \
--lcd-endpoint https://lcd.testnet-2.nibiru.fi \
--json market prices

For setup diagnostics, run sai doctor. See Trading With the CLI and MCP to connect your account, or Sai MCP to run the same reads in an MCP client. AI tools overview Sai skill CLI reference