Configuration#
The Seesaw CLI uses a layered configuration system. Settings can be defined in a config file, environment variables, or CLI flags. When the same setting is defined in multiple places, the CLI applies a strict precedence order.
Config File#
The default config file location is:
~/.seesaw/config.yaml
Create it with:
seesaw config init-file
Full Schema#
# Solana RPC endpoint
rpc_url: https://api.mainnet-beta.solana.com
# Path to Solana keypair JSON file
keypair: ~/.config/solana/id.json
# Seesaw indexer API base URL
api_url: https://api.seesaw.markets
# Output format: "json" or "human"
output: json
All four fields are optional. Any omitted field falls back to the default value shown above.
Environment Variables#
| Variable | Description | Example |
|---|---|---|
SEESAW_RPC_URL | Solana RPC endpoint | https://api.devnet.solana.com |
SEESAW_KEYPAIR | Path to keypair file | ~/.config/solana/devnet.json |
SEESAW_API_URL | Indexer API base URL | http://localhost:3002 |
SEESAW_OUTPUT | Output format | human |
Example:
export SEESAW_RPC_URL=https://api.devnet.solana.com
export SEESAW_KEYPAIR=~/.config/solana/devnet.json
seesaw market get <address>
CLI Flags#
| Flag | Description |
|---|---|
--rpc-url | Override RPC endpoint |
--keypair | Override keypair path |
--api-url | Override API URL |
--config | Custom config file path |
--human | Force human-readable output |
--json | Force JSON output |
Flags are specified before the subcommand:
seesaw --rpc-url https://api.devnet.solana.com --human market get <address>
Precedence#
When the same setting is defined in multiple places, the CLI resolves it in this order (highest priority first):
CLI flags > Environment variables > Config file > Defaults
For example, if rpc_url is set to https://api.mainnet-beta.solana.com in the config file and SEESAW_RPC_URL is set to https://api.devnet.solana.com, the environment variable wins. If --rpc-url https://localhost:8899 is also passed, the CLI flag wins over both.
Wallet / Keypair Setup#
The CLI uses a standard Solana keypair file for signing transactions. This is a JSON file containing a 64-byte array (32-byte secret key + 32-byte public key).
Generate a new keypair#
solana-keygen new --outfile ~/.config/solana/id.json
Use an existing keypair#
Point the CLI to your existing keypair:
# Via config file
echo 'keypair: /path/to/your/keypair.json' >> ~/.seesaw/config.yaml
# Via environment variable
export SEESAW_KEYPAIR=/path/to/your/keypair.json
# Via CLI flag
seesaw --keypair /path/to/your/keypair.json market get <address>
Devnet vs. Mainnet#
For development and testing, use a devnet keypair and RPC:
solana-keygen new --outfile ~/.config/solana/devnet.json
solana airdrop 2 --keypair ~/.config/solana/devnet.json --url https://api.devnet.solana.com
Then configure the CLI:
export SEESAW_RPC_URL=https://api.devnet.solana.com
export SEESAW_KEYPAIR=~/.config/solana/devnet.json
Security Notes#
- Never share your keypair file or commit it to version control.
- The CLI reads the keypair from disk only when a transaction needs to be signed.
- Read-only commands (
config show,market get,order list,position get, allapicommands) do not require a keypair unless--userdefaults to the wallet address.