From d558959a20c54f9309899b06bf0e5a2200586202 Mon Sep 17 00:00:00 2001 From: Eli <43382407+eli64s@users.noreply.github.com> Date: Sat, 21 Oct 2023 23:25:57 -0500 Subject: [PATCH] fix: Handle local repo parsing error when path < 2 indexes. --- .gitignore | 2 +- README.md | 6 +- docs/README-de.md | 676 --------------------------- docs/README-fr.md | 648 ------------------------- docs/README-zh-CN.md | 636 ------------------------- docs/overview.md | 4 + pyproject.toml | 2 +- readmeai/services/version_control.py | 3 + readmeai/settings/config.toml | 2 +- 9 files changed, 13 insertions(+), 1966 deletions(-) delete mode 100644 docs/README-de.md delete mode 100644 docs/README-fr.md delete mode 100644 docs/README-zh-CN.md create mode 100644 docs/overview.md diff --git a/.gitignore b/.gitignore index cfc1a829..2a584a76 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,7 @@ notebooks/ .benchmarks/ # Other -docs/templates +docs/docs docs/notes examples/readme-edgecase.md readmeai/conf/templates diff --git a/README.md b/README.md index 0836e4e0..201abc44 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@
-[![CN](https://img.shields.io/badge/CN-🇨🇳-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-zh-CN.md) -[![DE](https://img.shields.io/badge/DE-🇩🇪-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-de.md) -[![FR](https://img.shields.io/badge/FR-🇫🇷-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-fr.md) +[![CN](https://img.shields.io/badge/CN-🇨🇳-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-zh-CN.md) +[![DE](https://img.shields.io/badge/DE-🇩🇪-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-de.md) +[![FR](https://img.shields.io/badge/FR-🇫🇷-white?style=plastic)](https://github.com/eli64s/readme-ai/blob/main/docs/README-fr.md)
diff --git a/docs/README-de.md b/docs/README-de.md deleted file mode 100644 index ecbfb045..00000000 --- a/docs/README-de.md +++ /dev/null @@ -1,676 +0,0 @@ -
-

- - -
README-AI -

-

◦ Erstellen Sie schöne und informative README-Dateien

-

◦ Entwickelt mit den GPT-Sprachmodell-APIs von OpenAI

-
-

- Markdown - OpenAI - Python - pytest - Docker - actions -

- - pypi-version - - - pypi-python-version - - commits-month - license -
-
- ---- - -## 📖 Inhaltsverzeichnis - -- [📖 Inhaltsverzeichnis](#-inhaltsverzeichnis) -- [🔭 Übersicht](#-übersicht) -- [🤖 Demos](#-demos) -- [💫 Funktionen](#-funktionen) -- [👩‍💻 Nutzung](#-nutzung) - - [📦 Installation](#-installation) - - [⚙️ Konfiguration](#️-konfiguration) - - [🚀 Ausführen von *README-AI*](#-ausführen-von-readme-ai) - - [🧪 Tests](#-tests) -- [🛠 Roadmap](#-roadmap) -- [📒 Changelog](#-changelog) -- [🤝 Mitwirken](#-mitwirken) -- [📄 Lizenz](#-lizenz) -- [👏 Danksagungen](#-danksagungen) - ---- - -## 🔭 Übersicht - -
- -
- - - - - -
- 👋 Über -

- README-AI ist ein Befehlszeilen-Tool, das robuste README.md-Dateien für Ihre Software- und Datenprojekte generiert. Indem Sie einfach eine Remote-Repository-URL oder einen Pfad zu Ihrer Codebasis angeben, generiert dieses Tool automatisch Dokumentation für Ihr gesamtes Projekt, indem es die Fähigkeiten der GPT-Sprachmodell-APIs von OpenAI nutzt. -

- 🎯 Motivationen -

- Vereinfacht den Prozess des Schreibens und Wartens von hochwertiger Projektdokumentation, verbessert die Produktivität und den Arbeitsablauf von Entwicklern. Das ultimative Ziel von readme-ai ist es, die Adoption und Benutzerfreundlichkeit von Open-Source-Software zu verbessern, sodass alle Kompetenzniveaus komplexe Codebasen besser verstehen und Open-Source-Tools einfach nutzen können. -

- ⚠️ Haftungsausschluss -

- Dieses Projekt befindet sich derzeit in der Entwicklung und hat eine meinungsbildende Konfiguration. Während readme-ai einen hervorragenden Ausgangspunkt für Dokumentationen bietet, ist es wichtig, alle vom OpenAI API generierten Texte zu überprüfen, um sicherzustellen, dass sie Ihre Codebasis genau darstellen. -
- ---- - -## 🤖 Demos - -***Befehlszeilen-Interface*** - -‣ Führen Sie readme-ai in Ihrem Terminal über PyPI, Docker und mehr aus! - -[cli-demo](https://github.com/eli64s/readme-ai/assets/43382407/645c2336-6ea7-444c-a927-5450930c5255) - -
- -***Streamlit Community Cloud*** - -‣ Nutzen Sie *readme-ai* direkt in Ihrem Browser! Keine Installation, kein Code! - -[streamlit-demo](https://github.com/eli64s/readme-ai/assets/43382407/e8260e78-b684-4e72-941c-b3046b90c452) - ---- - -## 💫 Funktionen - -
-
-
- - ❶ Shieldsio Abzeichen - - - - - - - - -
-

Projekt-Slogan und Abzeichen

-

- ‣ Ein Slogan, um Ihr Projekt hervorzuheben, wird durch das Prompting der OpenAI GPT-Engine generiert. -

-

- ‣ Codebase-Abhängigkeiten und Metadaten werden mit Shields.io-Abzeichen visualisiert. -

-
- badges -
- -

- ‣ Verwenden Sie die CLI-Option --badges, um den Stil der Abzeichen für Ihre README zu wählen! Aktuell werden 3 Stile unterstützt: -

- - - - - - - - - -
-

1. Standard Shieldsio-Abzeichenstil

-

Befehl: keiner, da es der Standardstil für readme-ai ist

-
- badges-shieldsio-default -
-
-

2. Shieldsio for-the-badge-Stil

-

Befehl: --badges shields

-
- badges-shieldsio-flat -
-
-

3. Quadratische iOS-Stil-Abzeichen

-

Befehl: --badges square

-
- badges-square -
-
-
-
-
-
-
- - ❷ Codebase Dokumentation - - - - - - - - - - - - -
-

Verzeichnisbaum und Dateizusammenfassungen

-
-

‣ Die Verzeichnisstruktur Ihres Projekts wird mit einer benutzerdefinierten Baumfunktion visualisiert.

-

‣ Jede Datei in der Codebase wird vom GPT-Modell von OpenAI zusammengefasst.

-
- repository-tree - - code-summaries -
-
-
-
-
-
- - ❸ Übersicht und Feature-Tabelle - - - - - - - - - - - - -
-

Ein strukturierter Überblick

-
-

readme-ai bietet Ihnen eine strukturierte Übersicht über die Hauptfunktionen Ihres Projekts, basierend auf Ihrem Code und den von Ihnen zur Verfügung gestellten Beschreibungen.

-
- overview - - features-table -
-
-
-
-
-
- - ❸ Übersicht und Eigenschaften Tabelle - - - - - - - - -
-

Gesteuerte Texterstellung

-

- ‣ Ein Überblicksabsatz und eine Eigenschaften-Tabelle werden mit detaillierten Aufforderungen, eingebettet mit Projekt-Metadaten, erstellt. -

-
- feature-table -
-
-
-
-
-
- - ❹ Dynamische Nutzungsanweisungen
-
- - - - - - - -
-

Installation, Ausführung und Test

-

- ‣ Erstellt Anweisungen für die Installation, Ausführung und das Testen Ihres Projekts. Die Anweisungen werden erstellt, indem die Hauptprogrammiersprache des Codebasis identifiziert und auf unsere language_setup.toml Konfigurationsdatei verwiesen wird. -

-
- usage-instructions -
-
-
-
-
-
- - ❺ Beitragsrichtlinien und mehr!
-
- - - - -
- - - -
- roadmap -
- license -
-
-
-
-
-
- - ❻ Vorlagen kommen bald
-
- - - - - - - -
-

‣ Entwicklung einer CLI-Option, die es den Benutzern ermöglicht, aus einer Vielzahl von README-Stilen auszuwählen

-

‣ Vorlagen für Anwendungsfälle wie Daten, maschinelles Lernen, Webentwicklung und mehr!

-
-

KI und ML README Vorlagenkonzept

-
    -
  • Übersicht: Zusammenfassung der Projektziele, des Umfangs und der erwarteten Ergebnisse.
  • -
  • Projektstruktur: Überblick über die Organisation der Projekte und ihre Hauptkomponenten.
  • -
  • Datenverarbeitung: Datenquellen, Sammlungsmethoden und Datentypen
  • -
  • Merkmalsentwicklung: Bedeutung der Merkmalsentwicklung und ihre Auswirkungen auf die Modellleistung.
  • -
  • Modellarchitektur und -entwicklung: Modellauswahl, Entwicklungsstrategien und implementierte Algorithmen.
  • -
  • Training und Validierung: Infos zu Modelltrainingsverfahren, Hyperparameter-Tuning und Validierungsstrategien.
  • -
  • Testen und Evaluierung: Modelltestergebnisse, Leistungsanalyse und Vergleich mit Benchmarks.
  • -
  • Deployment und Integration: Integration mit anderen Systemen, APIs und Benutzerschnittstellen
  • -
  • Nutzung und Wartung: Benutzerhandbuch zur Nutzung der bereitgestellten Modelle und Schnittstellen.
  • -
  • Ergebnisse und Diskussion: Implikationen, Einschränkungen und zukünftige Arbeit.
  • -
  • Ethische Überlegungen: Ethische Aspekte, Datenschutz und Fairness in Modellvorhersagen.
  • -
  • Mitwirken: Verfahren zur Einreichung von Beiträgen, Meldung von Problemen und Vorschlagen von Verbesserungen.
  • -
  • Danksagungen: Verweise auf genutzte Ressourcen, Bibliotheken und Frameworks.
  • -
  • Lizenz: Erläuterung der Nutzungsrechte, Einschränkungen und Anforderungen an die Zuschreibung.
  • -
-
-
-
-
-
-
- - ❼ Beispiel README-Dateien
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AusgabedateiRepositorySprachen
1️⃣readme-python.mdreadme-aiPython
2️⃣readme-typescript.mdchatgpt-app-react-typescriptTypeScript, React
3️⃣readme-javascript.mdassistant-chat-gpt-javascriptJavaScript, React
4️⃣readme-kotlin.mdfile.io-android-clientKotlin, Java, Android
5️⃣readme-rust-c.mdrust-c-appC, Rust
6️⃣readme-go.mdgo-docker-appGo
7️⃣readme-java.mdjava-minimal-todoJava
8️⃣readme-fastapi-redis.mdasync-ml-inferencePython, FastAPI, Redis
9️⃣readme-mlops.mdmlops-coursePython, Jupyter
🔟readme-pyflink.mdflink-flowPyFlink
-
-
-
- -

- 🔝 Zurück -

- ---- - -## 👩‍💻 Nutzung - -***Abhängigkeiten*** - -Bitte stellen Sie sicher, dass die folgenden Abhängigkeiten auf Ihrem System installiert sind: - -- *Python-Version 3.9 oder höher* -- *Paket-Manager (z.B. pip, conda, poetry) oder Docker* -- *OpenAI API bezahlter Account und API-Schlüssel* - -
- -***Repository*** - -Eine Remote-Repository-URL oder ein lokaler Verzeichnispfad zu Ihrem Projekt ist erforderlich, um *readme-ai* zu verwenden. Die folgenden Plattformen werden derzeit unterstützt: -- *GitHub* -- *GitLab* -- *Bitbucket* -- *Dateisystem* - -
- -***OpenAI API*** - -Ein OpenAI-API-Konto und ein API-Schlüssel werden benötigt, um *readme-ai* zu verwenden. Die unten stehenden Schritte beschreiben diesen Prozess: - -
🔐 OpenAI API - Einrichtungsanweisungen - -1. Besuchen Sie die [OpenAI-Website](https://platform.openai.com/). -2. Klicken Sie auf den Button "Sign up for free". -3. Füllen Sie das Registrierungsformular mit Ihren Informationen aus und stimmen Sie den Nutzungsbedingungen zu. -4. Nach dem Einloggen klicken Sie auf den "API"-Tab. -5. Befolgen Sie die Anweisungen zur Erstellung eines neuen API-Schlüssels. -6. Kopieren Sie den API-Schlüssel und bewahren Sie ihn an einem sicheren Ort auf. - -
- -
⚠️ OpenAI API - Vorsichtsrichtlinien - -1. **Überprüfung sensitiver Informationen**: Stellen Sie vor dem Ausführen der Anwendung sicher, dass alle Inhalte in Ihrem Repository frei von sensiblen Informationen sind. Beachten Sie, dass *readme-ai* keine sensiblen Daten aus der README-Datei filtert und keine Dateien in Ihrem Repository ändert. - -2. **API-Nutzungskosten**: Die OpenAI API ist nicht kostenlos, und für jede gestellte Anfrage fallen Gebühren an. Die Kosten können sich schnell summieren, daher ist es wichtig, sich Ihrer Nutzung bewusst zu sein. Sie können Ihre API-Nutzung und die damit verbundenen Kosten überprüfen, indem Sie das [OpenAI API-Nutzungs-Dashboard](https://platform.openai.com/account/usage) besuchen. - -3. **Bezahlter Account empfohlen**: Es wird dringend empfohlen, ein bezahltes Konto bei OpenAI einzurichten, um mögliche Probleme zu vermeiden. Ohne hinterlegte Zahlungsmethode wird Ihre API-Nutzung auf die Grundmodelle von GPT-3 beschränkt. Diese Einschränkung kann zu einer weniger genauen README-Dateierstellung führen und aufgrund von Anfragebeschränkungen zu API-Fehlern führen. - -4. **Laufzeitüberlegungen**: Die Erstellung einer README-Datei dauert in der Regel weniger als eine Minute. Wenn der Prozess ein paar Minuten (z.B., 3 Minuten) überschreitet, ist es ratsam, *readme-ai* zu beenden, um längere Verarbeitungszeiten zu vermeiden. - -
- ---- - -### 📦 Installation - -***Mit Pip*** - -Pip ist die empfohlene Installationsmethode für die meisten Nutzer. - -```sh -pip install readmeai -``` -
- -***Mit Docker*** - -Docker wird für Benutzer empfohlen, die die Anwendung in einer containerisierten Umgebung ausführen möchten. - -```sh -docker pull zeroxeli/readme-ai:latest -``` - -
- -***Manuell*** - -1️⃣ Klone das readme-ai Repository. -```sh -git clone https://github.com/eli64s/readme-ai -``` - -2️⃣ Navigiere zum readme-ai Verzeichnis. - -```sh -cd readme-ai -``` - -3️⃣ Installiere die Abhängigkeiten mit einer der unten stehenden Methoden. - -***Mit Bash*** -```sh -bash setup/setup.sh -``` - -***Mit Conda*** -```sh -conda create -n readmeai python=3.9 -y && \ -conda activate readmeai && \ -pip install -r requirements.txt -``` - -***Mit Poetry*** -```sh -poetry shell && \ -poetry install -``` - ---- - -### ⚙️ Konfiguration - -
- -***Befehlszeilenargumente*** - -Um eine *README.md* Datei zu generieren, verwenden Sie den Befehl `readmeai` in Ihrem Terminal zusammen mit den unten aufgeführten Argumenten. - -| Kurzflag | Langflag | Beschreibung | Status | -|----------|----------------|-----------------------------------------------------|--------------| -| `-k` | `--api-key` | Ihr API-Geheim-Schlüssel für das Sprachmodell. | Optional | -| `-b` | `--badges` | Wählen Sie 'shields' oder 'square', um den Badge-Stil zu ändern. | Optional | -| `-f` | `--offline-mode`| Laufen Sie offline, ohne die OpenAI API aufzurufen. | Optional | -| `-m` | `--model` | Großes Sprachmodell-Motor (gpt-3.5-turbo) | Optional | -| `-o` | `--output` | Der Ausgabepfad für Ihre README.md-Datei. | Optional | -| `-r` | `--repository` | Die URL oder der Pfad zu Ihrem Code-Repository. | Erforderlich | -| `-t` | `--temperature`| Die Temperatur (Zufälligkeit) des Modells. | Optional | -| `-l` | `--language` | Die Sprache, in der die README geschrieben werden soll. | In Kürze verfügbar! | -| `-s` | `--style` | Der zu erstellende README-Template-Stil. | In Kürze verfügbar! | - -
- -***Benutzerdefinierte Einstellungen*** - -Um den README-Dateierstellungsprozess anzupassen, können Sie die [Konfigurationsdatei](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml) des Projekts modifizieren: - -- [*api*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L2) - OpenAI Sprachmodell API Konfigurationseinstellungen. -- [*git*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L12) - Standard Git Repository-Einstellungen, die verwendet werden, wenn kein Repository bereitgestellt wird. -- [*paths*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L17) - Verzeichnispfade und Dateien, die von der *readme-ai* Anwendung genutzt werden. -- [*prompts*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L26) - Aufforderungen des großen Sprachmodells, die zur Erstellung der README-Datei verwendet werden. -- [*md*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L59) - Dynamische Markdown-Sektion Code-Templates, die zum Erstellen der README-Datei verwendet werden. - ---- - -### 🚀 Ausführen von *README-AI* - -***Mit Pip*** - -```sh -# Option 1: Führe den readmeai Befehl mit allen erforderlichen Befehlszeilenargumenten aus. -readmeai --api-key "YOUR_API_KEY" --output readme-ai.md --repository https://github.com/eli64s/readme-ai -``` -```sh -# Option 2: Führe den readmeai Befehl mit OpenAI API Schlüssel als Umgebungsvariable aus. -export OPENAI_API_KEY="YOUR_API_KEY" -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -b shields -``` - -
- -***Mit Docker*** - -```sh -# Option 1: Führe Docker-Container mit allen erforderlichen Befehlszeilenargumenten aus. -docker run -it \ --e OPENAI_API_KEY="YOUR_API_KEY" \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` -```sh -# Option 2: Führe Docker-Container mit OpenAI API Schlüssel als Umgebungsvariable aus. -export OPENAI_API_KEY="YOUR_API_KEY" -docker run -it \ --e OPENAI_API_KEY=$OPENAI_API_KEY \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Mit Conda*** -```sh -conda activate readmeai -export OPENAI_API_KEY="YOUR_API_KEY" -python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Mit Poetry*** -```sh -poetry shell -export OPENAI_API_KEY="YOUR_API_KEY" -poetry run python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Mit Streamlit*** - -Verwenden Sie die App direkt in Ihrem Browser über Streamlit Community Cloud. - -- [🛸 Bring mich zu *readme-ai* auf Streamlit!](https://readmeai.streamlit.app/) - ---- - -### 🧪 Tests - -Führen Sie die Testsuite mit dem unten stehenden Befehl aus. - -```sh -bash scripts/test.sh -``` - ---- - -## 🛠 Roadmap - -- [X] Projekt als Python-Bibliothek über PyPI für eine einfache Installation veröffentlichen. - - [*PyPI - readmeai*](https://pypi.org/project/readmeai/) -- [X] Projekt als Docker-Image auf Docker Hub verfügbar machen. - - [*Docker Hub - readme-ai*](https://hub.docker.com/repository/docker/zeroxeli/readme-ai/general) -- [X] App mit Streamlit integrieren und bereitstellen, um das Tool breiter zugänglich zu machen. - - [*Streamlit Community Cloud - readmeai*](https://readmeai.streamlit.app/) -- [ ] Unsere große Sprachmodell-Engine überarbeiten, um eine robustere README-Erzeugung zu ermöglichen. - - [ ] Erkunden von [LangChain 🦜️🔗](https://python.langchain.com/docs/get_started/introduction) als Alternative zur direkten Verwendung der OpenAI API. - - [ ] Erkunden des [LlamaIndex 🦙](https://gpt-index.readthedocs.io/en/stable/index.html) Frameworks und des Retrieval augmented generation (RAG) Paradigmas. -- [ ] Unterstützung für die Erstellung von README-Dateien in jeder Sprache hinzufügen (d.h. CN, ES, FR, JA, KO, RU). -- [ ] README-Ausgabevorlagen für eine Vielzahl von Anwendungsfällen entwerfen (d.h. Daten, Web-Entwicklung, minimal, etc.) -- [ ] Ein GitHub Actions Skript entwickeln, um die README-Datei automatisch zu aktualisieren, wenn neuer Code gepusht wird. - ---- - -## 📒 Changelog - -[Änderungsprotokoll](https://github.com/eli64s/readme-ai/blob/main/CHANGELOG.md) - ---- - -## 🤝 Mitwirken - -Möchten Sie zu *readme-ai* beitragen? Hier finden Sie, wie Sie helfen können: - -- 🐍 Suchen Sie nach Möglichkeiten, den Code effizienter und lesbarer zu machen. -- 🤖 Ausnahmehandhabung und Fehlerbehebungen sind immer willkommen! -- 📝 Verbessern Sie die Dokumentation und fügen Sie dem README mehr Beispiele hinzu. -- 🔡 Fügen Sie Unterstützung für die Erstellung von README-Dateien in jeder Sprache hinzu (d.h. CN, ES, FR, JA, KO, RU). -- 🎨 Erstellen Sie neue Vorlagen für verschiedene Anwendungsfälle (d.h. Daten, Web-Entwicklung, minimal, etc.). - - Das README wird in Abschnitten erstellt, die in der [config.toml]-Datei definiert sind. - - Folgen Sie dem vorhandenen Format, um zu beginnen. - -[Beitrags - -richtlinien](https://github.com/eli64s/readme-ai/blob/main/CONTRIBUTING.md) - ---- - -## 📄 Lizenz - -[MIT](https://github.com/eli64s/readme-ai/blob/main/LICENSE) - ---- - -## 👏 Danksagungen - -*Abzeichen Icons* - - [Shields.io](https://shields.io/) - - [Aveek-Saha/GitHub-Profile-Badges](https://github.com/Aveek-Saha/GitHub-Profile-Badges) - - [Ileriayo/Markdown-Badges](https://github.com/Ileriayo/markdown-badges) - - [tandpfun/skill-icons](https://github.com/tandpfun/skill-icons) - - -

- 🔝 Zurück -

- ---- diff --git a/docs/README-fr.md b/docs/README-fr.md deleted file mode 100644 index b1af9d1d..00000000 --- a/docs/README-fr.md +++ /dev/null @@ -1,648 +0,0 @@ -
-

- - -
README-AI -

-

◦ Générez de beaux et informatifs fichiers README

-

◦ Développé avec les APIs du modèle linguistique GPT d'OpenAI

-
-

- Markdown - OpenAI - Python - pytest - Docker - actions -

- - version-pypi - - - version-python-pypi - - - téléchargements-pypi - - licence-github -
- ---- - -## 📖 Sommaire - -- [📖 Sommaire](#-sommaire) -- [🔭 Aperçu](#-aperçu) -- [🤖 Démos](#-démos) -- [💫 Fonctionnalités](#-fonctionnalités) -- [👩‍💻 Utilisation](#-utilisation) - - [📦 Installation](#-installation) - - [⚙️ Configuration](#️-configuration) - - [Arguments de Ligne de Commande](#arguments-de-ligne-de-commande) - - [Paramètres Personnalisés](#paramètres-personnalisés) - - [🚀 Exécution de *README-AI*](#-exécution-de-readme-ai) - - [🧪 Tests](#-tests) - - [🛠 Feuille de Route](#-feuille-de-route) -- [📒 Journal des Modifications](#-journal-des-modifications) -- [🤝 Contribuer](#-contribuer) -- [📄 Licence](#-licence) -- [👏 Remerciements](#-remerciements) - ---- - -## 🔭 Aperçu - -
- -
- - - - - -
- 👋 À Propos -

- README-AI est un outil en ligne de commande qui génère des fichiers README.md robustes pour vos projets logiciels et de données. En fournissant simplement une URL de dépôt distant ou un chemin vers votre base de code, cet outil génère automatiquement la documentation pour l'ensemble de votre projet, en exploitant les capacités des APIs du modèle linguistique GPT d'OpenAI. -

- 🎯 Motivations -

- Simplifie le processus de rédaction et de maintenance d'une documentation de projet de haute qualité, améliorant ainsi la productivité et le flux de travail des développeurs. L'objectif ultime de readme-ai est d'améliorer l'adoption et l'utilisabilité des logiciels open source, permettant à tous les niveaux de compétence de mieux comprendre les bases de code complexes et d'utiliser facilement les outils open source. -

- ⚠️ Avertissement -

- Ce projet est actuellement en cours de développement et dispose d'une configuration orientée. Bien que readme-ai offre un excellent point de départ pour la documentation, il est important de réviser tout le texte généré par l'API OpenAI pour s'assurer qu'il représente avec précision votre base de code. -
- ---- - -## 🤖 Démos - -***Interface en Ligne de Commande*** - -‣ Exécutez readme-ai dans votre terminal via PyPI, Docker, et plus encore ! - -[cli-demo](https://github.com/eli64s/readme-ai/assets/43382407/645c2336-6ea7-444c-a927-5450930c5255) - -
- -***Streamlit Community Cloud*** - -‣ Utilisez *readme-ai* directement dans votre navigateur ! Aucune installation, aucun code ! - -[streamlit-demo](https://github.com/eli64s/readme-ai/assets/43382407/e8260e78-b684-4e72-941c-b3046b90c452) - ---- - -## 💫 Fonctionnalités - -
-
- - ❶ Badges Shieldsio - - - - - - - - -
-

Slogan du Projet et Badges

-

- ‣ Un slogan pour mettre en valeur votre projet est généré en interrogeant le moteur GPT d'OpenAI. -

-

- ‣ Les dépendances et métadonnées de la base de code sont visualisées à l'aide de badges Shields.io. -

-
- badges -
- -

- ‣ Utilisez l'option CLI --badges pour sélectionner le style de badges pour votre README ! 3 styles sont actuellement pris en charge : -

- - - - - - - - - -
-

1. Style de badge Shieldsio par défaut

-

Commande : aucune car c'est le style par défaut pour readme-ai

-
- badges-shieldsio-default -
-
-

2. Style Shieldsio for-the-badge

-

Commande : --badges shields

-
- badges-shieldsio-flat -
-
-

3. Badges de style carré iOS

-

Commande : --badges square

-
- badges-square -
-
-
-
-
-
-
- - ❷ Documentation de la Base de Code - - - - - - - - - - - - -
-

Arborescence des Répertoires et Résumés des Fichiers

-
-

‣ La structure de répertoire de votre projet est visualisée à l'aide d'une fonction d'arborescence personnalisée.

-

‣ Chaque fichier de la base de code est résumé par le modèle GPT d'OpenAI.

-
- repository-tree - - code-summaries -
-
-
-
-
-
- - ❸ Aperçu et Tableau des Fonctionnalités - - - - - - - - -
-

Génération de Texte sur Demande

-

- ‣ Un paragraphe d'aperçu et un tableau de fonctionnalités sont générés en utilisant des demandes détaillées, intégrées avec les métadonnées du projet. -

-
- feature-table -
-
-
-
-
-
- - ❹ Instructions d'Utilisation Dynamiques
-
- - - - - - - -
-

Installation, Exécution, et Test

-

- ‣ Génère des instructions pour installer, exécuter, et tester votre projet. Les instructions sont créées en identifiant le langage principal de la base de code et en se référant à notre fichier de configuration language_setup.toml. -

-
- usage-instructions -
-
-
-
-
-
- - ❺ Directives de Contribution et plus encore !
-
- - - - -
- - - -
- roadmap -
- license -
-
-
-
-
-
- - ❻ Modèles à Venir
-
- - - - - - - -
-

‣ Développement d'une option CLI permettant aux utilisateurs de sélectionner parmi une variété de styles de README

-

‣ Modèles pour des cas d'utilisation tels que les données, l'apprentissage automatique, le développement web, et plus encore !

-
-

Concept de Modèle de README pour IA et ML

- -
-
-
-
-
-
- - ❼ Exemples de fichiers README
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Fichier de sortieRéférentielLangages
1️⃣readme-python.mdreadme-aiPython
2️⃣readme-typescript.mdchatgpt-app-react-typescriptTypeScript, React
3️⃣readme-javascript.mdassistant-chat-gpt-javascriptJavaScript, React
4️⃣readme-kotlin.mdfile.io-android-clientKotlin, Java, Android
5️⃣readme-rust-c.mdrust-c-appC, Rust
6️⃣readme-go.mdgo-docker-appGo
7️⃣readme-java.mdjava-minimal-todoJava
8️⃣readme-fastapi-redis.mdasync-ml-inferencePython, FastAPI, Redis
9️⃣readme-mlops.mdmlops-coursePython, Jupyter
🔟readme-pyflink.mdflink-flowPyFlink
-
-
-
- -

- 🔝 Retour -

- ---- - -## 👩‍💻 Utilisation - -***Dépendances*** - -Assurez-vous d'avoir installé les dépendances suivantes sur votre système : - -- *Python version 3.9 ou supérieure* -- *Gestionnaire de paquets (i.e. pip, conda, poetry) ou Docker* -- *Compte payant OpenAI API et clé API* - -
- -***Dépôt*** - -Un URL de dépôt distant ou un chemin de répertoire local vers votre projet est nécessaire pour utiliser *readme-ai*. Les plateformes suivantes sont actuellement prises en charge : -- *GitHub* -- *GitLab* -- *Bitbucket* -- *Système de fichiers* - -
- -***OpenAI API*** - -Un compte OpenAI API et une clé API sont nécessaires pour utiliser *readme-ai*. Les étapes ci-dessous décrivent ce processus : - -
🔐 OpenAI API - Instructions de configuration - -1. Rendez-vous sur le [site OpenAI](https://platform.openai.com/). -2. Cliquez sur le bouton "Sign up for free". -3. Remplissez le formulaire d'inscription avec vos informations et acceptez les conditions d'utilisation. -4. Une fois connecté, cliquez sur l'onglet "API". -5. Suivez les instructions pour créer une nouvelle clé API. -6. Copiez la clé API et conservez-la dans un endroit sûr. - -
- -
⚠️ OpenAI API - Directives de prudence - -1. **Réviser les informations sensibles** : Avant d'exécuter l'application, assurez-vous que tout le contenu de votre dépôt est exempt d'informations sensibles. Notez que *readme-ai* ne filtre pas les données sensibles du fichier README et ne modifie aucun fichier dans votre dépôt. - -2. **Coûts d'utilisation de l'API** : L'API OpenAI n'est pas gratuite, et chaque requête effectuée vous sera facturée. Les coûts peuvent s'accumuler rapidement, il est donc essentiel d'être conscient de votre utilisation. Vous pouvez surveiller votre utilisation de l'API et les coûts associés en visitant le [Tableau de bord d'utilisation de l'API OpenAI](https://platform.openai.com/account/usage). - -3. **Compte payant recommandé** : Il est fortement recommandé de configurer un compte payant avec OpenAI pour éviter d'éventuels problèmes. Sans méthode de paiement enregistrée, votre utilisation de l'API sera limitée aux modèles de base GPT-3. Cette limitation peut entraîner une génération de fichiers README moins précise et peut conduire à des erreurs d'API en raison de limites de requêtes. - -4. **Considérations sur le temps d'exécution** : La génération du fichier README prend généralement moins d'une minute. Si le processus dépasse quelques minutes (par exemple, 3 minutes), il est conseillé de terminer *readme-ai* pour éviter des temps de traitement prolongés. - -
- ---- - -### 📦 Installation - -***Utilisation de Pip*** - -Pip est la méthode d'installation recommandée pour la plupart des utilisateurs. - -```sh -pip install readmeai -``` -
- -***Utilisation de Docker*** - -Docker est recommandé pour les utilisateurs souhaitant exécuter l'application dans un environnement conteneurisé. - -```sh -docker pull zeroxeli/readme-ai:latest -``` - -
- -***Manuellement*** - -1️⃣ Clonez le dépôt readme-ai. -```sh -git clone https://github.com/eli64s/readme-ai -``` - -2️⃣ Naviguez vers le répertoire readme-ai. - -```sh -cd readme-ai -``` - -3️⃣ Installez les dépendances en utilisant une méthode ci-dessous. - -***Utilisation de Bash*** -```sh -bash setup/setup.sh -``` - -***Utilisation de Conda*** -```sh -conda create -n readmeai python=3.9 -y && \ -conda activate readmeai && \ -pip install -r requirements.txt -``` - -***Utilisation de Poetry*** -```sh -poetry shell && \ -poetry install -``` - ---- - -### ⚙️ Configuration - -
- -### Arguments de Ligne de Commande - -Pour générer un fichier *README.md*, utilisez la commande `readmeai` dans votre terminal, accompagnée des arguments ci-dessous. - -| Argument Court | Argument Long | Description | Statut | -|----------------|---------------|-----------------------------------------------------|--------------| -| `-k` | `--api-key` | Votre clé secrète d'API pour le modèle de langage. | Optionnel | -| `-b` | `--badges` | Choisissez 'shields' ou 'square' pour changer le style des badges. | Optionnel | -| `-f` | `--offline-mode`| Exécutez en mode hors ligne sans appeler l'API OpenAI. | Optionnel | -| `-m` | `--model` | Moteur de grand modèle de langage (gpt-3.5-turbo). | Optionnel | -| `-o` | `--output` | Le chemin de sortie pour votre fichier README.md. | Optionnel | -| `-r` | `--repository`| L'URL ou le chemin vers votre dépôt de code. | Requis | -| `-t` | `--temperature`| La "température" (aléatoire) du modèle. | Optionnel | -| `-l` | `--language` | La langue dans laquelle rédiger le README. | Bientôt disponible ! | -| `-s` | `--style` | Le style du modèle README à construire. | Bientôt disponible ! | - -
- -### Paramètres Personnalisés - -Pour personnaliser le processus de génération du fichier README, vous pouvez modifier le [fichier de configuration](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml) du projet : - -- [*api*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L2) - Paramètres de configuration de l'API du modèle de langage OpenAI. -- [*git*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L12) - Paramètres du dépôt git par défaut utilisés si aucun dépôt n'est fourni. -- [*paths*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L17) - Chemins des répertoires et fichiers utilisés par l'application *readme-ai*. -- [*prompts*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L26) - Invitations du grand modèle de langage utilisées pour générer le fichier README. -- [*md*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L59) - Modèles de code de section Markdown dynamiques utilisés pour construire le fichier README. - ---- - -### 🚀 Exécution de *README-AI* - -***Utilisation avec Pip*** - -```sh -# Option 1 : Exécutez la commande readmeai avec tous les arguments requis. -readmeai --api-key "VOTRE_CLÉ_API" --output readme-ai.md --repository https://github.com/eli64s/readme-ai -``` -```sh -# Option 2 : Exécutez la commande readmeai avec la clé API OpenAI définie comme variable d'environnement. -export OPENAI_API_KEY="VOTRE_CLÉ_API" -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -b shields -``` - -
- -***Utilisation avec Docker*** - -```sh -# Option 1 : Exécutez le conteneur Docker avec tous les arguments requis. -docker run -it \ --e OPENAI_API_KEY="VOTRE_CLÉ_API" \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` -```sh -# Option 2 : Exécutez le conteneur Docker avec la clé API OpenAI définie comme variable d'environnement. -export OPENAI_API_KEY="VOTRE_CLÉ_API" -docker run -it \ --e OPENAI_API_KEY=$OPENAI_API_KEY \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Utilisation avec Conda*** -```sh -conda activate readmeai -export OPENAI_API_KEY="VOTRE_CLÉ_API" -python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Utilisation avec Poetry*** -```sh -poetry shell -export OPENAI_API_KEY="VOTRE_CLÉ_API" -poetry run python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***Utilisation avec Streamlit*** - -Utilisez l'application directement dans votre navigateur via Streamlit Community Cloud. - -- [🛸 Emmenez-moi vers *readme-ai* sur Streamlit !](https://readmeai.streamlit.app/) - ---- - -### 🧪 Tests - -Exécutez la suite de tests en utilisant la commande ci-dessous. - -```sh -bash scripts/test.sh -``` - ---- - -### 🛠 Feuille de Route - -- [X] Publier le projet en tant que bibliothèque Python via PyPI pour faciliter l'installation. - - [*PyPI - readmeai*](https://pypi.org/project/readmeai/) -- [X] Rendre le projet disponible en tant qu'image Docker sur Docker Hub. - - [*Docker Hub - readme-ai*](https://hub.docker.com/repository/docker/zeroxeli/readme-ai/general) -- [X] Intégrer et déployer l'application avec Streamlit pour la rendre plus largement accessible. - - [*Streamlit Community Cloud - readmeai*](https://readmeai.streamlit.app/) -- [ ] Remanier notre moteur de grand modèle de langage pour permettre une génération de README plus robuste. - - [ ] Explorer [LangChain 🦜️🔗](https://python.langchain.com/docs/get_started/introduction) comme alternative à l'utilisation directe de l'API OpenAI. - - [ ] Explorer le framework [LlamaIndex 🦙](https://gpt-index.readthedocs.io/en/stable/index.html) et le paradigme de génération augmentée par récupération (RAG). -- [ ] Ajouter le support pour générer des fichiers README dans toutes les langues (par ex. CN, ES, FR, JA, KO, RU). -- [ ] Concevoir des modèles de sortie README pour une variété de cas d'utilisation (par ex. données, développement web, minimal, etc.) -- [ ] Développer un script GitHub Actions pour mettre à jour automatiquement le fichier README lorsqu'un nouveau code est poussé. - ---- - -## 📒 Journal des Modifications - -[Journal des Modifications](https://github.com/eli64s/readme-ai/blob/main/CHANGELOG.md) - ---- - -## 🤝 Contribuer - -Vous souhaitez contribuer à *readme-ai* ? Voici ce que vous pouvez faire pour aider : - -- 🐍 Recherchez des opportunités pour rendre le code plus efficace et lisible. -- 🤖 La gestion des exceptions et les corrections de bugs sont toujours les bienvenues ! -- 📝 Améliorez la documentation et ajoutez plus d'exemples au README. -- 🔡 Ajoutez le support pour générer des fichiers README dans toutes les langues (par exemple CN, ES, FR, JA, KO, RU). -- 🎨 Créez de nouveaux modèles pour différents cas d'utilisation (c'est-à-dire données, développement web, minimal, etc.). - - Le README est construit en sections, définies dans le fichier [config.toml]. - - Suivez le format existant pour commencer. - -[Directives pour Contribuer](https://github.com/eli64s/readme-ai/blob/main/CONTRIBUTING.md) - ---- - -## 📄 Licence - -[MIT](https://github.com/eli64s/readme-ai/blob/main/LICENSE) - ---- - -## 👏 Remerciements - -*Icones de Badges* - - [Shields.io](https://shields.io/) - - [Aveek-Saha/GitHub-Profile-Badges](https://github.com/Aveek-Saha/GitHub-Profile-Badges) - - [Ileriayo/Markdown-Badges](https://github.com/Ileriayo/markdown-badges) - - [tandpfun/skill-icons](https://github.com/tandpfun/skill-icons) - - -

- 🔝 Retour -

- ---- diff --git a/docs/README-zh-CN.md b/docs/README-zh-CN.md deleted file mode 100644 index c24a71b4..00000000 --- a/docs/README-zh-CN.md +++ /dev/null @@ -1,636 +0,0 @@ -
-

- - -
README-AI -

-

◦ 生成美观且内容丰富的 README 文件

-

◦ 使用 OpenAI 的 GPT 语言模型 API 开发

-
-

- Markdown - OpenAI - Python - pytest - Docker - actions -

- - pypi-version - - - pypi-python-version - - - pypi-downloads - - github-license -
- ---- - -## 📖 目录 - -- [📖 目录](#-目录) -- [🔭 概述](#-概述) -- [🤖 演示](#-演示) -- [💫 特性](#-特性) -- [👩‍💻 使用](#-使用) - - [📦 安装](#-安装) - - [⚙️ 配置](#️-配置) - - [🚀 运行 *README-AI*](#-运行-readme-ai) - - [🧪 测试](#-测试) -- [🛠 路线图](#-路线图) -- [📒 更新日志](#-更新日志) -- [🤝 贡献](#-贡献) -- [📄 许可](#-许可) -- [👏 鸣谢](#-鸣谢) - ---- - -## 🔭 概述 - -
- -
- - - - - -
- 👋 关于 -

- README-AI 是一个命令行工具,为您的软件和数据项目生成健壮的 README.md 文件。只需提供一个远程仓库 URL 或代码库路径,该工具就会利用 OpenAI 的 GPT 语言模型 API 自动为整个项目生成文档。 -

- 🎯 动机 -

- 简化编写和维护高质量项目文档的过程,增强开发者的生产力和工作流。 readme-ai 的最终目标是提高开源软件的采纳和可用性,使所有技能水平的人更好地理解复杂的代码库,并轻松使用开源工具。 -

- ⚠️ 免责声明 -

- 该项目目前正在开发中,并且具有自定的配置。虽然 readme-ai 为文档提供了一个极好的起点,但重要的是要检查 OpenAI API 生成的所有文本,以确保它准确代表您的代码库。 -
- ---- - -## 🤖 演示 - -***命令行界面*** - -‣ 通过 PyPI、Docker 等在终端中运行 readme-ai! - -[cli-demo](https://github.com/eli64s/readme-ai/assets/43382407/645c2336-6ea7-444c-a927-5450930c5255) - -
- -***Streamlit 社区云*** - -‣ 直接在浏览器中使用 *readme-ai*!零安装,零代码! - -[streamlit-demo](https://github.com/eli64s/readme-ai/assets/43382407/e8260e78-b684-4e72-941c-b3046b90c452) - ---- - -## 💫 特性 - -
-
- - ❶ Shieldsio 徽章 - - - - - - - - -
-

项目标语和徽章

-

- ‣ 项目的标语由提示 OpenAI 的 GPT 引擎生成。 -

-

- ‣ 使用Shields.io徽章可视化代码库的依赖项和元数据。 -

-
- badges -
- -

- ‣ 使用 CLI 选项 --badges 来为你的 README 选择徽章样式!目前支持 3 种样式: -

- - - - - - - - - -
-

1. Shieldsio 默认徽章样式

-

命令:none,因为它是 readme-ai 的默认样式

-
- badges-shieldsio-default -
-
-

2. Shieldsio for-the-badge 样式

-

命令: --badges shields

-
- badges-shieldsio-flat -
-
-

3. 方形 iOS 样式 徽章

-

命令: --badges square

-
- badges-square -
-
-
-
-
-
-
- - ❷ 代码库文档 - - - - - - - - - - - - -
-

目录树和文件摘要

-
-

‣ 使用自定义树函数可视化你的项目目录结构。

-

‣ OpenAI 的 GPT 模型总结了代码库中的每个文件。

-
- repository-tree - - code-summaries -
-
-
-
-
-
- - ❸ 概览和特性表格 - - - - - - - - -
-

提示文本生成

-

- ‣ 使用详细提示生成概览段落和特性表格,并嵌入项目元数据。 -

-
- feature-table -
-
-
-
-
-
- - ❹ 动态使用说明
-
- - - - - - - -
-

安装、运行和测试

-

- ‣ 生成有关安装、运行和测试项目的说明。说明是通过识别代码库的主要语言并参考我们的language_setup.toml配置文件创建的。 -

-
- usage-instructions -
-
-
-
-
-
- - ❺ 贡献指南等更多!
-
- - - - - - - -
- roadmap -
- license -
-
-
-
-
-
- - ❻ 即将推出的模板
-
- - - - - - - -
-

‣ 开发CLI选项,允许用户从多种README样式中进行选择

-

‣ 针对数据、机器学习、网络开发等用例的模板!

-
-

AI和ML README模板概念

-
    -
  • 概览:项目目标、范围和预期结果的总结。
  • -
  • 项目结构:项目组织的概览及其主要组件。
  • -
  • 数据预处理:数据来源、收集方法和数据类型
  • - -
  • 贡献:提交贡献、报告问题和提出增强功能的程序。
  • -
  • 致谢:用到的资源、库和框架的引用。
  • -
  • 许可:使用权、限制和属性要求的说明。
  • -
-
-
-
-
-
-
- - ❼ 示例README文件
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
输出文件仓库语言
1️⃣readme-python.mdreadme-aiPython
2️⃣readme-typescript.mdchatgpt-app-react-typescriptTypeScript, React
3️⃣readme-javascript.mdassistant-chat-gpt-javascriptJavaScript, React
4️⃣readme-kotlin.mdfile.io-android-clientKotlin, Java, Android
5️⃣readme-rust-c.mdrust-c-appC, Rust
6️⃣readme-go.mdgo-docker-appGo
7️⃣readme-java.mdjava-minimal-todoJava
8️⃣readme-fastapi-redis.mdasync-ml-inferencePython, FastAPI, Redis
9️⃣readme-mlops.mdmlops-coursePython, Jupyter
🔟readme-pyflink.mdflink-flowPyFlink
-
- -

- 🔝 返回 -

- ---- - -## 👩‍💻 使用 - -***依赖项*** - -请确保您的系统已安装以下依赖项: - -- *Python 版本 3.9 或更高* -- *包管理器(例如 pip、conda、poetry)或 Docker* -- *OpenAI API 付费帐户和 API 密钥* - -
- -***仓库*** - -您需要将远程仓库 URL 或项目的本地目录路径提供给 *readme-ai* 以进行使用。目前支持以下平台: -- *GitHub* -- *GitLab* -- *Bitbucket* -- *文件系统* - -
- -***OpenAI API*** - -使用 *readme-ai* 需要 OpenAI API 帐户和 API 密钥。下面的步骤概述了此过程: - -
🔐 OpenAI API - 设置指南 - -1. 访问 [OpenAI 网站](https://platform.openai.com/)。 -2. 点击“免费注册”按钮。 -3. 使用您的信息填写注册表格,并同意服务条款。 -4. 登录后,点击“API”选项卡。 -5. 按照指示创建新的 API 密钥。 -6. 复制 API 密钥并将其保存在一个安全的地方。 - -
- -
⚠️ OpenAI API - 注意指南 - -1. **查看敏感信息**:在运行应用程序之前,请确保您的仓库中的所有内容均不包含敏感信息。请注意,*readme-ai* 不会从 README 文件中过滤出敏感数据,也不会修改您仓库中的任何文件。 - -2. **API 使用成本**:OpenAI API 不是免费的,您将为每个发出的请求付费。成本可能迅速累积,因此重要的是要了解您的使用情况。您可以通过访问 [OpenAI API 使用仪表板](https://platform.openai.com/account/usage) 来监控您的 API 使用情况和相关成本。 - -3. **推荐使用付费帐户**:强烈建议您设置 OpenAI 的付费帐户,以避免可能出现的问题。如果您的文件中没有支付方式,您的 API 使用将受限于基础 GPT-3 模型。这种限制可能导致生成的 README 文件的准确度较低,并可能由于请求限制而导致 API 错误。 - -4. **运行时间注意事项**:README 文件的生成通常在一分钟之内完成。如果过程超过几分钟(例如,3 分钟),建议终止 *readme-ai*,以防止处理时间过长。 - -
- ---- - -### 📦 安装 - -***使用 Pip*** - -Pip 是大多数用户推荐的安装方法。 - -```sh -pip install readmeai -``` -
- -***使用 Docker*** - -对希望在容器化环境中运行应用程序的用户来说,推荐使用 Docker。 - -```sh -docker pull zeroxeli/readme-ai:latest -``` - -
- -***手动安装*** - -1️⃣ 克隆 readme-ai 仓库。 -```sh -git clone https://github.com/eli64s/readme-ai -``` - -2️⃣ 导航至 readme-ai 目录。 - -```sh -cd readme-ai -``` - -3️⃣ 使用下面的方法之一安装依赖项。 - -***使用 Bash*** -```sh -bash setup/setup.sh -``` - -***使用 Conda*** -```sh -conda create -n readmeai python=3.9 -y && \ -conda activate readmeai && \ -pip install -r requirements.txt -``` - -***使用 Poetry*** -```sh -poetry shell && \ -poetry install -``` - ---- - -### ⚙️ 配置 - -
- -***命令行参数*** - -要生成 *README.md* 文件,请在您的终端中使用 `readmeai` 命令,同时使用下面的参数。 - -| 短标志 | 长标志 | 描述 | 状态 | -|--------|----------------|---------------------------------------------|------------| -| `-k` | `--api-key` | 您的语言模型 API 密钥。 | 可选 | -| `-b` | `--badges` | 选择 'shields' 或 'square' 更改徽章样式。 | 可选 | -| `-f` | `--offline-mode`| 离线运行,不调用 OpenAI API。 | 可选 | -| `-m` | `--model` | 大型语言模型引擎(gpt-3.5-turbo) | 可选 | -| `-o` | `--output` | 您的 README.md 文件的输出路径。 | 可选 | -| `-r` | `--repository` | 代码仓库的 URL 或路径。 | 必需 | -| `-t` | `--temperature`| 模型的温度(随机性)。 | 可选 | -| `-l` | `--language` | 生成 README 的文本语言。 | 即将推出! | -| `-s` | `--style` | 构建的 README 模板样式。 | 即将推出! | - -
- -***自定义设置*** - -要定制README文件的生成过程,您可以修改项目的[配置文件:](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml) - -- [*api*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L2) - OpenAI 语言模型 API 配置设置。 -- [*git*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L12) - 如果没有提供仓库,则使用默认的 git 仓库设置。 -- [*paths*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L17) - *readme-ai* 应用程序使用的目录路径和文件。 -- [*prompts*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L26) - 用于生成 README 文件的大型语言模型提示。 -- [*md*](https://github.com/eli64s/readme-ai/blob/main/readmeai/settings/config.toml#L59) - 用于构建 README 文件的动态 Markdown 部分代码模板。 - ---- - -### 🚀 运行 *README-AI* - -***使用 Pip*** - -```sh -# 选项 1:使用所有必需的命令行参数运行 readmeai 命令。 -readmeai --api-key "YOUR_API_KEY" --output readme-ai.md --repository https://github.com/eli64s/readme-ai -``` -```sh -# 选项 2:将 OpenAI API 密钥设置为环境变量,然后运行 readmeai 命令。 -export OPENAI_API_KEY="YOUR_API_KEY" -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -b shields -``` - -
- -***使用 Docker*** - -```sh -# 选项 1:使用所有必需的命令行参数运行 Docker 容器。 -docker run -it \ --e OPENAI_API_KEY="YOUR_API_KEY" \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` -```sh -# 选项 2:将 OpenAI API 密钥设置为环境变量,然后运行 Docker 容器。 -export OPENAI_API_KEY="YOUR_API_KEY" -docker run -it \ --e OPENAI_API_KEY=$OPENAI_API_KEY \ --v "$(pwd)":/app zeroxeli/readme-ai:latest \ -readmeai -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***使用 Conda*** -```sh -conda activate readmeai -export OPENAI_API_KEY="YOUR_API_KEY" -python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***使用 Poetry*** -```sh -poetry shell -export OPENAI_API_KEY="YOUR_API_KEY" -poetry run python3 -m readmeai.cli.commands -o readme-ai.md -r https://github.com/eli64s/readme-ai -``` - -
- -***使用 Streamlit*** - -通过 Streamlit Community Cloud 直接在浏览器中使用该应用。 - -- [🛸 带我去 Streamlit 上的 *readme-ai*!](https://readmeai.streamlit.app/) - ---- - -### 🧪 测试 - -使用下面的命令执行测试套件。 - -```sh -bash scripts/test.sh -``` - ---- - -## 🛠 路线图 - -- [X] 通过 PyPI 将项目发布为 Python 库,以便轻松安装。 - - [*PyPI - readmeai*](https://pypi.org/project/readmeai/) -- [X] 在 Docker Hub 上提供项目作为 Docker 镜像。 - - [*Docker Hub - readme-ai*](https://hub.docker.com/repository/docker/zeroxeli/readme-ai/general) -- [X] 集成并部署带有 Streamlit 的应用,使工具更广泛可用。 - - [*Streamlit Community Cloud - readmeai*](https://readmeai.streamlit.app/) -- [ ] 重构我们的大型语言模型引擎,以实现更健壮的 README 生成。 - - [ ] 探索 [LangChain 🦜️🔗](https://python.langchain.com/docs/get_started/introduction) 作为直接使用 OpenAI API 的替代方法。 - - [ ] 探讨使用 [LlamaIndex 🦙](https://gpt-index.readthedocs.io/en/stable/index.html) 框架和检索增强生成 (RAG) 范式。 -- [ ] 增加对任何语言生成 README 文件的支持(例如 CN, ES, FR, JA, KO, RU)。 -- [ ] 为各种用例(即数据,web-dev,最小化等)设计 README 输出模板。 -- [ ] 开发 GitHub Actions 脚本,在推送新代码时自动更新 README 文件。 - ---- - -## 📒 更新日志 - -[更新日志](https://github.com/eli64s/readme-ai/blob/main/CHANGELOG.md) - ---- - -## 🤝 贡献 - -想要为 *readme-ai* 做出贡献吗?以下是您可以做以帮助的事情: - -- 🐍 寻找机会使代码更加高效和可读。 -- 🤖 欢迎处理异常和修复错误! -- 📝 改进文档并在 README 中添加更多示例。 -- 🔡 添加支持,以任何语言生成 README 文件(即 CN, ES, FR, JA, KO, RU)。 -- 🎨 为不同的用例创建新模板(例如数据,web-dev,最小化等)。 - - README 按部分构建,在 [config.toml] 文件中定义。 - - 遵循现有格式开始。 - -[贡献指南](https://github.com/eli64s/readme-ai/blob/main/CONTRIBUTING.md) - ---- - -## 📄 许可 - -[MIT](https://github.com/eli64s/readme-ai/blob/main/LICENSE) - ---- - -## 👏 鸣谢 - -*徽章图标* - - [Shields.io](https://shields.io/) - - [Aveek-Saha/GitHub-Profile-Badges](https://github.com/Aveek-Saha/GitHub-Profile-Badges) - - [Ileriayo/Markdown-Badges](https://github.com/Ileriayo/markdown-badges) - - [tandpfun/skill-icons](https://github.com/tandpfun/skill-icons) - - -

- 🔝 返回 -

- ---- diff --git a/docs/overview.md b/docs/overview.md new file mode 100644 index 00000000..f66af5b9 --- /dev/null +++ b/docs/overview.md @@ -0,0 +1,4 @@ +# README-AI + + +## Why README-AI? diff --git a/pyproject.toml b/pyproject.toml index 28bd5024..dde08d59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "readmeai" -version = "0.4.030" +version = "0.4.031" description = "Automated README.md file generator tool, powered by AI 🧚" authors = ["Eli <0x.eli.64s@gmail.com>"] license = "MIT" diff --git a/readmeai/services/version_control.py b/readmeai/services/version_control.py index 98050e5f..6c681cce 100644 --- a/readmeai/services/version_control.py +++ b/readmeai/services/version_control.py @@ -124,6 +124,9 @@ def validate_file_permissions(temp_dir: Path) -> None: def get_github_file_link(file: str, repo: str, user_repo_name: str) -> str: """Returns the file URL for a given file based on the platform.""" + if Path(repo).exists(): + return "local directory" + domain = repo.split("/")[2] base_urls = { "github.com": f"https://github.com/{user_repo_name}/blob/main/{file}", diff --git a/readmeai/settings/config.toml b/readmeai/settings/config.toml index 4fcebb3b..0c405be6 100644 --- a/readmeai/settings/config.toml +++ b/readmeai/settings/config.toml @@ -40,7 +40,7 @@ output = "readme-ai.md" [prompts] code_summary = """Offer a comprehensive summary that encapsulates the core functionalities of the code: \nPath: {0}\nContents:\n{1}\n Aim for precision and conciseness in your explanation, ensuring a fine balance between detail and brevity. -Limit your response to a maximum of 350 characters (including spaces). +Limit your response to a maximum of 225 characters (including spaces). """ features = """Hello! Analyze the Git codebase {} and create a robust summary of the project's features. The following information summarizes each file in the repository to help you get started: \n{}\n