{"id":25511253,"url":"https://github.com/bjornmelin/code2prompt","last_synced_at":"2026-04-29T20:09:07.403Z","repository":{"id":278309777,"uuid":"935197402","full_name":"BjornMelin/code2prompt","owner":"BjornMelin","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-19T05:10:38.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T05:19:51.574Z","etag":null,"topics":["python","streamlit"],"latest_commit_sha":null,"homepage":"","language":null,"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/BjornMelin.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}},"created_at":"2025-02-19T04:02:10.000Z","updated_at":"2025-02-19T04:05:25.000Z","dependencies_parsed_at":"2025-02-19T05:19:53.738Z","dependency_job_id":"6d1a6e29-339e-40d3-9ae2-9d36802f6f00","html_url":"https://github.com/BjornMelin/code2prompt","commit_stats":null,"previous_names":["bjornmelin/code2prompt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornMelin%2Fcode2prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornMelin%2Fcode2prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornMelin%2Fcode2prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BjornMelin%2Fcode2prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BjornMelin","download_url":"https://codeload.github.com/BjornMelin/code2prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239639709,"owners_count":19672881,"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":["python","streamlit"],"created_at":"2025-02-19T10:30:18.303Z","updated_at":"2025-11-27T07:30:16.596Z","avatar_url":"https://github.com/BjornMelin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code2Prompt 🚀\n\n**Code2Prompt** is a modern, web-based tool that transforms one or more ZIP files containing a codebase into a structured, prompt-optimized format for language models like ChatGPT. With a sleek, customizable Streamlit interface, you can upload ZIP files, manage ignore patterns dynamically, filter file types, and customize prompt generation with advanced options.\n\n---\n\n## Table of Contents 📚\n\n- [Code2Prompt 🚀](#code2prompt-)\n  - [Table of Contents 📚](#table-of-contents-)\n  - [Features ✨](#features-)\n  - [Project Structure 🗂️](#project-structure-️)\n  - [Installation 🔧](#installation-)\n  - [Usage 🚀](#usage-)\n  - [Screenshots 📸](#screenshots-)\n  - [Mermaid Diagram](#mermaid-diagram)\n  - [Contributing 🤝](#contributing-)\n  - [License 📄](#license-)\n  - [Author 👨‍💻](#author-)\n  - [How to Cite 📝](#how-to-cite-)\n\n---\n\n## Features ✨\n\n- **Modern Streamlit Interface:**\n  - Uses Streamlit's built-in theming with customizable configuration.\n  - Responsive layout with a sidebar for advanced settings and progress indicators.\n- **Advanced Customization Options:**\n  - Dynamic ignore pattern management (including custom patterns).\n  - File type filtering (select which file extensions to process).\n  - Custom prompt header and options to include/exclude file boundaries, truncate content, and add file metadata.\n- **Batch Processing:**\n  - Upload and process multiple ZIP files simultaneously.\n  - Progress bars and detailed logging for processing steps.\n- **Interactive File Tree Viewer:**\n  - Collapsible preview of the file tree, preserved in session state.\n- **Robust Error Handling:**\n  - Clear, user-friendly error messages with custom exceptions.\n- **Extensible \u0026 Modular:**\n  - Clean, modular codebase for future enhancements.\n\n---\n\n## Project Structure 🗂️\n\n```mermaid\ngraph TD;\n    A[streamlit_app.py] --\u003e B[config.py]\n    A --\u003e C[file_processor.py]\n    A --\u003e D[formatter.py]\n    A --\u003e E[exceptions.py]\n```\n\n- **config.py:** Default settings for ignore directories and file type filters.\n- **file_processor.py:** Handles extraction of ZIP files and retrieval of file paths.\n- **formatter.py:** Formats file content into optimized prompts (Plaintext, Markdown, XML) with advanced customization.\n- **exceptions.py:** Custom exceptions for robust error handling.\n- **streamlit_app.py:** Main entry point with advanced UI and customization features.\n- **Makefile:** Shortcut for running the app.\n- **requirements.txt:** Project dependencies.\n\n---\n\n## Installation 🔧\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/yourusername/Code2Prompt.git\n   cd Code2Prompt\n   ```\n\n2. **Create a Virtual Environment:**\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install Dependencies:**\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Format Code (Optional):**\n\n   Use [Black](https://black.readthedocs.io/) to format the code:\n\n   ```bash\n   black .\n   ```\n\n---\n\n## Usage 🚀\n\n1. **Run the Application:**\n\n   ```bash\n   streamlit run streamlit_app.py\n   ```\n\n2. **Using the App:**\n   - **Upload ZIP Files:** Upload one or more ZIP files containing your codebase.\n   - **Customize Settings:** Use the sidebar to manage ignore patterns, select file types, choose output format, and adjust other formatting options. Add a custom prompt header if desired.\n   - **Generate Prompt:** Click \"Generate Prompt\" to process your files.\n   - **Preview \u0026 Log:** View the generated prompt, a file tree preview, and processing logs.\n   - **Built-In Theming:** The app uses Streamlit’s built-in theming, so the default Light/Dark modes are available through Streamlit’s config.\n\n---\n\n## Screenshots 📸\n\n_Include screenshots or GIFs of the updated app here to showcase the modern UI and enhanced features._\n\n![Code2Prompt Screenshot](https://via.placeholder.com/800x400?text=Code2Prompt+Streamlit+App)\n\n---\n\n## Mermaid Diagram\n\nBelow is a diagram representing the project structure:\n\n```mermaid\ngraph TD;\n    A[streamlit_app.py] --\u003e B[config.py]\n    A --\u003e C[file_processor.py]\n    A --\u003e D[formatter.py]\n    A --\u003e E[exceptions.py]\n```\n\n---\n\n## Contributing 🤝\n\nContributions are welcome! Please fork the repository and submit a pull request with your changes. For major changes, open an issue first to discuss your ideas.\n\n---\n\n## License 📄\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Author 👨‍💻\n\n**Bjorn Melin** - [GitHub Profile](https://github.com/BjornMelin)\n\n---\n\n## How to Cite 📝\n\nIf you use Code2Prompt in your research or project, please cite it using the following BibTeX entry:\n\n```bibtex\n@software{melin2025code2prompt,\n  author       = {Bjorn Melin},\n  title        = {Code2Prompt: A Streamlit Tool for Codebase-to-Prompt Conversion},\n  year         = {2025},\n  publisher    = {GitHub},\n  journal      = {GitHub repository},\n  howpublished = {\\url{https://github.com/BjornMelin/Code2Prompt}}\n}\n```\n\n---\n\nEnjoy using **Code2Prompt** to supercharge your prompt engineering and optimize your AI interactions! 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjornmelin%2Fcode2prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjornmelin%2Fcode2prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjornmelin%2Fcode2prompt/lists"}