TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Source to Prompt- Turn your code into an LLM prompt with more features

1 点作者 eigenvalue5 个月前
Your Source to Prompt-- Turn your code into an LLM prompt, but with way more features!<p>I just made this useful tool as a single html file that lets you easily turn your coding projects into targeted single text files for use in LLM prompts for AI-aided development.<p>Unlike the many other existing competing projects-- to name just a few:<p>1. [files-to-prompt](<a href="https:&#x2F;&#x2F;github.com&#x2F;simonw&#x2F;files-to-prompt">https:&#x2F;&#x2F;github.com&#x2F;simonw&#x2F;files-to-prompt</a>) 2. [repo2txt](<a href="https:&#x2F;&#x2F;repo2txt.simplebasedomain.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;repo2txt.simplebasedomain.com&#x2F;</a>) 3. [code2prompt](<a href="https:&#x2F;&#x2F;github.com&#x2F;mufeedvh&#x2F;code2prompt">https:&#x2F;&#x2F;github.com&#x2F;mufeedvh&#x2F;code2prompt</a>) 4. [repomix](<a href="https:&#x2F;&#x2F;github.com&#x2F;yamadashy&#x2F;repomix">https:&#x2F;&#x2F;github.com&#x2F;yamadashy&#x2F;repomix</a>) 5. [ingest](<a href="https:&#x2F;&#x2F;github.com&#x2F;sammcj&#x2F;ingest">https:&#x2F;&#x2F;github.com&#x2F;sammcj&#x2F;ingest</a>) 6. [1filellm](<a href="https:&#x2F;&#x2F;github.com&#x2F;jimmc414&#x2F;1filellm">https:&#x2F;&#x2F;github.com&#x2F;jimmc414&#x2F;1filellm</a>) 7. [repo2file](<a href="https:&#x2F;&#x2F;github.com&#x2F;artkulak&#x2F;repo2file">https:&#x2F;&#x2F;github.com&#x2F;artkulak&#x2F;repo2file</a>)<p>...there are some real advantages to this one that make it stand out:<p>* It&#x27;s a single html file that you download to your local machine-- that&#x27;s it! just open in a modern browser like chrome and you can use it securely.<p>* Because it&#x27;s locally hosted, with no requirements like python or anything else, it&#x27;s very quick to get it running on any machine, and because it&#x27;s local, you can use it on your own private repos without worrying about using a github authorization token or similar annoyance.<p>* You don&#x27;t even need to be working with a repo at all, it works just as well with a regular folder of code files.<p>Also, I added tons of quality of life improvements that were major pain points for me personally:<p>These include laboriously re-selecting the same or very similar subset of files over and over again; now you can save a preset (either to localStorage in the browser or exported and saved as a JSON file) and dramatically speed this up. There are also a few other features to speed up the file selection process, such as quick string based filtering on file names, and common quick selection patterns (such as &quot;select all React files&quot;).<p>It also keeps track of the total size in KB and lines of text that have been selected in a handy tally section which is always visible in the upper right corner, so you always know when you are reaching the maximum of the context window of whatever model you&#x27;re working with. Based on my experience, I added in warnings for GPT4o and o1 and also Claude3.5 Sonnet.<p>Before the listing of the files and their contents, it also automatically includes the hierarchical file&#x2F;folder structure of the files you select, and next to each one, shows the size in KB and the number of lines, which helps give the model context about which files are the most important.<p>I also added the ability to minify the code so you can cram more into the context window. Similarly, you can also strip out code comments, and it will tell you how much space this saved.<p>You can also specify a &quot;preamble&quot; that you can save and quickly edit, as well as a &quot;goal&quot; where you specify what you&#x27;re trying to accomplish. All of this can be included in your saved presets to save you time.<p>I hope you find it useful!

暂无评论

暂无评论