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

@xblaster/ai-contextgen

v1.5.0

Published

Generate a Markdown snapshot of your project folder for AI context, respecting .gitignore and skipping large/binary files.

Readme

AI-ContextGen

codecov

AI-ContextGen is a Node.js CLI utility that generates comprehensive Markdown snapshots of your entire project structure, perfect for providing complete context to AI assistants (ChatGPT, Claude, etc.) while respecting .gitignore and .ai-ignore rules and filtering out binary files.

The tool is published on npm. Install it globally or run via npx to quickly generate project snapshots.


✨ Features

  • 📁 Complete Project Snapshot - Captures all text files in a structured markdown format
  • 🚫 Smart Filtering - Automatically respects .gitignore and .ai-ignore and skips binary/oversized files
  • 📝 AI-Ready Format - Generates clean markdown with syntax highlighting for each file
  • Git Integration - Works seamlessly with Git repositories
  • 🔧 Configurable - Command-line options for input/output customization
  • 📦 Restore Snapshot - Recreate files from a generated markdown

🚀 Quick Start

Using npx (Recommended)

npx @xblaster/ai-contextgen

With Custom Options

npx @xblaster/ai-contextgen --input ./my-project --output project-context.md

Restore From Snapshot

npx @xblaster/ai-contextgen restore project-context.md --output ./restored

💻 Installation & Usage

Global Installation

npm install -g @xblaster/ai-contextgen
ai-contextgen --input . --output snapshot.md

Local Development

git clone <your-repo-url>
cd ai-contextgen
npm install
node ai-contextgen.js --input . --output snapshot.md

📋 Command Line Options

ai-contextgen snapshot [options]
ai-contextgen restore <markdown> [--output <folder>]

Options:

  • --input, -i : Source directory to scan (default: current directory)
  • --output, -o : Output file or target directory (default: __aicontextgen.md)
  • --help, -h : Show help information

📄 Generated Output Format

The tool creates a structured markdown file like this:

# AI-ContextGen Snapshot

> Generated by AI-ContextGen. Below is the full project context.

---

## `package.json`

```json
{
  "name": "my-project",
  "version": "1.0.0"
}

Each snapshot ends with a Global checksum: line containing a SHA-256 hash computed from all included files. The restore process verifies this checksum to ensure every file was recreated correctly.

What Gets Included

  • ✅ All text-based source files
  • ✅ Configuration files (package.json, .env.example, etc.)
  • ✅ Documentation files
  • ✅ Scripts and configuration

What Gets Excluded

  • ❌ Binary files (images, executables, etc.)
  • ❌ Files listed in .gitignore or .ai-ignore
  • ❌ Large files (configurable threshold)
  • ❌ Git internal files (unless explicitly needed)

🎯 Use Cases

Perfect for AI Assistance:

  • Get complete project context for code reviews
  • Share entire codebase with AI for debugging
  • Generate documentation with full project understanding
  • Onboard new team members with complete project snapshots

Development Workflows:

  • Create project backups in readable format
  • Generate documentation snapshots
  • Share project structure for code analysis
  • Create context for remote code reviews

🔧 Technical Details

  • Language: Node.js / JavaScript
  • File Detection: Automatic binary file detection
  • Git Integration: Respects .gitignore and .ai-ignore patterns
  • Output Format: Clean markdown with syntax highlighting
  • Performance: Efficient file processing with progress indicators

🧪 Running Tests

  1. Install dependencies if not already done:
    npm install
  2. Run the test suite with:
    npm test

Unit tests are executed automatically via GitHub Actions using the included .github/workflows/ci.yml workflow.


📝 License

MIT License - see LICENSE file for details