Project Path: history_notes
Source Tree:
```txt
history_notes
├── history
│ ├── medieval.txt
│ ├── renaissance.txt
│ └── ww2.txt
└── meta
└── my_revision_goals.txt
```
`history_notes/history/medieval.txt`:
```txt
Key events: Fall of Rome, Viking raids, Magna Carta
Important dates: 476 AD, 793 AD, 1215 AD
```
`history_notes/history/renaissance.txt`:
```txt
Key figures: Leonardo da Vinci, Michelangelo, Copernicus
Cultural shifts: Humanism, art revival, printing press
```
`history_notes/history/ww2.txt`:
```txt
Key events: D-Day, Hiroshima, End of War
Leaders: Churchill, Roosevelt, Hitler, Stalin
```
`history_notes/meta/my_revision_goals.txt`:
```txt
Focus: Memorize key events, understand causes & consequences
Deadline: 2 weeks
``` What is Code2Prompt ?
Code2Prompt is a context engineering tool that ingests your codebase, turning your repository into structured, AI-ready prompts.
Transform any repository into meaningful context following the Goal + Format + Context framework... Check it out !
Codebase 👨💻
node_app
├── README.md
├── data
│ └── sample.json
└── src
├── index.js
└── utils.js Command
Goal
What you want to achieve
Format
How you want the output structured
Context
Relevant information provided by Code2Prompt
Project Path: node_app
Source Tree:
```txt
node_app
├── README.md
├── data
│ └── sample.json
└── src
├── index.js
└── utils.js
```
`node_app/README.md`:
```md
Simple Node.js app to process JSON data.
Feature idea: Add a filter function to sort users by age.
```
`node_app/data/sample.json`:
```json
{
"users": [
{
"name": "Alice",
"age": 25
},
{
"name": "Bob",
"age": 30
}
]
}
```
`node_app/src/index.js`:
```js
const { processData } = require("./utils");
console.log("App started");
processData();
```
`node_app/src/utils.js`:
```js
function processData() {
console.log("Processing data...");
}
module.exports = { processData };
``` How to use Code2Prompt ?
Code2Prompt comes with different flavors depending on your needs.
Why Code2prompt ?
Code2Prompt introduces a new development workflow, enabling AI and human agents to interact with code efficiently.
Code2Prompt leverages glob patterns to include or exclude only the relevant files.
This allows you to query LLMs without extra noise, thus reducing hallucination and increasing performance.
code2prompt . --include "*.js,*.html" --exclude "node_modules/" Built for creators
Discover the new features
Code2Prompt transforms your codebase into structured prompts for AI models, making it easier to get accurate, context-aware responses.
- High-Performance
- Written in Rust for speed and efficiency, handling large codebases with minimal resource usage.
- Handlebars-Powered
- Customizable prompt generation using Handlebars templates, giving you full control over output format.
- Smart Filtering
- Supports include/exclude patterns with glob matching and smart context for precise code selection (soon).
- Multi-Format Support
- Exports structured prompts in JSON, Markdown, or XML with different formatting options to suit your workflow.
- Git Integration
- Includes Git diff and log extraction for better context, making it easier to understand code changes over time.
- Open-Source & Community-Driven
- Built with developer collaboration under the MIT license, encouraging contributions and extensions.
Join the Community
Code2Prompt is built by and for developers. Contribute, suggest features, and help shape the future of AI-driven code analysis.
