# CLI

> Install the darkcrawl command line client, point it at DarkCrawl, and see one example for each command.

`darkcrawl` is a thin client for the HTTP API. It sends your command to DarkCrawl, and the server applies every rule. Run `darkcrawl <command> --help` for every option of a command.

## Install

Install it with [uv](https://docs.astral.sh/uv/), from the repository root. It puts `darkcrawl` on your path.

```bash
uv tool install .
```

## Point it at DarkCrawl

The client talks to `http://127.0.0.1:3002`, the address [Run it yourself](https://darkcrawl.dev/docs/run-it-yourself/) starts. Change it with `--url` before the command, or set `DARKCRAWL_URL`.

```bash
darkcrawl --url https://api.darkcrawl.dev scrape <url>
```

The key comes from `DARKCRAWL_API_KEY` in the environment. The client never prints it.

```bash
export DARKCRAWL_API_KEY=YOUR_API_KEY
```

Everything on this page down to “On your own server” works with a hosted key. The commands after it need your own DarkCrawl, or an extra install.

## Read pages

### scrape

Reads one page. `--format` is `markdown` (the default), `html`, `links` or `product`. `--full-page` keeps navigation and footers, `-o FILE` writes a file, and `--json` prints the whole reply, indicators included.

```bash
darkcrawl scrape <url> --format links
```

### parse

Reads a local PDF or Office document and prints its text. The file is only read, and nothing is stored.

```bash
darkcrawl parse ./report.pdf
```

### crawl

Reads a site, page by page. Without `--wait` it prints the job id.

```bash
darkcrawl crawl <url> --limit 50 --depth 2 --wait
```

### batch

Reads many pages as one job. Give the addresses on the line, or in a file with `--file`.

```bash
darkcrawl batch <url> <url> --wait
```

### status and cancel

`status` shows a crawl’s or a batch’s progress, and `cancel` stops one.

```bash
darkcrawl status <id>
```

```bash
darkcrawl cancel <id>
```

### map

Lists a site’s URLs, one per line.

```bash
darkcrawl map <url> --search forum
```

## Search what DarkCrawl holds

### search

Searches the pages DarkCrawl has stored first. Only when they give fewer results than `--limit`, and the server has `DARKCRAWL_SEARCH_URL` set, it also asks Ahmia, and then Ahmia sees the search terms. A DarkCrawl you run yourself needs `DARKCRAWL_SEARCH_URL` for Ahmia results.

```bash
darkcrawl search "debian mirror" --limit 10
```

### find

Searches the text of the pages DarkCrawl has stored, and never Ahmia. Each result shows its title, URL, fetch time, capture id and a snippet.

```bash
darkcrawl find wallet --host <host> --limit 20
```

## Ask an agent

Kipp, the agent, reads pages with a model to answer a prompt, so the server needs a model provider. `agent` starts a job and prints its id, and `--wait` follows it to the end.

### agent

```bash
darkcrawl agent "who sells the mirror list?" --url <url> --wait
```

### agent-status and agent-cancel

```bash
darkcrawl agent-status <id>
```

```bash
darkcrawl agent-cancel <id>
```

## Alerts and watches

### channel

Creates a place alerts go: a webhook, Slack or email. A webhook or Slack address is a secret, so it is read from `--url-file` or a hidden prompt, never from the command line.

```bash
darkcrawl channel add mail --kind email --recipient analyst@example.org
```

### alerts

Lists alert events.

```bash
darkcrawl alerts --monitor <id> --since 2026-11-01T00:00:00Z
```

### watch

Matches every page the index records as new or changed against a brand phrase, a domain, an email address or a pattern, and tells your channels. `watch` also has `list`, `show`, `set`, `delete` and `hits`.

```bash
darkcrawl watch create brand --phrase "Acme Ltd" --domain acme.example
```

## Leak library

`leaks` asks about ransomware leak sites from data DarkCrawl already holds. It has `check`, `countdowns`, `recent` and `sites`. Every listing is an unverified claim by the group that posted it.

```bash
darkcrawl leaks check acme.example
```

## On your own server

These commands call routes a hosted key does not reach, or need an extra install. They work against a DarkCrawl you run yourself.

### regex

Searches the stored pages with a regular expression, newest match first.

```bash
darkcrawl regex "bc1[a-z0-9]+" --limit 20
```

### sites

Shows what DarkCrawl knows about one site.

```bash
darkcrawl sites <host>
```

### capture

Shows one stored capture’s evidence record as JSON.

```bash
darkcrawl capture <capture-id>
```

### graph

Shows which onion services link to or name which. `--format csv` gives an edge list for Gephi.

```bash
darkcrawl graph --job <id> --format csv -o edges.csv
```

### export

Exports indicators, source URLs and onion hosts as STIX 2.1 or MISP JSON, never page text. Give exactly one of `--job`, `--capture` or `--host`.

```bash
darkcrawl export --format stix --job <id> -o findings.json
```

### monitor

Watches a page or a site for changes and tells your channels. `monitor` also has `list`, `show`, `run`, `pause`, `resume`, `runs`, `edit` and `delete`.

```bash
darkcrawl monitor add board <url> --interval 60 --keyword ransom
```

### alerts resend

`alerts resend ALERT_ID` sends one existing alert again to its channels.

### mcp

`mcp` runs an MCP server on stdio, so an AI client can call DarkCrawl as tools. It needs the `.[mcp]` install; the [MCP server](https://darkcrawl.dev/docs/mcp/) page and the quick-starts show it.

```bash
darkcrawl mcp
```

## Exit codes

0 means success. 1 means an API error, with a one-line reason on stderr. 2 means DarkCrawl could not be reached. 130 means you interrupted it.
