{"id":"c97f77c5-5404-4241-b285-2c458fca6e51","slug":"contextwtf-context-cli","kind":"skill","name":"context-cli","summary":"","owner":"contextwtf","repoUrl":"https://github.com/contextwtf/context-cli","license":"MIT","licenseTier":"permissive","trust":"community","stars":1,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-02-16T23:12:36.000Z","addedAt":"2026-10-22T00:36:01.731Z","logoUrl":"https://avatars.githubusercontent.com/u/79553430?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["memory-knowledge"],"tags":[],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-27T23:37:07.779Z","sample":false,"url":"https://conduits.dev/tools/contextwtf-context-cli","language":"TypeScript","transports":["stdio"],"install":{"npm":"context-markets-cli"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<p align=\"center\">\n  <img src=\"https://mainnet.contextcdn.com/ced823d63df9dff0390d9ad0a4e1ad3905dd199a6c50758c18a5c92a203adbd7\" alt=\"Context\" width=\"100%\" />\n</p>\n\n<h1 align=\"center\">Context CLI</h1>\n<p align=\"center\">CLI for trading on <a href=\"https://context.markets\">Context Markets</a> prediction markets. Works interactively or as JSON for AI agents.</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/context-markets-cli\"><img src=\"https://img.shields.io/npm/v/context-markets-cli\" alt=\"npm\" /></a>\n  <a href=\"https://github.com/contextwtf/context-cli/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License: MIT\" /></a>\n  <a href=\"https://discord.gg/RVmzZsAyM4\"><img src=\"https://img.shields.io/badge/Discord-Join-7289da\" alt=\"Discord\" /></a>\n</p>\n\n## Install\n\n```bash\nnpm install -g context-markets-cli\n```\n\nThis installs the `context` command globally.\n\nOr run without installing:\n\n```bash\nnpx context-markets-cli <command>\n```\n\n## Getting Started\n\nThe fastest way to get set up:\n\n```bash\ncontext setup\n```\n\nThis walks you through:\n\n1. **Wallet** — generate a new wallet or import an existing private key\n2. **Save credentials** — persists to `~/.config/context/config.env` (chmod 600)\n3. **API key** — prompts for your Context API key (get one at [context.markets](https://context.markets))\n4. **Approve contracts** — checks ETH balance, approves on-chain (requires ETH on Base for gas)\n5. **Deposit USDC** — checks USDC balance, deposits into the exchange\n\nIf anything fails (no ETH, rate limit, etc.), you can re-run `context setup` — it detects your existing config and picks up where you left off.\n\n### Manual setup\n\nIf you prefer to configure manually:\n\n```bash\n# Option 1: Environment variables\nexport CONTEXT_API_KEY=\"your-api-key\"\nexport CONTEXT_PRIVATE_KEY=\"0x...\"\n\n# Option 2: Config file (created by `context setup`)\n# ~/.config/context/config.env\n```\n\nCredentials are loaded in order: CLI flags > env vars > config file.\n\nNeed an API key? Visit [context.markets](https://context.markets) or join our [Discord](https://discord.gg/RVmzZsAyM4).\n\n## Quick Start\n\n```bash\n# Browse markets\ncontext markets list --status active --limit 5\n\n# Search for a market\ncontext markets search \"march madness\"\n\n# Get a link to a market\ncontext markets link <market-id>\n\n# View the orderbook\ncontext markets orderbook <market-id>\n\n# Place a limit order\ncontext orders create --market <id> --outcome yes --side buy --price 45 --size 10\n\n# Check your portfolio\ncontext portfolio overview\n\n# Interactive shell\ncontext shell\n```\n\n## Agent Workflow\n\nThe CLI supports a fully non-interactive JSON mode for AI agents:\n\n```bash\n# 1. Generate wallet and save to config\ncontext setup --output json --save\n# → { \"status\": \"new_wallet\", \"address\": \"0x...\", \"privateKey\": \"0x...\", \"configPath\": \"...\" }\n\n# 2. Approve contracts (after funding wallet with ETH on Base)\ncontext approve --output json\n# → { \"status\": \"approved\", \"usdcApprovalTx\": \"0x...\", \"operatorApprovalTx\": \"0x...\" }\n\n# 3. Deposit USDC\ncontext deposit 100 --output json\n# → { \"status\": \"deposited\", \"amount_usdc\": 100, \"tx_hash\": \"0x...\" }\n\n# 4. Trade\ncontext orders create --market <id> --outcome yes --side buy --price 45 --size 10 --output json\n```\n\nAll commands accept `--output json` for structured output. When piped (non-TTY), JSON is the default.\n\n## Commands\n\n**Markets** — `markets list` · `markets search` · `markets get` · `markets link` · `markets quotes` · `markets orderbook` · `markets simulate` · `markets price-history` · `markets oracle` · `markets oracle-quotes` · `markets request-oracle-quote` · `markets activity` · `markets global-activity` · `markets create`\n\n**Orders** — `orders list` · `orders mine` · `orders get` · `orders recent` · `orders simulate` · `orders create` · `orders market` · `orders cancel` · `orders cancel-replace` · `orders bulk-create` · `orders bulk-cancel` · `orders bulk`\n\n**Portfolio** — `portfolio overview` · `portfolio get` · `portfolio claimable` · `portfolio stats` · `portfolio balance` · `portfolio token-balance`\n\n**Account** — `account status` · `account setup` · `account deposit` · `account withdraw` · `account mint-test-usdc` · `account mint-complete-sets` · `account burn-complete-sets` · `account gasless-approve` · `account gasless-deposit`\n\n**Questions** — `questions submit` · `questions status` · `questions submit-and-wait` · `questions agent-submit` · `questions agent-submit-and-wait`\n\n**Other** — `setup` · `approve` · `deposit` · `guides` · `ecosystem` · `shell`\n\nRun `context <command> help` or `context <command> --help` for details on any command.\n\n## Key Concepts\n\n- **Prices** are in cents (1–99). A price of 65 means $0.65 per share.\n- **Outcomes** are `yes` or `no`. Each market is a binary question.\n- **Output** auto-detects: tables in a terminal, JSON when piped. Override with `--output json` or `--output table`.\n- **Read-only commands** only need `CONTEXT_API_KEY`. **Trading commands** also need `CONTEXT_PRIVATE_KEY`.\n- **Interactive shell** (`context shell`) supports `#N` row references, `next`/`back` pagination, and all commands.\n\n## Guides\n\nBuilt-in guides are available in the CLI:\n\n```bash\ncontext guides              # List available guides\ncontext guides trading      # View the trading guide\n```\n\n## Documentation\n\n- **[Command Reference](https://docs.context.markets/agents/cli/commands)** — full list of commands with flags and response shapes\n- **[CLI Guide](https://docs.context.markets/agents/cli)** — setup, authentication, and workflows\n- **[Agent Workflows](https://docs.context.markets/agents/cli/workflows)** — common patterns for AI agent integration\n\n## Ecosystem\n\n| Package | Description |\n|---------|-------------|\n| **[context-markets](https://github.com/contextwtf/context-sdk)** | TypeScript SDK for trading |\n| **[context-markets-react](https://github.com/contextwtf/context-react)** | React hooks for market data and trading |\n| **[context-markets-mcp](https://github.com/contextwtf/context-mcp)** | MCP server for AI agents |\n| **[context-markets-cli](https://github.com/contextwtf/context-cli)** | CLI for trading from the terminal |\n| **[context-skills](https://github.com/contextwtf/context-skills)** | AI agent skill files |\n| **[context-plugin](https://github.com/contextwtf/context-plugin)** | Claude Code plugin |\n\n## License\n\nMIT — see [LICENSE](./LICENSE) for details.\n"}