{"id":13624851,"url":"https://github.com/mufeedvh/code2prompt","last_synced_at":"2025-05-14T22:05:41.129Z","repository":{"id":227115130,"uuid":"769564277","full_name":"mufeedvh/code2prompt","owner":"mufeedvh","description":"A CLI tool to convert your codebase into a single LLM prompt with source tree, prompt templating, and token counting.","archived":false,"fork":false,"pushed_at":"2025-05-12T19:07:07.000Z","size":4057,"stargazers_count":5632,"open_issues_count":17,"forks_count":317,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-05-14T22:05:22.262Z","etag":null,"topics":["ai","chatgpt","claude","cli","command-line","command-line-tool","gpt","llm","prompt","prompt-engineering","prompt-generator","prompt-toolkit","rust"],"latest_commit_sha":null,"homepage":"https://code2prompt.dev","language":"MDX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mufeedvh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-09T12:42:06.000Z","updated_at":"2025-05-14T19:55:24.000Z","dependencies_parsed_at":"2024-04-14T04:40:28.722Z","dependency_job_id":"a8bfc0d0-a006-4658-a512-087f05f9d34e","html_url":"https://github.com/mufeedvh/code2prompt","commit_stats":{"total_commits":57,"total_committers":12,"mean_commits":4.75,"dds":"0.33333333333333337","last_synced_commit":"a7d98da72c52b8c4aa4bcae15b1b36e58f1c39c0"},"previous_names":["mufeedvh/code2prompt"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufeedvh%2Fcode2prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufeedvh%2Fcode2prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufeedvh%2Fcode2prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mufeedvh%2Fcode2prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mufeedvh","download_url":"https://codeload.github.com/mufeedvh/code2prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235687,"owners_count":22036962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatgpt","claude","cli","command-line","command-line-tool","gpt","llm","prompt","prompt-engineering","prompt-generator","prompt-toolkit","rust"],"created_at":"2024-08-01T21:01:47.115Z","updated_at":"2025-05-14T22:05:41.077Z","avatar_url":"https://github.com/mufeedvh.png","language":"MDX","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://code2prompt.dev\"\u003e\n  \u003cimg align=\"center\" width=\"550px\" src=\".assets/logo_dark_v0.0.2.svg\" alt=\"Code2prompt\"/\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003e\n  \u003cb\u003eConvert your codebase into a single LLM prompt !\u003c/b\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://code2prompt.dev\"\u003e\u003cimg src=\".assets/CLI.png\" alt=\"code2prompt\"\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\u003chr /\u003e\n\n[![crates.io](https://img.shields.io/crates/v/code2prompt.svg)](https://crates.io/crates/code2prompt)\n[![LICENSE](https://img.shields.io/github/license/mufeedvh/code2prompt.svg#cache1)](https://github.com/mufeedvh/code2prompt/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/user/repo/pulls)\n[![Lines of Code](https://tokei.rs/b1/github/mufeedvh/code2prompt)](https://github.com/mufeedvh/code2prompt)\n[![Discord](https://img.shields.io/discord/1342336677905039451?logo=discord)](https://discord.com/invite/ZZyBbsHTwH)\n\n\u003chr /\u003e\n\n\u003cp align=\"center\"\u003e\n  Want to engage with us ? Join our \u003ca href=\"https://discord.com/invite/ZZyBbsHTwH\"\u003eDiscord\u003c/a\u003e channel!\u003cbr\u003e\n  \u003ci\u003eStay updated on new features\u003c/i\u003e 📢\u003cbr\u003e\n  \u003ci\u003eGive your insight and suggestion\u003c/i\u003e 💬\u003cbr\u003e\n  \u003ci\u003eGet help with configuration and usage\u003c/i\u003e 🛠️\u003cbr\u003e\n  \u003ci\u003eReport Bug\u003c/i\u003e 🐛\u003cbr\u003e\n\u003c/p\u003e\n\n## Quick Install ⚡\n\n```bash\n# Cargo\n$ cargo install code2prompt\n\n# Homebrew\n$ brew install code2prompt\n```\n\nSDK with pip 🐍\n\n```bash\npip install code2prompt-rs\n```\n\n## How is it useful?\n\n**Core**\n\n`code2prompt` is a code ingestion tool that streamline the process of creating LLM prompts for code analysis, generation, and other tasks. It works by traversing directories, building a tree structure, and gathering informations about each file. The core library can easily be integrated into other applications.\n\n**CLI**\n\n`code2prompt` command line interface (CLI) was designed for humans to generate prompts directly from your codebase. The generated prompt is automatically copied to your clipboard and can also be saved to an output file. Furthermore, you can customize the prompt generation using Handlebars templates. Check out the provided prompts in the doc !\n\n**SDK**\n\n`code2prompt` software development kit (SDK) offers python binding to the core library. This is perfect for AI agents or automation scripts that want to interact with codebase seamlessly. The SDK is hosted on Pypi and can be installed via pip.\n\n**MCP**\n\n`code2prompt` is also available as a Model Context Protocol (MCP) server, which allows you to run it as a local service. This enables LLMs on steroids by providing them a tool to automatically gather a well-structured context of your codebase.\n\n## Documentation 📚\n\nCheck our online [documentation](https://code2prompt.dev/docs/welcome/) for detailed instructions\n\n## Features\n\nCode2Prompt transforms your entire codebase into a well-structured prompt for large language models. Key features include:\n\n- **Automatic Code Processing**: Convert codebases of any size into readable, formatted prompts\n- **Smart Filtering**: Include/exclude files using glob patterns and respect `.gitignore` rules\n- **Flexible Templating**: Customize prompts with Handlebars templates for different use cases\n- **Token Tracking**: Track token usage to stay within LLM context limits\n- **Git Integration**: Include diffs, logs, and branch comparisons in your prompts\n- **Developer Experience**: Automatic clipboard copy, line numbers, and file organization options\n\nStop manually copying files and formatting code for LLMs. Code2Prompt handles the tedious work so you can focus on getting insights and solutions from AI models.\n\n## Alternative Installation\n\nRefer to the [documentation](https://code2prompt.dev/docs/how_to/install/) for detailed installation instructions.\n\n### Binary releases\n\nDownload the latest binary for your OS from [Releases](https://github.com/mufeedvh/code2prompt/releases).\n\n### Source build\n\nRequires:\n\n- [Git](https://git-scm.org/downloads), [Rust](https://rust-lang.org/tools/install) and `Cargo`.\n\n```sh\ngit clone https://github.com/mufeedvh/code2prompt.git\ncd code2prompt/\ncargo install --path crates/code2prompt\n```\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=mufeedvh/code2prompt\u0026type=Date)](https://star-history.com/#mufeedvh/code2prompt\u0026Date)\n\n## License\n\nLicensed under the MIT License, see \u003ca href=\"https://github.com/mufeedvh/code2prompt/blob/master/LICENSE\"\u003eLICENSE\u003c/a\u003e for more information.\n\n## Liked the project?\n\nIf you liked the project and found it useful, please give it a :star: !\n\n## Contribution\n\nWays to contribute:\n\n- Suggest a feature\n- Report a bug\n- Fix something and open a pull request\n- Help me document the code\n- Spread the word\n","funding_links":[],"categories":["MDX","Rust","Prompts","Claude Code Ecosystem","Content Creation","A01_文本生成_文本对话","HarmonyOS","Table of Contents","Repos","UIs","开发工具与实用程序"],"sub_categories":["Development \u0026 Code Tools","大语言对话模型及数据","Windows Manager","Information Processing","Command-line(shell) interface"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmufeedvh%2Fcode2prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmufeedvh%2Fcode2prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmufeedvh%2Fcode2prompt/lists"}