> ## Documentation Index
> Fetch the complete documentation index at: https://motiontrade.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands Reference

> All Motion CLI commands (v0.4.0)

## Auth

Manage authentication credentials.

```bash theme={null}
# Authenticate with your API key
motion auth login <key>

# Remove stored credentials
motion auth logout

# Show current auth status and usage
motion auth status

# Open developer portal to get an API key
motion auth signup
```

## Entity

Search, inspect, and graph entities. Unified namespace for all entity operations.

```bash theme={null}
# Search entities by name
motion entity search "Trump"

# Filter by category or type
motion entity search "Bitcoin" --type asset
motion entity search "Mahomes" --category sports

# Get detailed entity profile
motion entity get donald-trump

# Include market exposures in output
motion entity get nba-lal --markets

# Entity relationship graph
motion entity graph donald-trump

# Control traversal depth
motion entity graph donald-trump --depth 2

# JSON output for piping
motion entity graph nba-lal --json | jq '.nodes | length'
```

<Note>
  The old `motion entities search` and `motion graph` commands still work as aliases for backwards compatibility.
</Note>

## Markets

Browse and search prediction markets.

```bash theme={null}
# Top trending and high-volume markets
motion markets trending

# Search across venues
motion markets search "election" --venue polymarket

# Filter by category and sort
motion markets filter --category crypto --sort volume --limit 10
```

## Alerts

Monitor real-time alerts.

```bash theme={null}
# List recent alerts
motion alerts list

# Filter by alert type
motion alerts list --type injury

# Live alert feed with polling
motion alerts watch --type arbitrage,injury --interval 15
```

## Arbitrage

Scan for cross-venue mispricings.

```bash theme={null}
# Scan for arbitrage opportunities
motion arb scan

# Set minimum spread threshold
motion arb scan --min-spread 3 --actionable

# Filter by category
motion arb scan --category politics --min-spread 5

# Live arb streaming (polls every 10s)
motion arb watch

# With filters
motion arb watch --min-spread 3 --category politics --interval 5

# Pipe to jq for scripting
motion arb watch --json | jq '.mispricings[] | select(.spread > 0.05)'
```

<Tip>
  `motion arb watch` is the most powerful CLI feature for power users. It continuously monitors cross-venue spreads and highlights new opportunities as they appear.
</Tip>

## News

Market-relevant news feed.

```bash theme={null}
# Top trending news
motion news trending

# News for a specific entity
motion news entity "Bitcoin"
```

## Trading (Polymarket)

Polymarket trading via server-side signing. No local wallet needed.

```bash theme={null}
# Check trading session status
motion trade status

# Initialize trading session (first time)
motion trade init

# Place a buy order by market slug (interactive selection)
motion trade buy "trump president" --size 10 --price 0.55

# Place a buy order by raw tokenId
motion trade buy 0x1234...abcd --size 10 --price 0.55

# Place a sell order
motion trade sell "bitcoin 100k" --size 10 --price 0.65

# Market order (no price required)
motion trade buy "fed rate cut" --size 50 --type market

# Cancel an order
motion trade cancel <orderId>

# View orderbook
motion trade orderbook <tokenId>

# List open positions with PnL
motion positions

# List open orders
motion orders
```

<Note>
  Trade commands now accept human-readable market slugs. If the input is not a raw token ID, the CLI searches for matching markets and lets you pick interactively.
</Note>

Trading uses server-side Privy delegation for signing. Your first `trade init` creates a Gnosis Safe wallet and sets up Polymarket CLOB credentials.

## Trading (Hyperliquid)

Trade perpetuals on Hyperliquid.

```bash theme={null}
# Open a long position
motion hl buy BTC --size 1000 --leverage 5

# Open a short position
motion hl sell ETH --size 500 --leverage 3

# Close a position
motion hl close <orderId>

# List current positions with unrealized PnL
motion hl positions

# List available perpetual markets
motion hl markets

# Skip confirmation prompt
motion hl buy SOL --size 200 --leverage 10 -y

# JSON output for scripting
motion hl positions --json | jq '.[] | select(.unrealizedPnl > 0)'
```

<Tip>
  All HL trading commands include confirmation prompts showing margin, leverage, and notional amount. Use `-y` to skip confirmation for scripted workflows.
</Tip>

## Webhooks

Manage webhook endpoints for real-time event delivery.

```bash theme={null}
# List configured webhooks
motion webhook list

# Create a webhook endpoint
motion webhook create https://api.example.com/hooks --events alert.injury,alert.arbitrage

# Delete a webhook
motion webhook delete <webhook-id>

# View recent deliveries
motion webhook deliveries <webhook-id>
```

## Dashboard

Launch the interactive TUI dashboard.

```bash theme={null}
motion dashboard
```

The dashboard provides a live terminal UI with:

* **Search** (1): Entity search with inline results
* **Signals** (2): Real-time alert feed
* **Markets** (3): Top prediction markets by volume
* **Arb** (4): Cross-venue mispricing scanner
* **Intel** (5): ISQ scores and sentiment
* **Watchlist** (6): Personal watchlist
* **Chat** (7): Market chat rooms
* **Profile** (8): User profile and stats
* **News** (9): Breaking news feed
* **Discover** (0): Market discovery
* **Trading** (t): Polymarket positions and orders

Press the number key to swap the bottom panel. Press `e` to expand any panel full-screen. Press `?` to show the full keyboard shortcut help overlay.

## Update

Check for and install CLI updates.

```bash theme={null}
# Update to the latest version
motion update
```

The CLI also checks for updates automatically once per day and notifies you when a new version is available.

## Global Options

All commands support these flags:

| Flag        | Description                                  |
| ----------- | -------------------------------------------- |
| `--json`    | Output raw JSON instead of formatted tables  |
| `--help`    | Show usage details for any command           |
| `-y, --yes` | Skip confirmation prompts (trading commands) |
