Skip to main content
The context-dev CLI wraps every Context.dev endpoint in a single binary. Anything that can run a shell command — you, a CI job, or a coding agent like Claude Code or Codex — can resolve brands, scrape pages to Markdown, take screenshots, and classify industries without writing any SDK code.

Install

Prebuilt binaries for macOS, Linux, and Windows ship with every GitHub release. If you have Go 1.22+ installed, go install works too.
terminal
# Apple Silicon — swap arm64 for amd64 on Intel Macs
curl -fsSL https://api.github.com/repos/context-dot-dev/context-dev-cli/releases/latest \
  | grep -o 'https://[^"]*macos_arm64\.zip' \
  | xargs curl -fsSL -o context-dev.zip
unzip -o context-dev.zip -d context-dev-cli
sudo mv context-dev-cli/context-dev /usr/local/bin/
The archive also bundles shell completions (bash, zsh, fish) and man pages if you want them.
Confirm it installed:
terminal
context-dev --version

Set your API key

Sign up at context.dev/signup (free tier: 500 one-time credits, no card) and copy your key from the dashboard — it starts with ctxt_secret_. The CLI reads the key from the CONTEXT_DEV_API_KEY environment variable. Every command also accepts an explicit --api-key flag, which takes precedence over the environment.

Temporary (current terminal only)

export sets the key for the shell you’re in; it disappears when you close the terminal:
terminal
export CONTEXT_DEV_API_KEY="ctxt_secret_..."
For a single command, prefix the variable or pass the flag — neither touches your shell state:
terminal
CONTEXT_DEV_API_KEY="ctxt_secret_..." context-dev brand retrieve --domain stripe.com

context-dev brand retrieve --domain stripe.com --api-key "ctxt_secret_..."

Permanent (every new terminal)

Append the export to your shell profile so the key is set in every session:
terminal
# zsh (macOS default)
echo 'export CONTEXT_DEV_API_KEY="ctxt_secret_..."' >> ~/.zshrc && source ~/.zshrc

# bash
echo 'export CONTEXT_DEV_API_KEY="ctxt_secret_..."' >> ~/.bashrc && source ~/.bashrc
On Windows, setx persists it for all future terminals:
terminal
setx CONTEXT_DEV_API_KEY "ctxt_secret_..."
Never commit the key. Keep it in your shell profile, an .envrc, or a secret manager — and never bake it into scripts that land in a repo.

Usage

Commands follow a resource-based structure:
terminal
context-dev [resource] <command> [flags...]
ResourceWhat it covers
brandBrand profiles by domain, name, email, ticker, or ISIN; transaction identification
webScraping (Markdown, HTML, images, sitemap, crawl), search, screenshots, styleguide, fonts, competitors, JSON Schema extraction
aiProduct extraction and AI data queries
industryNAICS and SIC classification
utilityZero-credit cache prefetching
--help works at every level: context-dev --help lists the resources, context-dev web --help lists its commands, and context-dev web web-scrape-md --help documents every flag. Three global flags do most of the output work:
terminal
# Pull one field out of the response with GJSON syntax
context-dev brand retrieve --domain stripe.com --transform 'brand.colors'

# Force plain JSON for piping into jq or a file
context-dev brand retrieve --domain stripe.com --format json > stripe.json

# Interactively browse a large response
context-dev web extract-styleguide --domain stripe.com --format explore
--format accepts auto, explore, json, jsonl, pretty, raw, and yaml; auto (the default) picks based on whether output is going to a terminal or a pipe. --transform uses GJSON syntax to reshape responses before they’re printed.

Examples

One example per endpoint, grouped the same way as the API Reference. Credit costs are noted inline; the full breakdown is on the pricing page.

Brand Intelligence

terminal
# Full brand profile — logos, colors, socials, industry, links (10 credits)
context-dev brand retrieve --domain stripe.com

# Same profile from other identifiers (10 credits each)
context-dev brand retrieve-by-name --name "Stripe"
context-dev brand retrieve-by-email --email [email protected]
context-dev brand retrieve-by-ticker --ticker AAPL
context-dev brand retrieve-by-isin --isin US0378331005

# Slimmer payload: just domain, title, colors, logos, and backdrops (10 credits)
context-dev brand retrieve-simplified --domain stripe.com

