CLI Guide#
The Seesaw CLI (@seesaw/cli) is a command-line interface for interacting with the Seesaw binary prediction market protocol on Solana. It supports the full market lifecycle -- creating markets, placing orders, managing positions, and querying protocol data -- directly from your terminal. All commands output structured JSON by default, making the CLI suitable for scripting, automation, and integration with AI agents.
Architecture#
The CLI reads configuration and wallet credentials locally, then communicates with two remote services: a Solana RPC node for on-chain transactions and the Seesaw indexer API for aggregated protocol data.
Installation#
# From the monorepo root (recommended):
pnpm --filter @seesaw/cli exec seesaw --help
# Or link locally for global access:
cd packages/cli && npm link
seesaw --help
Quick Start#
1. Initialize config#
seesaw config init-file
Creates ~/.seesaw/config.yaml with default settings (mainnet RPC, default keypair path, JSON output).
2. Check config#
seesaw config show
Displays the resolved configuration after merging config file, environment variables, and CLI flags.
3. Create a market#
seesaw market create \
--pyth-feed <pyth-price-account-address> \
--pyth-feed-id <32-byte-hex-feed-id> \
--settlement-mint <usdc-mint-address>
Creates a new prediction market for the specified Pyth price feed.
4. Place an order#
seesaw order place \
--market <market-address> \
--side buy-yes \
--price 5000 \
--quantity 100 \
--token-account <usdc-token-account>
Places a limit order to buy 100 YES shares at 0.50 USDC (5000 basis points).
5. Check your position#
seesaw position get --market <market-address>
Displays your current share balances, collateral, and settlement status for the specified market.
Command Groups#
| Group | Commands | Description |
|---|---|---|
config | 3 | CLI settings and on-chain config |
market | 7 | Market lifecycle operations |
order | 3 | Order placement, cancellation, listing |
position | 4 | Position management (mint, redeem, withdraw) |
admin | 5 | Protocol admin operations (authority only) |
api | 8 | Indexer API queries |
In This Section#
- Configuration -- Config file, environment variables, and precedence rules
- Commands -- Full reference for all 30 commands
- Examples -- Real-world workflows and step-by-step tutorials
Next Steps#
- SDK Guide -- Build applications on Seesaw programmatically
- API Reference -- REST and WebSocket API documentation
- Architecture -- Technical deep-dives into protocol design