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 🙏

© 2025 – Pkg Stats / Ryan Hefner

mkctx

v1.0.3

Published

Tool to generate project context in markdown for AI assistants

Downloads

406

Readme

mkctx - Make Context

A powerful command-line tool that generates comprehensive markdown context files from your project code, perfect for use with AI assistants and documentation.

Features

  • 🚀 Multi-platform - Works on Windows, macOS, and Linux
  • 📝 Smart Ignoring - Respects gitignore patterns and custom ignore rules
  • ⚙️ Configurable - Customize source directories, output locations, and comments
  • 🎯 AI-Friendly - Outputs code in markdown format ideal for AI prompts
  • 🔧 Easy Installation - Install globally via npm

Installation

npm install -g mkctx

Quick Start

Generate context for your project

mkctx

Create configuration file

mkctx config

Usage

Basic Usage

Run mkctx in your project root to generate a context.md file containing all your project code:

cd your-project/
mkctx

Configuration

Create a configuration file to customize behavior:

mkctx config

This creates:

  • mkctx.config.json - Configuration file
  • mkctx/ directory - Output folder (added to .gitignore)

Configuration Options

The mkctx.config.json file supports the following options:

{
  "src": "./src",
  "ignore": "*.log, temp/, node_modules/, .git/",
  "output": "./mkctx",
  "first_comment": "/* Project Context */",
  "last_comment": "/* End of Context */"
}

| Option | Description | Default | |--------|-------------|---------| | src | Source directory to scan | "." (current directory) | | ignore | Comma-separated patterns to ignore | "*.log, temp/, node_modules/, .git/" | | output | Output directory for context file | "." (current directory) | | first_comment | Comment added at the beginning of the context | "/* Project Context */" | | last_comment | Comment added at the end of the context | "/* End of Context */" |

Output Format

The generated context.md file contains your project code in this format:

/* Project Context */

```javascript
// src/main.js
console.log("Hello World!");
```

```css
// styles/main.css
body { margin: 0; }
```

/* End of Context */

Examples

Include only specific directories

{
  "src": "./src",
  "ignore": "*.test.js, __tests__/, dist/",
  "output": "./docs",
  "first_comment": "/* My App Codebase */"
}

Generate context for documentation

{
  "src": ".",
  "ignore": "node_modules/, .git/, *.md, package-lock.json",
  "first_comment": "## Project Overview\n\nThis is the complete codebase for my application.",
  "last_comment": "## End of Codebase\n\nThis context file was generated using mkctx."
}

Platform Support

  • Windows - Full support with automatic .exe handling
  • macOS - Native support with proper permissions
  • Linux - Complete compatibility

Requirements

  • Go 1.16+ (for building from source)
  • Node.js 14.0+ (for npm installation)
  • npm or yarn (for package management)

How It Works

  1. Scan: Recursively scans your source directory
  2. Filter: Applies ignore patterns from config and .gitignore
  3. Format: Converts each file to markdown code blocks with file paths
  4. Output: Generates a comprehensive context.md file

Use Cases

  • AI Pair Programming - Provide complete context to AI assistants
  • Code Reviews - Share project overview with reviewers
  • Documentation - Create living documentation of your codebase
  • Onboarding - Help new developers understand the project structure
  • Backup - Generate searchable archives of your code

Troubleshooting

Installation Issues

If installation fails, try manual installation:

  1. Build the binary: go build -o mkctx main.go
  2. Copy to a directory in your PATH
  3. Ensure execution permissions: chmod +x mkctx

Permission Errors

On Unix systems, you might need to use sudo:

sudo npm install -g mkctx

Binary Not Found

If mkctx command is not found after installation:

  1. Check if the installation directory is in your PATH
  2. Restart your terminal
  3. Try reinstalling: npm uninstall -g mkctx && npm install -g mkctx

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

License

MIT License - see LICENSE file for details.

Support

If you encounter any problems or have questions:

  1. Check this README for solutions
  2. Open an issue on GitHub
  3. Check the generated configuration for guidance