npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

context-markets-cli

v0.3.0

Published

CLI for trading on Context prediction markets

Readme

Install

npm install -g context-markets-cli

This installs the context command globally.

Or run without installing:

npx context-markets-cli <command>

Getting started

The fastest way to get set up:

context setup

This walks you through:

  1. Wallet -- generate a new wallet or import an existing private key
  2. Save credentials -- persists to ~/.config/context/config.env (chmod 600)
  3. Authorize -- links your CLI wallet to your Context account
  4. Approve contracts -- checks ETH balance, approves on-chain (requires ETH on Base for gas)
  5. Deposit USDC -- checks USDC balance, deposits into the exchange

If 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.

Manual setup

If you prefer to configure manually:

# Option 1: Environment variables
export CONTEXT_API_KEY="your-api-key"
export CONTEXT_PRIVATE_KEY="0x..."

# Option 2: Config file (created by `context setup`)
# ~/.config/context/config.env

Credentials are loaded in order: CLI flags > env vars > config file.

Need an API key? Visit context.markets or join our Discord.

Quick start

# Browse markets
context markets list --status active --limit 5

# Search for a market
context markets search "march madness"

# Get a link to a market
context markets link <market-id>

# View the orderbook
context markets orderbook <market-id>

# Place a limit order
context orders create --market <id> --outcome yes --side buy --price 45 --size 10

# Check your portfolio
context portfolio overview

# Interactive shell
context shell

Agent workflow

The CLI supports a fully non-interactive JSON mode for AI agents:

# 1. Generate wallet and save to config
context setup --output json --save
# -> { "status": "new_wallet", "address": "0x...", "privateKey": "0x...", "configPath": "..." }

# 2. Authorize CLI wallet as a signer on your Context account
context account authorize --output json
# -> { "requestId": "...", "authorizeUrl": "https://...", "status": "pending" }

# 3. Approve contracts (after funding wallet with ETH on Base)
context account setup --output json
# -> { "status": "approved", "usdcApprovalTx": "0x...", "operatorApprovalTx": "0x..." }

# 4. Deposit USDC
context account deposit 100 --output json
# -> { "status": "deposited", "amount_usdc": 100, "tx_hash": "0x..." }

# 5. Trade
context orders create --market <id> --outcome yes --side buy --price 45 --size 10 --output json

All commands accept --output json for structured output. When piped (non-TTY), JSON is the default.

Commands

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

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

Portfolio -- portfolio overview . portfolio get . portfolio claimable . portfolio stats . portfolio balance . portfolio token-balance

Account -- account status . account authorize . account setup . account deposit . account withdraw . account mint-test-usdc . account mint-complete-sets . account burn-complete-sets . account gasless-approve . account gasless-deposit

Questions -- questions submit . questions status . questions submit-and-wait . questions agent-submit . questions agent-submit-and-wait

Other -- setup . guides . shell . profile

Run context <command> help or context <command> --help for details on any command.

Key concepts

  • Prices are in cents (1-99). A price of 65 means $0.65 per share.
  • Outcomes are yes or no. Each market is a binary question.
  • Output auto-detects: tables in a terminal, JSON when piped. Override with --output json or --output table.
  • Read-only commands only need CONTEXT_API_KEY. Trading commands also need CONTEXT_PRIVATE_KEY.
  • Interactive shell (context shell) supports #N row references, next/back pagination, and all commands.
  • Profiles let you manage multiple configurations (e.g., testnet vs mainnet).

Guides

Built-in guides are available in the CLI:

context guides              # List available guides
context guides trading      # View the trading guide

Documentation

Ecosystem

| Package | Description | | ------------------------------------------------------------------------ | --------------------------------------- | | context-markets | TypeScript SDK for trading | | context-markets-react | React hooks for market data and trading | | context-markets-mcp | MCP server for AI agents | | context-markets-cli | CLI for trading from the terminal | | context-skills | AI agent skill files | | context-plugin | Claude Code plugin |

License

MIT -- see LICENSE for details.