CLI for interacting with Jupiter's products on Solana: Spot, Perps, Lend, Prediction Markets and more.
Warning
This project is pre-v1 (early alpha) and should be considered unstable. Breaking changes may be introduced without warning. Please reach out to the team if you'd like to use or contribute to the CLI.
Install via npm:
npm i -g @jup-ag/cliOr use the install script to auto-detect the best method:
curl -fsSL https://raw.githubusercontent.com/jup-ag/cli/main/scripts/install.sh | bash# Generate a new private key called 'key1'
jup keys add key1
# Or import from a JSON file generated via `solana-keygen`
jup keys add key1 --file /path/to/solana-keygen.json
# Or import from a seed phrase
jup keys add key1 --seed-phrase "word1 word2 ..." --derivation-path "m/44'/501'/0'/0'" # optional, defaults to "m/44'/501'/0'/0'"
# Or import from a private key (accepts hex, base58, base64, or JSON byte array)
jup keys add key1 --private-key <key>
# View your spot portfolio
jup spot portfolio
# Swap 1 SOL to USDC
jup spot swap --from SOL --to USDC --amount 1
# Open a 3x long SOL position with $10 USDC
jup perps open --asset SOL --side long --amount 10 --input USDC --leverage 3
# View your perps positions
jup perps positionsNote
This CLI is designed to be LLM friendly and all commands are non-interactive. Set JSON output mode globally for structured responses: jup config set --output json, or use -f json flag on individual commands.
Read the docs for specific guides, examples, and workflows:
- Setup: Installation of the CLI
- Config: CLI settings and configurations
- Keys: Private key management
- Spot: Spot trading, transfers, token search and portfolio data
- Perps: Perps trading (leveraged longs/shorts)
See CHANGELOG.md for a detailed release history.