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

# Install the CLI

> Install the Stophy CLI, search and scrape without logging in, then log in to read sites with parsers, crawl, extract and set up your coding agents.

The `stophy` command calls the Stophy API from your terminal. It reads the endpoint list from the API at run time, so a new endpoint shows up as a command without an update. `stophy <command> --help` lists the options your version takes.

## Install

```bash theme={null}
curl -fsSL https://stophy.dev/install | bash
```

The installer puts the binary in `~/.local/bin`. On Windows, use PowerShell.

```powershell theme={null}
irm https://stophy.dev/install.ps1 | iex
```

With Node.js 20 or later, `npm install -g @stophy/cli` works too. Check the install.

```bash theme={null}
stophy version
```

## Try it without an API key

Without logging in, you can run the commands that `stophy endpoints` marks `free`, up to 10 calls a minute and 50 calls a day per IP address.

```bash theme={null}
stophy search "bun runtime"
```

Results print as rows, or as JSON with `--json`.

## Set up your agent

```bash theme={null}
stophy init --all
```

`init` logs you in with your browser, installs the Stophy [skills](https://docs.stophy.dev/install-skill.md) with `npx -y skills add stophydotdev/stophy`, and adds the [MCP server](https://docs.stophy.dev/install-mcp). With Claude Code on your PATH it runs `claude mcp add`. For any other agent it prints the command or snippet to use, and leaves your config files alone.

| Option | What it does |
| - | - |
| `--all` | Run every step without asking |
| `--agent <name>` | Set up one agent, such as `claude-code` or `codex` |
| `--skip-auth` | Do not log in |
| `--skip-skills` | Do not install the skills |
| `--skip-mcp` | Do not add the MCP server |

## Log in

```bash theme={null}
stophy login --browser
```

The CLI prints a code and opens stophy.dev. Check that the page shows the same code, then click **Approve**. On a server with no browser, open the printed link on any other device.

To use an API key from the [dashboard](https://stophy.dev/dashboard) instead, run this and paste the key when it asks, so it stays out of your shell history. In CI, set `STOPHY_API_KEY` from your secret store.

```bash theme={null}
stophy login --api-key
```

Each computer gets its own key, and logging in again replaces it. `stophy logout` logs out and revokes the key. Never pass a key as a command argument. See [API keys](https://docs.stophy.dev/account/api-keys.md).

## Make a request

```bash theme={null}
stophy search "bun runtime" --limit 5
stophy scrape https://bun.com/docs
stophy map https://bun.com --limit 50
stophy crawl https://bun.com/docs --limit 20
stophy crawl status <id>
stophy extract --urls https://bun.com --prompt "the latest version"
stophy extract status <id>
```

Every command takes `--json` for the data as JSON, `--raw` for the full response and `-o <path>` to write the output to a file. With `--json`, the CLI also prints `credits used: <n>` to stderr.

* Give a list as `--urls a,b` or `--urls a --urls b`.
* Turn a yes-or-no option on with `--flag` and off with `--no-flag`.
* Options that take JSON, like `--formats '["markdown","links"]'`, take it as one quoted argument.
* A value the command does not take stops the CLI before it calls Stophy, and it prints the values that work.
* A failed call ends with `Request id: <id>`, which support will ask for.

`crawl` and `batch scrape` answer at once with an `id`. Read the pages with `status <id>` until the status is `completed`, and stop a running job with `cancel <id>`. A status answer holds up to 100 finished pages or 2 MB. When it has a `next` link, run `status` again with `--cursor` and the cursor from that link. `extract` answers when the fields are ready, and `extract status <id>` reads the result again for 24 hours. See [Read a crawl](https://docs.stophy.dev/crawl/async.md).

## Read a site with a parser

A parser returns a site's own data as JSON: posts, videos, places, products, jobs, listings and more. `stophy parsers [word]` lists them, with the kind of page each one takes.

```bash theme={null}
stophy parsers reddit
stophy scrape "https://www.reddit.com/r/rust/" --parser reddit-subreddit
stophy scrape https://youtu.be/M4TufsFlv_o --parser youtube-transcript
```

If the output ends with a `cursor`, get the next page with `--parserOptions '{"cursor":"<cursor>"}'`. See [Pre-built parsers](https://docs.stophy.dev/scrape/prebuilt-parsers).

## Find a command

```bash theme={null}
stophy --help
stophy scrape --help
stophy describe scrape
stophy endpoints
```

`stophy endpoints [word]` lists every command with its price, and `stophy describe <id>` shows one command's options, cost and an example. Besides the data commands above, there are `parse`, `agent`, `browser task`, `batch scrape` and `webhook secret`. The CLI has no command for browser sessions or monitors. Call those over HTTP.

## Commands

| Command | What it does |
| - | - |
| `stophy init` | Set up Stophy in your coding agents |
| `stophy login` | Log in with your browser or an API key |
| `stophy logout` | Log out and revoke this computer's key |
| `stophy <command>` | Get data, for example `stophy search` |
| `stophy parsers [word]` | List the parsers `scrape --parser` takes |
| `stophy endpoints [word]` | List every command and its price |
| `stophy describe <id>` | Show one command's options, cost and an example |
| `stophy status` | Show your login, balance and CLI version |
| `stophy usage` | Show your balance and all-time usage |
| `stophy logs --days 7` | Show your recent requests |
| `stophy doctor` | Check your install, login and connection |
| `stophy version` | Show the CLI version |

The CLI tells you when a newer version is out. Set `STOPHY_NO_UPDATE_CHECK=1` to turn that off.

## Related

* [Install skills](https://docs.stophy.dev/install-skill.md)
* [Install MCP](https://docs.stophy.dev/install-mcp)
* [SDKs](https://docs.stophy.dev/sdks)
* [Pricing](https://docs.stophy.dev/account/pricing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.