Spaces:
Sleeping
Sleeping
first232
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import os
|
|
| 5 |
import shutil
|
| 6 |
from urllib.parse import urlparse
|
| 7 |
|
|
|
|
| 8 |
def validate_repo_url(url):
|
| 9 |
"""Validate if the input is a valid repository URL or GitHub shorthand."""
|
| 10 |
if not url:
|
|
@@ -92,13 +93,7 @@ def pack_repository(repo_url, branch, output_style, remove_comments, remove_empt
|
|
| 92 |
print(f"Warning: Could not remove temporary directory: {str(e)}")
|
| 93 |
|
| 94 |
# Create the Gradio interface
|
| 95 |
-
with gr.Blocks(title="
|
| 96 |
-
gr.Markdown("""
|
| 97 |
-
# 📦 Repomix Web Interface
|
| 98 |
-
Pack your GitHub repository into a single, AI-friendly file. Perfect for use with LLMs like Claude, ChatGPT, and Gemini.
|
| 99 |
-
|
| 100 |
-
Enter a GitHub repository URL (e.g., `https://github.com/user/repo`) or shorthand format (e.g., `user/repo`).
|
| 101 |
-
""")
|
| 102 |
|
| 103 |
with gr.Row():
|
| 104 |
with gr.Column():
|
|
@@ -134,11 +129,13 @@ with gr.Blocks(title="Repomix Web Interface", theme=gr.themes.Soft()) as demo:
|
|
| 134 |
|
| 135 |
pack_button = gr.Button("Pack Repository", variant="primary")
|
| 136 |
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
| 142 |
|
| 143 |
# Handle the pack button click
|
| 144 |
pack_button.click(
|
|
@@ -146,17 +143,6 @@ with gr.Blocks(title="Repomix Web Interface", theme=gr.themes.Soft()) as demo:
|
|
| 146 |
inputs=[repo_url, branch, output_style, remove_comments, remove_empty_lines, security_check],
|
| 147 |
outputs=output_text
|
| 148 |
)
|
| 149 |
-
|
| 150 |
-
gr.Markdown("""
|
| 151 |
-
### 📝 Notes
|
| 152 |
-
- The packed output is optimized for use with AI models
|
| 153 |
-
- Security check helps identify potentially sensitive information
|
| 154 |
-
- Different output styles (plain, XML, markdown) are available for different use cases
|
| 155 |
-
|
| 156 |
-
### 🔗 Links
|
| 157 |
-
- [Repomix GitHub Repository](https://github.com/yamadashy/repomix)
|
| 158 |
-
- [Documentation](https://github.com/yamadashy/repomix#-quick-start)
|
| 159 |
-
""")
|
| 160 |
|
| 161 |
if __name__ == "__main__":
|
| 162 |
demo.launch()
|
|
|
|
| 5 |
import shutil
|
| 6 |
from urllib.parse import urlparse
|
| 7 |
|
| 8 |
+
# [Previous helper functions remain the same]
|
| 9 |
def validate_repo_url(url):
|
| 10 |
"""Validate if the input is a valid repository URL or GitHub shorthand."""
|
| 11 |
if not url:
|
|
|
|
| 93 |
print(f"Warning: Could not remove temporary directory: {str(e)}")
|
| 94 |
|
| 95 |
# Create the Gradio interface
|
| 96 |
+
with gr.Blocks(title="Repo to TXT", theme=gr.themes.Soft()) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
with gr.Row():
|
| 99 |
with gr.Column():
|
|
|
|
| 129 |
|
| 130 |
pack_button = gr.Button("Pack Repository", variant="primary")
|
| 131 |
|
| 132 |
+
with gr.Row():
|
| 133 |
+
output_text = gr.TextArea(
|
| 134 |
+
label="Output",
|
| 135 |
+
placeholder="Packed repository content will appear here...",
|
| 136 |
+
lines=20,
|
| 137 |
+
show_copy_button=True # Enable built-in copy button
|
| 138 |
+
)
|
| 139 |
|
| 140 |
# Handle the pack button click
|
| 141 |
pack_button.click(
|
|
|
|
| 143 |
inputs=[repo_url, branch, output_style, remove_comments, remove_empty_lines, security_check],
|
| 144 |
outputs=output_text
|
| 145 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
if __name__ == "__main__":
|
| 148 |
demo.launch()
|