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.
No commits in the last 6 months. Available on npm.
Stars
2
Forks
3
Language
JavaScript
License
MIT
Category
Last pushed
Dec 21, 2024
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
mufeedvh/code2prompt
A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt...
ShahzaibAhmad05/gitree
An upgrade from "ls" for developers. An open-source tool to analyze folder structures and to...
nicepkg/ctxport
Copy AI conversations as clean Markdown Context Bundles — one click from ChatGPT, Claude,...
nikolay-e/treemapper
Export your entire codebase to ChatGPT/Claude in one command. Structure + contents in YAML/JSON...