Polymarket CLI
CLI for Polymarket prediction markets — browse, trade, and manage positions
Description
Polymarket CLI is a Rust-based command-line interface for interacting with Polymarket prediction markets. Browse markets, place limit and market orders, manage positions, and interact with on-chain contracts from the terminal. All commands support JSON output for scripting and agent integration. Supports wallet creation/import, conditional token operations (split, merge, redeem), and portfolio analytics.
Install
curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | shcargo install --path . (from source)AI Summary
A CLI for Polymarket prediction markets — search markets, place orders, manage positions, track portfolio, and interact with on-chain contracts. Supports JSON output for scripts and AI agents.
Capabilities
- + Search and list prediction markets with filters (active, volume, liquidity)
- + View market details, order books, and price history
- + Place limit and market orders (GTC, FOK, GTD, FAK)
- + Cancel orders individually or in batch
- + Track portfolio positions and trade history
- + Split, merge, and redeem conditional tokens on-chain
- + Create or import wallets with multiple signature types
- + JSON and table output formats for all commands
- + Leaderboard and volume analytics
Use When
- → Trading on Polymarket prediction markets from the terminal
- → Building automated trading scripts or bots for Polymarket
- → Monitoring prediction market positions and P&L
- → Researching market prices and order books programmatically
- → Integrating Polymarket data into AI agent workflows
Avoid When
- x You need a graphical trading interface with charts
- x You're trading on exchanges other than Polymarket
- x You need historical backtesting capabilities
Usage Patterns
Search for markets
polymarket markets search "bitcoin" Searches active prediction markets matching the query
List top markets
polymarket markets list --limit 10 Lists the top 10 markets by default sorting
Place a buy order
polymarket clob create-order --token TOKEN_ID --side buy --price 0.50 --size 10 Places a limit buy order at 50 cents for 10 shares
Check portfolio positions
polymarket data positions 0xADDRESS Shows all open positions for the given wallet address
JSON output for scripting
polymarket -o json markets list | jq '.[] | .question' Outputs market data as JSON and pipes through jq
Input / Output
0 Success 1 Error Typical Pipelines
polymarket -o json markets search "election" | jq ".[] | {question, yes: .tokens[0].price}"