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

md-combine

v1.0.3

Published

Combine markdown files from a GitHub repository, useful for creating context for Claude, ChatGPT and other AI and RAG

Downloads

17

Readme

md-combine

A command-line tool to combine markdown files from GitHub repositories. This tool can recursively fetch and combine markdown files from GitHub repositories, useful for creating context for Claude, ChatGPT and other LLM system prompt.

Features

  • 🔍 Recursively fetch files from GitHub repositories
  • 📂 Support for multiple file extensions
  • 🔄 Automatic rate limit handling
  • 📝 Generated table of contents
  • 🔑 GitHub token support for higher rate limits

Installation

You can run this tool directly using npx:

npx md-combine

Or install it globally:

npm install -g md-combine

Usage

Basic usage:

npx md-combine -u https://github.com/user/repo/tree/main/docs

Options

Options:
  -u, --url <url>            GitHub repository URL (required)
  -o, --output <path>        Output file path (default: "combined_output.md")
  -r, --recursive            Recursively fetch files from subdirectories
  -t, --token <token>        GitHub personal access token (optional)
  -e, --extensions <exts...> File extensions to include (default: .md)
  --help                     Display help for command
  -V, --version             Output the version number

Examples

  1. Basic usage (markdown files only):
npx md-combine -u https://github.com/user/repo/tree/main/docs
  1. Recursive search with custom output file:
npx md-combine -u https://github.com/user/repo/tree/main/docs -r -o documentation.md
  1. Multiple file extensions:
npx md-combine -u https://github.com/user/repo -r -e .md .txt .json
  1. Using GitHub token for higher rate limits:
npx md-combine -u https://github.com/user/repo -t your_github_token
  1. Combining specific file types recursively:
npx md-combine -u https://github.com/user/repo -r -e .vue .js .ts

GitHub Token

While the tool works without a token, GitHub API has rate limits:

  • Without token: 60 requests per hour
  • With token: 5,000 requests per hour

To use a token:

  1. Create a token at https://github.com/settings/tokens
  2. Use it in either way:
    • Pass it via command line: -t your_token
    • Set environment variable: export GITHUB_TOKEN=your_token

Output Format

The combined file includes:

  • Generation timestamp
  • Source repository information
  • Table of contents with links
  • Original file paths as headers
  • File contents with proper separation
  • Navigation-friendly anchor links

Example output structure:

# Combined Files from owner/repo

Generated on: 2024-11-10T12:00:00.000Z
Source: owner/repo/docs
Extensions: md, txt

## Table of Contents

- [docs/intro.md](#docs-intro-md)
- [docs/api/methods.md](#docs-api-methods-md)

---

<h2 id="docs-intro-md">docs/intro.md</h2>

[Content of intro.md]

---

<h2 id="docs-api-methods-md">docs/api/methods.md</h2>

[Content of methods.md]

Contributing

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

License

MIT

Author

Jithin Sha