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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ai-digest

v1.0.7

Published

CLI tool to aggregate files into a single Markdown file

Downloads

1,493

Readme

ai-digest

A CLI tool to aggregate your codebase into a single Markdown file for use with Claude Projects or custom ChatGPTs.

Features

  • Aggregates all files in the specified directory and subdirectories
  • Ignores common build artifacts and configuration files
  • Outputs a single Markdown file containing the whole codebase
  • Provides options for whitespace removal and custom ignore patterns

How to Use

Start by running the CLI tool in your project directory:

npx ai-digest

This will generate a codebase.md file with your codebase.

Once you've generated the Markdown file containing your codebase, you can use it with AI models like ChatGPT and Claude for code analysis and assistance.

With ChatGPT:

  1. Create a Custom GPT
  2. Upload the generated Markdown file to the GPT's knowledge base

With Claude:

  1. Create a new Project
  2. Add the Markdown file to the Project's knowledge

For best results, re-upload the Markdown file before starting a new chat session to ensure the AI has the most up-to-date version of your codebase.

Options

  • -i, --input <directory>: Specify input directory (default: current directory)
  • -o, --output <file>: Specify output file (default: codebase.md)
  • --no-default-ignores: Disable default ignore patterns
  • --whitespace-removal: Enable whitespace removal
  • --show-output-files: Display a list of files included in the output
  • --ignore-file <file>: Specify a custom ignore file (default: .aidigestignore)
  • --help: Show help

Examples

  1. Basic usage:

    npx ai-digest
  2. Specify input and output:

    npx ai-digest -i /path/to/your/project -o project_summary.md
  3. Enable whitespace removal:

    npx ai-digest --whitespace-removal
  4. Show list of included files:

    npx ai-digest --show-output-files
  5. Combine multiple options:

    npx ai-digest -i /path/to/your/project -o project_summary.md --whitespace-removal --show-output-files

Custom Ignore Patterns

ai-digest supports custom ignore patterns using a .aidigestignore file in the root directory of your project. This file works similarly to .gitignore, allowing you to specify files and directories that should be excluded from the aggregation.

Use the --show-output-files flag to see which files are being included, making it easier to identify candidates for exclusion.

Whitespace Removal

When using the --whitespace-removal flag, ai-digest removes excess whitespace from files to reduce the token count when used with AI models. This feature is disabled for whitespace-dependent languages like Python and YAML.

Binary and SVG File Handling

Binary files and SVGs are included in the output with a note about their file type. This allows AI models to be aware of these files without including their full content.

Local Development

Run npm run start to run the CLI tool on the local project. (Very meta!)

Run npm test to run the tests.

To pass flags to the CLI, use the -- flag, like this: npm run start -- --whitespace-removal.

Deploy New Version

npm publish

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.