A command‑line tool that extracts the main content from web pages using Defuddle.
bun install
bun run build
bun linkRunning the commands above will:
- Install the project’s dependencies.
- Build the TypeScript source.
- Link the package globally, making the
defuddle-clicommand available in the shell.
If you use just, you can build and install a native binary with a single command:
just installThis does the following:
- Runs
bun run build-exeto create the nativedefuddle-clibinary. - Copies the binary to
/usr/local/bin/defuddle-cliand sets the appropriate executable permissions.
Note: The just install target requires sudo privileges because it writes to /usr/local/bin.
defuddle-cli [options] <url>When you are still working from the source tree (i.e., before linking), invoke the script with Bun:
bun defuddle-cli.ts [options] <url>| Flag | Alias | Description |
|---|---|---|
-h |
--help |
Show the help message and exit. |
--html |
– | Output the extracted content as HTML (default is Markdown). |
-d |
--debug |
Enable debug mode (extra logging). |
-q |
--quiet |
Quiet mode – suppress error messages. |
-o |
--output FILE |
Write the result to FILE instead of stdout. |
Extract the main content as Markdown (default):
defuddle-cli https://example.comExtract the content as HTML:
defuddle-cli --html https://example.comSuppress error output and save the result to a file:
defuddle-cli -q -o content.md https://example.comRun the script directly with Bun (useful while developing):
bun defuddle-cli.ts https://example.com