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

mkctx

v4.0.0

Published

Generate markdown context files from your project code and chat with AI using Ollama

Downloads

345

Readme

✨ Features

  • 🚀 Multi-platform - Works on Windows, macOS, and Linux
  • 📝 Smart Ignoring - Respects custom ignore patterns and common system files
  • ⚙️ Configurable - Customize source directories, output locations, and comments
  • ✏️ Custom Naming - Specify custom filenames for your outputs or use the default 'context'
  • 🎯 AI-Friendly - Outputs code in markdown format ideal for AI prompts
  • 🎨 Syntax Highlighting - Proper language detection for code blocks
  • 🔄 Dynamic Mode - Interactive path selection when needed
  • 📊 Context Statistics - Token estimation and file analysis

📦 Installation

npm install -g mkctx

Requirements

  • Node.js 18.0+

🚀 Quick Start

Interactive Mode (Recommended)

mkctx

This opens an interactive menu where you can:

  1. Generate context from config file or dynamically
  2. View context statistics
  3. Choose output formats and save with a custom name

Create Configuration File

mkctx config

Show Help

mkctx help

📋 Usage

╔════════════════════════════════════════╗
║     📄 mkctx - Make Context            ║
╚════════════════════════════════════════╝

? What would you like to do?
  ❯ 📁 Generate from config file
    🔍 Generate dynamically (choose path)
    ⚙️  View configuration
    ❌ Exit

After generating context:

📊 Context Summary:
   Files: 42
   Lines: 3,847
   Size: 156.23 KB
   Est. tokens: ~39,058

? Select output format:
  ❯ 📦 All formats (MD, JSON, TOON, XML)
    📝 Markdown (.md)
    🔧 JSON (.json) - Simple array
    🎒 TOON (.toon) - Token-optimized
    📄 XML (.xml)

? Enter a name for the output files: (context)

Note: Simply press Enter to use the default name context.

⚙️ Configuration

Project Configuration (mkctx.config.json)

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

| Option | Description | Default | |--------|-------------|---------| | src | Source directory to scan | "." | | ignore | Comma-separated patterns to ignore | See defaults | | output | Output directory for context file | "./mkctx" | | first_comment | Comment at the beginning | "/* Project Context */" | | last_comment | Comment at the end | "/* End of Context */" |

🔧 CLI Options

mkctx                    # Interactive mode (recommended)
mkctx config             # Create configuration file
mkctx help               # Show help message
mkctx version            # Show version

📂 Ignore Patterns

mkctx supports several pattern types:

  • Wildcards: *.log, *.test.js, *.spec.ts
  • Directories: temp/, dist/, build/
  • Glob patterns: **/.cache/, **/node_modules/
  • Exact match: config.local.json

Default System Ignores

These are always ignored automatically:

  • .git, .svn, .hg
  • node_modules, __pycache__
  • .DS_Store, Thumbs.db
  • .vscode, .idea
  • Binary files, images, archives

📄 Output Format

The generated file contains your project code. When saving, you can specify a filename (e.g., my_project_docs.md) or use the default.

/* Project Context */

## Project Structure

```
📁 src/
📁 src/components/
📁 src/utils/

42 files total
```

## Source Files

### src/index.ts

```typescript
import { App } from './app';

const app = new App();
app.start();
```

### src/utils/helpers.ts

```typescript
export function helper() {
  return true;
}
```

/* End of Context */

🎨 Supported Languages

mkctx automatically detects and applies proper syntax highlighting for:

| Category | Extensions | |----------|------------| | JavaScript/TypeScript | .js, .ts, .jsx, .tsx, .mjs, .cjs | | Python | .py, .pyw | | Go | .go | | Rust | .rs | | Java/Kotlin | .java, .kt, .scala | | C/C++ | .c, .cpp, .h, .hpp | | PHP | .php | | Ruby | .rb, .rake | | Shell | .sh, .bash, .zsh, .ps1 | | Web | .html, .css, .scss, .vue, .svelte | | Data | .json, .yaml, .yml, .xml, .toml | | And many more... | .sql, .graphql, .proto, .prisma, .sol |

💡 Use Cases

  • 🤖 AI Code Analysis - Feed your codebase to ChatGPT, Claude, or other AI tools
  • 📚 Code Understanding - Share project overview for quick understanding
  • 👥 Code Reviews - Share project overview with reviewers
  • 🎓 Onboarding - Help new developers understand the project
  • 📝 Documentation - Generate a snapshot of your codebase with custom naming

🖥️ Platform Support

| Platform | Status | |----------|--------| | macOS | ✅ Full support | | Linux | ✅ Full support | | Windows | ✅ Full support |

🔧 Troubleshooting

Command Not Found

If mkctx is not found after installation:

  1. Make sure npm global bin is in your PATH
  2. Try: npm bin -g to see where global packages are installed
  3. Restart your terminal

Permission Errors (Unix)

sudo npm install -g mkctx

Or fix npm permissions: https://docs.npmjs.com/resolving-eacces-permissions-errors

📋 Changelog

v4.0.0

  • ✏️ Added interactive filename selection when saving (defaults to "context")
  • 🎨 Improved UI/UX for file saving workflow

v3.0.0

  • 🎯 Simplified to focus on context generation
  • 🗑️ Removed Ollama chat integration
  • ⚡ Faster startup and smaller footprint
  • 🧹 Cleaner codebase

v2.x

  • Ollama AI chat integration (removed in v3)
  • Interactive chat interface

v1.x

  • Initial Go-based implementation

🤝 Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

📄 License

MIT License - see LICENSE file for details.