Ein Python-Modul zur automatischen Zusammenstellung und Kopie eines Code‑Projekts in die Zwischenablage – ideal als Ausgangspunkt für LLM‑basiertes Refactoring oder Review.
- Verzeichnisbaum: Baut automatisch eine übersichtliche Baumstruktur Deiner Projektdateien auf.
- Filterung: Beinhaltet nur definierte Dateiendungen (standardmäßig
.py), schließt Ordner wie__pycache__,.git,.ideau.v.m. aus. - Kommentare entfernen: Bereinigt Quellcode um Kommentare, um den „Kern“ lesbar zu machen.
- Zwischenablage: Kopiert das Ergebnis mitsamt Struktur und Kommentar-Anweisungen direkt in die Zwischenablage.
- Prompt‑Vorlage: Mit
copy_initerzeugst Du auf Knopfdruck eineprompt_export.py‑Datei für neue Projekte.
-
Repository klonen
git clone https://github.com/piledge/codecopy.git cd codecopy -
Abhängigkeiten installieren
pip install -r requirements.txt
-
Optional: Als Paket installieren
pip install git+https://github.com/piledge/codecopy.git # Aktualisieren pip install --upgrade --force-reinstall --no-cache-dir git+https://github.com/piledge/codecopy.git
# Variante 1: Kopiere das gesamte aktuelle Projekt (nur .py-Dateien)
from codecopy import copy_logic, copy_init
copy_logic(
project_name="MeinProjekt", # optional
project_path="Pfad/zum/Projekt", # optional
allowed_extensions=[".py"], # optional
exclude_dirs=[], # optional
exclude_files=["test_*.py", ".gitignore"], # optional
comment="Bitte refaktorieren und optimieren."
)
# Variante 2: Erstelle eine prompt_export-Vorlage im Projektordner
from codecopy import copy_logic, copy_init
copy_init(
project_path="Pfad/zum/Projekt",
filename="prompt_export.py",
overwrite=False
)
# Variante 3: Erstelle eine prompt_export-Vorlage mit Default-Werten
from codecopy import copy_init
copy_init()Dieses Projekt steht unter der MIT License. Siehe LICENSE für Details.