# Resolve a raw card-statement descriptor to a real merchant (10 credits)
context-dev brand identify-from-transaction \
  --transaction-info "UBER *TRIP HELP.UBER.COM" \
  --country-gl us
See Get brand data and Enrich transaction codes for what comes back.

Web Scraping

terminal
# One page → LLM-ready Markdown (1 credit)
context-dev web web-scrape-md --url https://stripe.com/pricing

# Raw HTML instead (1 credit)
context-dev web web-scrape-html --url https://stripe.com/pricing

# Every image asset on a page (1 credit; 5 with --enrichment)
context-dev web web-scrape-images --url https://stripe.com

# All URLs in a site's sitemap (1 credit)
context-dev web web-scrape-sitemap --domain stripe.com

# Crawl a whole site to Markdown (1 credit per page)
context-dev web web-crawl-md --url https://docs.stripe.com --max-pages 25

# Search the web (1 credit per result)
context-dev web search --query "stripe billing pricing"

# Screenshot — returns a hosted PNG URL (5 credits)
context-dev web screenshot --direct-url https://stripe.com/pricing
context-dev web screenshot --domain stripe.com --page pricing --full-screenshot
See Scrape websites to Markdown and Take webpage screenshots.

Web Extraction

terminal
# Full design system: colors, typography, spacing, shadows, components (10 credits)
context-dev web extract-styleguide --domain stripe.com

# Fonts only (5 credits)
context-dev web extract-fonts --domain stripe.com

# Direct competitors, from landing-page and web-search evidence
context-dev web extract-competitors --domain stripe.com --num-competitors 5

# Typed extraction from any URL with a JSON Schema (10 credits)
context-dev web extract \
  --url https://stripe.com/pricing \
  --instructions "Extract the pricing plans" \
  --schema '{
    "type": "object",
    "properties": {
      "plans": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string" },
            "price": { "type": "string", "description": "Display price, like 2.9% + 30c" }
          }
        }
      }
    }
  }'
See Extract a design system and Extract structured data.

Product Extraction & AI Queries

terminal
# Is this URL a product page? If so, extract the product (10 credits)
context-dev ai extract-product --url https://www.allbirds.com/products/mens-wool-runners

# Pull a product list from a brand's whole site (10 credits)
context-dev ai extract-products --domain allbirds.com --max-products 10

# Ask for arbitrary datapoints from a brand's website (10 credits)
context-dev ai ai-query \
  --domain stripe.com \
  --data-to-extract.datapoint-name ceo_name \
  --data-to-extract.datapoint-description "Full name of the company's CEO" \
  --data-to-extract.datapoint-type text
See Extract products from websites.

Industry Classification

terminal
# 2022 NAICS codes from a domain or company name
context-dev industry retrieve-naics --input stripe.com

# SIC codes — original_sic (1987 list, default) or latest_sec (SEC's current list)
context-dev industry retrieve-sic --input stripe.com --type latest_sec
See the classification overview for how the three systems differ.

Prefetch

terminal
# Warm the cache so the next lookup lands in under a second (0 credits, paid plans only)
context-dev utility prefetch --domain stripe.com
context-dev utility prefetch-by-email --email [email protected]
See Prefetching for when this pays off.

Give it to your agent

Any agent with shell access can use the CLI as-is — no MCP server or tool config required. Make sure CONTEXT_DEV_API_KEY is exported in the shell your agent inherits, then tell it the CLI exists in your CLAUDE.md or AGENTS.md:
CLAUDE.md / AGENTS.md
## Context.dev CLI

The `context-dev` CLI is installed and `CONTEXT_DEV_API_KEY` is set. Use it to
look up brand data (`context-dev brand retrieve --domain example.com`), scrape
pages to Markdown (`context-dev web web-scrape-md --url ...`), take screenshots,
extract styleguides and products, and classify industries. Run
`context-dev --help` to list resources and
`context-dev <resource> <command> --help` for flags.
When the agent pipes a command, --format auto emits plain JSON, so the output is parseable without extra flags. For trimming large responses before they hit the agent’s context window, --transform is the tool: --transform 'brand.colors' returns just the colors instead of the full profile.

Next steps

Agent Quickstart

The full agent setup: copyable system prompt, SKILL.md, and MCP, in one page.

Install MCP

Prefer tool calls over shell commands? Connect the MCP server instead.

SKILL.md

Teach your agent when to reach for each endpoint.

API Reference

The underlying endpoints every CLI command calls.