Skip to content

Create CONTEXT.md files for your coding agents easily!

Notifications You must be signed in to change notification settings

existence-master/Contextify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contextify

Contextify is a CLI tool designed to facilitate Context-Driven Development by automatically generating and maintaining CONTEXT.md files throughout your codebase. It uses Google Gemini to analyze your code and create hierarchical documentation, making it easier for AI agents and human developers to understand the project structure.

Features

  • Bottom-Up Generation: Starts from the deepest subdirectories and bubbles up context to the root, ensuring high-level documentation reflects low-level details.
  • Automatic Updates: Smartly updates existing CONTEXT.md files, preserving manual developer notes while refreshing technical details.
  • Respects Ignore Files: Honors .gitignore and supports a custom .contextignore to exclude specific files or folders from analysis.
  • Large File Handling: Automatically truncates files larger than 200KB to fit within the context window, keeping the most relevant parts (head and tail).
  • Gemini Powered: Uses Google's Gemini models for high-quality summarization.

Installation

npm install -g contextify
# OR run directly with npx
npx contextify run

Usage

1. Initialization

First, you need to set your Google Gemini API Key. You can do this via the CLI or by setting an environment variable.

contextify init

Follow the prompts to enter your API Key.

Alternatively, set GEMINI_API_KEY in your environment or a .env file.

2. Run Contextify

Navigate to the root of your project and run:

contextify run

This will:

  1. Traverse your directory tree (bottom-up).
  2. Read file contents (respecting ignores).
  3. Read existing CONTEXT.md files from subdirectories.
  4. Generate or Update the CONTEXT.md for the current directory using Gemini.

Configuration

  • .gitignore: Files listed here are ignored.
  • .contextignore: Add this file to your project root to ignore specific files/folders only for Contextify (e.g., if you want to ignore documentation files but keep them in git).

requirements

  • Node.js >= 18
  • Google Gemini API Key

About

Create CONTEXT.md files for your coding agents easily!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •