puntorigen/code2prompt
NodeJS Class for transforming a given codebase directory into an LLM prompt
Recursively analyzes source trees and file contents, then uses Handlebars templates to structure output for LLM consumption. Integrates directly with OpenAI, Anthropic, and Groq APIs with automatic model preference ordering, supporting structured output via Zod schemas extracted from template definitions. Filters files by extension and glob patterns to exclude irrelevant code while generating context-aware prompts for documentation generation or code analysis tasks.
2 stars and 2,345 monthly downloads. No commits in the last 6 months. Available on npm.
Stars
2
Forks
3
Language
JavaScript
License
MIT
Category
Last pushed
Dec 21, 2024
Monthly downloads
2,345
Commits (30d)
0
Dependencies
15
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/prompt-engineering/puntorigen/code2prompt"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
shcherbak-ai/contextgem
ContextGem: Effortless LLM extraction from documents
ShahzaibAhmad05/gitree
An upgrade from "ls" for developers. An open-source tool to analyze folder structures and to...
mufeedvh/code2prompt
A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt...
nicepkg/ctxport
Copy AI conversations as clean Markdown Context Bundles — one click from ChatGPT, Claude,...
WecoAI/weco-cli
The Platform for Self-Improving Code. Ideal for GPU kernels, ML model development, feature...