nile) outputs structured JSON by default, making it a natural subprocess tool for AI agents. With 30+ commands covering reads, writes, and simulations, agents can drive the full protocol lifecycle through shell invocations.
Install
-y skips the prompt; @latest forces dist-tag re-resolution instead of reusing a stale npx cache):
JSON Output
All commands output JSON by default. You can also set the format explicitly:jq for field extraction:
Command Groups
Agent Workflow Example
A typical agent-driven trade flow chains CLI commands as subprocess calls:1
Check protocol mode
Verify the protocol is in NORMAL mode before suggesting trades.
2
Check balances
Read the trader’s USDC wallet balance and margin account state.
3
Simulate the trade
Preview margin requirements, fees, and entry strike before committing.
4
Execute the trade
Open the position. The CLI builds the transaction, delegates signing to OWS, and broadcasts.
5
Verify
Confirm the position was created and check real-time PnL.
OWS Wallet Signing
Read commands work immediately after install. Write commands (open/close positions, deposit/withdraw) require an OWS-compatible wallet for transaction signing.ows sign tx. Wallet setup (key import, passphrase configuration) happens entirely outside the Nile workflow.
Configuration
The CLI works zero-config for Sepolia. For advanced use cases, override settings persistently or per-command.Persistent Config
Stored in~/.nile/config.json:
Environment Variables
Resolution Order
For all configurable values: CLI flag > environment variable >~/.nile/config.json > embedded default.