npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

docextract-cli

v1.0.3

Published

CLI tool for extracting documentation using AI-powered web scraping

Readme

DocExtractor CLI

A command-line interface for extracting documentation from websites using AI-powered web scraping.

Installation

Local Installation

cd cli
npm install

Global Installation

cd cli
npm install -g .

After global installation, you can use docextract command anywhere.

Usage

Extract Documentation

Extract documentation from a URL and save it to a local directory:

docextract extract <url> [options]

Options:

  • -o, --output <path> - Output directory path (relative to current directory). Default: ./docs
  • -s, --server <url> - Server URL. Default: http://localhost:3001

Examples:

# Extract to default ./docs directory
docextract extract https://docs.example.com

# Extract to custom directory
docextract extract https://docs.example.com -o ./my-docs

# Use custom server URL
docextract extract https://docs.example.com -s http://localhost:8080

Manage Extraction Guide

The extraction guide provides instructions to the AI on how to extract documentation. You can view, edit, or reset it:

View Current Guide

docextract guide --view

Edit Guide

Opens the guide in your default text editor:

docextract guide

The guide will open in:

  • Your EDITOR or VISUAL environment variable editor
  • notepad on Windows
  • nano on Linux/Mac

Reset to Default Guide

docextract guide --reset

Guide Customization

You can customize the extraction guide to:

  • Focus on specific types of content
  • Change the output format
  • Add specific extraction rules
  • Modify quality checks

The guide is located at cli/config/guide.txt and is sent to the server with each extraction request.

Server Setup

Before using the CLI, make sure the extraction server is running:

# In the server directory
cd server
npm install
npm run dev

The server should be running on http://localhost:3001 (or your configured port).

How It Works

  1. The CLI reads your extraction guide configuration
  2. Sends a request to the server with the URL and guide
  3. The server uses AI-powered web scraping to extract documentation
  4. Returns a ZIP file with the extracted markdown files
  5. CLI extracts the ZIP to your specified output directory

Output Structure

The extracted documentation will typically include:

docs/
├── README.md                 # Information about the extraction
├── MASTER_SUMMARY.md        # Index of all pages
└── pages/                   # Individual documentation pages
    ├── getting-started.md
    ├── api-reference.md
    └── ...

Troubleshooting

Server Connection Error

If you see Could not connect to server, ensure:

  1. The server is running (npm run dev in the server directory)
  2. The server URL is correct (use -s option to specify)
  3. No firewall is blocking the connection

Editor Not Opening

If docextract guide doesn't open an editor:

  1. Set the EDITOR environment variable to your preferred editor
  2. Or manually edit the file at cli/config/guide.txt

Extraction Timeout

Large documentation sites may take several minutes to extract. The CLI has a 10-minute timeout by default.

Requirements

  • Node.js 18 or higher
  • Running extraction server
  • Internet connection for documentation extraction

License

ISC