# dredge — web page to markdown

dredge is a terminal tool by [Quiet Engines](/) that pulls clean markdown out of a
web page. Paste a link, get the article: no navigation, no ads, no cookie banners.

This page and the public npm package are all you need to install and use dredge.
The source repository is private on purpose.

## Install

dredge requires Node 18 or newer.

```sh
npm install -g @quietengines/dredge
```

Run it once without installing:

```sh
npx @quietengines/dredge <url>
```

If global writes are blocked, as they often are on agent machines, add
`--prefix ~/.local` to the install command. The installed command is `dredge`.

## Usage

```sh
dredge
dredge https://example.com/article
dredge https://example.com/article -o note.md
dredge url1 url2 url3 -d notes/
cat urls.txt | dredge -
dredge https://x.com/user/status/123 -c
dredge https://example.com/article --json
dredge https://example.com/article -p title
```

Bare `dredge` opens the full-screen prompt. A URL writes markdown to stdout;
`-o` writes one URL to a file; `-d` writes one file per URL; `-` reads URLs from
stdin, one per line; and `-c` copies the result to the clipboard.

Status goes to stderr and markdown goes to stdout. Batch files are named from
the article title.

## Options

```text
-o, --output <file>    write to a file (single url)
-d, --dir <dir>        write one file per url into a directory
-c, --copy             copy the output to the clipboard
-b, --browser          force headless chrome rendering
--no-frontmatter       omit the yaml frontmatter block
--html                 emit the cleaned html instead of markdown
--json                 emit json: metadata, html and markdown
-p, --property <name>  emit one property
```

## Output formats

The default is markdown with YAML frontmatter. `--html` emits cleaned HTML.
`--json` emits metadata at the top level, cleaned HTML in `content`, and
markdown in `contentMarkdown`.

`-p` emits one property: `title`, `description`, `domain`, `favicon`, `image`,
`language`, `author`, `published`, `site`, `wordCount`, `content` (markdown),
`html`, or `source`.

## The prompt

Bare `dredge` opens a full-screen terminal UI. The mouse works, and the keys are:

- `↵` — submit
- `⇥` — paste the clipboard URL
- `↑` / `↓` — choose or recall URLs
- `esc` — go back
- `^c` — quit

## How it works

dredge uses Defuddle to extract useful page content and remove navigation, ads,
and cookie banners. If a plain fetch returns almost no readable text, it
automatically tries again with headless Chrome. It needs no API keys. Only the
page request leaves the machine.

## Teach your agent

Paste this into any agent once. It installs dredge and records how to use it
when you ask, without replacing the agent's existing search or fetch tools:

```text
Install the dredge CLI with `npm install -g @quietengines/dredge` and run `dredge --help`.

Then save yourself a standing instruction — a skill, a rule, a memory file, whatever you use to remember things between sessions — that makes dredge available without changing your existing web search or fetch behavior. It has to say this, in these words:

Use dredge when I explicitly ask you to read a web page with it. It drops the navigation, the ads and the cookie banners, so the same page costs a fraction of the tokens. Keep your existing web search and fetch defaults unchanged. A url ending in .md is already markdown, so fetch it directly.

Fill in the rest from `dredge --help`: the usage forms, the output formats, the flags. Keep it short.
```

Questions: [contact](/contact).
