Skip to content

Repository files navigation

ContextPress ✦

Next-generation repository bundler and interactive dashboard that transforms your codebase into structured, token-efficient contexts for Large Language Models (LLMs) like ChatGPT, Claude, and Gemini.

CI Status npm version npm downloads License Node Version


ContextPress Dashboard Preview


Why ContextPress?

AI assistants are incredibly powerful, but feeding them codebase context can be painful. Copying files individually is slow, and bundling the whole repository often overflows token limits with boilerplate or build files.

ContextPress solves this with a premium, dual-purpose developer experience:

  1. 💻 A fast CLI to create structured Markdown, XML, or JSON bundles.
  2. 🎨 A stunning, self-contained Glassmorphic HTML Dashboard that allows you to visually explore code metrics, search, select specific files via checkboxes, and copy only what's needed.
  3. ✂️ Smart Signature Extraction to strip away function implementations and keep only classes, types, and function definitions, reducing token costs by up to 80%.

Key Features

  • ⚙️ Smart Ignorers: Automatically respects .gitignore, and filters out binaries, dependencies (node_modules), lockfiles, and media.
  • Intelligent Code Signatures: Compresses JS/TS and Python files by preserving only API signatures (omits inner code blocks).
  • 📊 Token Estimator: Displays real-time token counts for each file based on text analysis (~4 chars/token).
  • 🌐 Glassmorphic Web App: Generates a fully self-contained HTML explorer.
    • Interactive file explorer tree.
    • Fuzzy text search across filenames and contents.
    • Interactive checkboxes to copy only a subset of files.
    • Line-numbered, syntax-highlighted code viewer (offline fallback supported).

Quick Start

You can run ContextPress directly without installation using npx:

npx context-press

Local Installation

Install globally on your system:

npm install -g .

Or run in development mode inside this workspace:

node bin/cli.js

CLI Usage & Options

context-press [dir] [options]

Arguments

  • [dir]: Directory to scan (default: current directory .)

Options

  • -o, --output <path>: Specify custom output file path.
  • -f, --format <format>: Format type: markdown (default), xml, json, html.
  • -s, --signatures: Enable code signature extraction mode.
  • -w, --web: Shorthand/alias to generate the HTML dashboard (equivalent to -f html).
  • -c, --copy: Copy the output bundle directly to the system clipboard.
  • -t, --template <type>: Prepend system prompt template: review, bug, refactor, doc.
  • -e, --exclude <globs...>: Add additional custom folder/file glob exclusions.
  • -h, --help: Display help information.

Examples

Generate the interactive web dashboard for the current repo:

context-press -w

Outputs: context-press-bundle.html

Bundle Javascript and Python code with signatures only:

context-press -s -o code-api.md

Generate a structured XML bundle for Claude:

context-press -f xml -o bundle.xml

Formatting for LLMs

ContextPress outputs structured blocks that models parse with high accuracy:

Markdown Format

### File: `src/main.js`
```javascript
// code contents

### XML Format
```xml
<file path="src/main.js" tokens="140">
  <content><![CDATA[// code contents]]></content>
</file>

XML tags are highly recommended for Anthropic Claude, as Claude is specifically trained to structure its input/output using XML tags.


License

MIT License. Feel free to use and contribute!

About

A premium CLI & glassmorphic HTML dashboard to bundle your codebase into token-efficient prompts for LLMs (ChatGPT, Claude, Gemini). Features smart code signature extraction (reducing tokens by up to 80%) and selective file copying.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages