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.
Use the Sai Skill to Set Up the CLI
Section titled “Use the Sai Skill to Set Up the CLI”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 skills add https://github.com/Unique-Divine/jiyuu/tree/main/ai-skills/sai --skill saiInstall the CLI Yourself
Section titled “Install the CLI Yourself”Install uv, then install the latest Sai CLI release.
uv run https://raw.githubusercontent.com/SaiDotFun/open-sai/main/scripts/install.pysai --versionThe 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.
Read Markets and Prices
Section titled “Read Markets and Prices”sai --json market listsai --json market pricesUse 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.
Use Prices in a Script
Section titled “Use Prices in a Script”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.
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.
sai --json watch price 3Treat streamed and indexed data as observations. Check their timestamps before using them in a trading decision.
Query Sai L1 Testnet
Section titled “Query Sai L1 Testnet”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.
sai --endpoint https://sai-keeper.testnet-2.nibiru.fi/query \ --lcd-endpoint https://lcd.testnet-2.nibiru.fi \ --json market pricesFor 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