# Polymarket CLI
> CLI for Polymarket prediction markets — browse, trade, and manage positions

## 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

## When to Use
- 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

## When NOT to Use
- You need a graphical trading interface with charts
- You're trading on exchanges other than Polymarket
- You need historical backtesting capabilities

## Key Flags
- `-o, --output`: Output format: json or table
- `--limit`: Number of results to return
- `--active`: Filter for active markets only
- `--side`: Order side: buy or sell
- `--price`: Limit order price (0.00-1.00)
- `--size`: Number of shares to trade

## 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
- **stdout**: Market data, order confirmations, or portfolio positions (JSON or table)

## Installation
- **script**: `curl -sSL https://raw.githubusercontent.com/Polymarket/polymarket-cli/main/install.sh | sh`
- **cargo**: `cargo install --path . (from source)`

## Related Tools
- [ticker](/tools/ticker) (complementary): ticker tracks stock/crypto prices; polymarket-cli handles prediction markets
- [openbb](/tools/openbb) (complementary): OpenBB covers traditional finance; polymarket-cli covers prediction markets

---
Source: https://littlescripts.sh/tools/polymarket-cli
