gnaw

Transform your code into AI-optimized prompts in seconds

Quick Start

Getting Started 🚀 Installation 📥 Learn Filtering 🔍 Learn Templating 📝 Vision 🔮

gnaw is a powerful code ingestion tool designed to generate prompts for code analysis, generation, and other tasks. It works by traversing directories, building a tree structure, and gathering information about each file.

It simplifies the process of combining and formatting code, making it easy to analyze, document, or refactor code using LLMs.

You can use gnaw the following ways:

Core

Core library, blazingly fast code ingestion

CLI / TUI

Command line and terminal interface specially designed for humans

Python

Python bindings for AI agents and automation scripts

REST

REST interface for browser-extension integration (planned)

Key Features

Why gnaw?

  1. Save Time: Automates the process of traversing a codebase and formatting files for LLMs, and avoids repetitive copy-pasting of code.
  2. Improve Productivity: Provides a structured and consistent format for code analysis, and helps identify bugs, refactor code, and write documentation faster.
  3. Handle Large Codebases: Designed to work seamlessly with large codebases, respecting context limits of LLMs.
  4. Customizable Workflows: Flexible options for filtering files, using templates, and generating targeted prompts.

Example Use Cases