Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eli64s/readme-ai

README file generator, powered by large language model APIs ๐Ÿ‘พ
https://github.com/eli64s/readme-ai

ai ai-documentation badge-generator developer-tools devtools documentation documentation-generator markdown markdown-generator python readme readme-generator readme-md readme-md-generator readme-template

Last synced: about 2 months ago
JSON representation

README file generator, powered by large language model APIs ๐Ÿ‘พ

Awesome Lists containing this project

README

        





README-AI



Automated README file generator, powered by large language model APIs




github-actions


codecov


pypi-version


pepy-total-downloads


license

Table of Contents

- [๐Ÿ“ Overview](#-overview)
- [๐Ÿ‘พ Demo](#-demo)
- [๐Ÿงฉ Features](#-features)
- [๐Ÿ—‚๏ธ Examples](#๏ธ-examples)
- [๐Ÿš€ Getting Started](#-getting-started)
- [โš™๏ธ Installation](#-installation)
- [๐Ÿค– Usage](#-usage)
- [๐Ÿงช Tests](#-tests)
- [๐Ÿ“ฆ Configuration](#๏ธ-configuration)
- [๐Ÿ”ญ Roadmap](#-roadmap)
- [๐Ÿง‘โ€๐Ÿ’ป Contributing](#-contributing)
- [๐ŸŽ— License](#-license)

---

## ๐Ÿ“ Overview

***Objective***

Readme-ai is a developer tool that auto-generates README.md files using a combination of data extraction and generative ai. Simply provide a repository URL or local path to your codebase and a well-structured and detailed README file will be generated for you.

***Motivation***

Streamlines documentation creation and maintenance, enhancing developer productivity. This project aims to enable all skill levels, across all domains, to better understand, use, and contribute to open-source software.

> [!IMPORTANT]
>
> Readme-ai is currently under development with an opinionated configuration and setup. It is vital to review all generated text from the LLM API to ensure it accurately represents your project.

---

## ๐Ÿ‘พ Demo

**Standard CLI Usage:**

[readmeai-cli-demo](https://github.com/eli64s/artifacts/assets/43382407/55b8d1b9-06a7-4b1f-b6a7-aaeccdb27679
)

**Offline Mode Demonstration:**

[readmeai-streamlit-demo](https://github.com/eli64s/artifacts/assets/43382407/3eb39fcf-c1df-49c6-bb5c-63e141857ae3)

> [!TIP]
>
> Offline mode is useful for generating a boilerplate README at no cost. View the offline README.md example [here!](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-offline.md)

---

## ๐Ÿงฉ Features

### Flexible README Generation

Readme-ai uses a balanced approach to building README files, combining data extraction and generative AI to create comprehensive and informative documentation.

- **Data Extraction & Analysis**: File parsers and analyzers are used to extract project metadata, dependencies, and other relevant details. This data is used to both populate many sections of the README, as well as provide context to the LLM API.
- **Generative Content**: For more abstract or creative sections, readme-ai uses LLM APIs to generate content that is both informative and engaging. This includes sections such as a project slogan, overview, features table, and file summaries.

### CLI Customization

Over a dozen CLI options are available to customize the README generation process:

- **LLM Options**: Run the tool with OpenAI, Ollama, Google Gemini, or in offline mode.
- **Offline Mode**: Generate a [README](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-offline.md) without making API calls. Readme-ai is still able to populate a significant portion of the README using metadata collected during preprocessing.
- **Project Badges**: Choose from an array of [badge styles](https://shields.io/), colors, and alignments.
- **Project Logo**: Select from the default set, upload your own, or let the LLM give it a try!

A few examples of the CLI options in action:




default-header

default output (no options provided to cli)





cloud-db-logo

--alignment left --badge-style flat-square --image cloud


gradient-markdown-logo

--alignment left --badge-style flat --image gradient





custom-logo

--badge-style flat --image custom


skills-light

--badge-style skills-light --image grey





readme-ai-header

--badge-style flat-square


black-logo

--badge-style flat --image black

See the Configuration section for a complete list of CLI options.

๐Ÿ‘‹ Overview



Overview



    - High-level introduction of the project, focused on the value proposition and use-cases, rather than technical aspects.




llm-overview

๐Ÿงฉ Features



Features Table



    - Generated markdown table that highlights the key technical features and components of the codebase. This table is generated using a structured prompt template.





llm-features

๐Ÿ“„ Codebase Documentation



Repository Structure



    - Directory tree structure is generated using pure Python (tree.py) and embedded in the README.






directory-tree




File Summaries



    - Summarizes key files in the codebase, and also used as context for additional prompts!






llm-summaries


๐Ÿš€ Quickstart Commands




Getting Started



    - Auto-generated setup guides based on language and dependency analysis.


    - Install, Usage, and Test guides are supported for many languages.


    - The parsers module is a collection of tool-specific parsers that extract dependencies and metadata.





quick-start


๐Ÿ”ฐ Contributing Guidelines




Contributing Guide


    - Dropdown section that outlines general process for contributing to your project.

    - Provides links to your contributing guidelines, issues page, and more resources.

    - Graph of contributors is also included.





contributing-guidelines


Additional Sections



    - Project Roadmap, Contributing Guidelines, License, and Acknowledgements are included by default.





contributing-and-more

๐ŸŽจ Templates (wip)




README Template for ML & Data


    - Themed templates tailored to AI, web, data science projects.

    - Sections targetted to programming domain.

    - Framework for consistent, comprehensive READMEs









---

## ๐Ÿ—‚๏ธ Examples

| | **Output File** | **Input Repository** | **Input Contents** |
|---|-------------|------------|-----------|
| โ–น | [readme-python.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-python.md) | [readme-ai](https://github.com/eli64s/readme-ai) | Python |
| โ–น | [readme-google-gemini.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-gemini.md) | [readme-ai](https://github.com/eli64s/readme-ai) | Python |
| โ–น | [readme-typescript.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-typescript.md) | [chatgpt-app-react-ts](https://github.com/Yuberley/ChatGPT-App-React-Native-TypeScript) | TypeScript, React |
| โ–น | [readme-postgres.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-postgres.md) | [postgres-proxy-server](https://github.com/jwills/buenavista) | Postgres, Duckdb |
| โ–น | [readme-kotlin.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-kotlin.md) | [file.io-android-client](https://github.com/rumaan/file.io-Android-Client) | Kotlin, Android |
| โ–น | [readme-streamlit.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-streamlit.md) | [readme-ai-streamlit](https://github.com/eli64s/readme-ai-streamlit) | Python, Streamlit |
| โ–น | [readme-rust-c.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-rust-c.md) | [rust-c-app](https://github.com/DownWithUp/CallMon) | C, Rust |
| โ–น | [readme-go.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-go.md) | [go-docker-app](https://github.com/olliefr/docker-gs-ping) | Go |
| โ–น | [readme-java.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-java.md) | [java-minimal-todo](https://github.com/avjinder/Minimal-Todo) | Java |
| โ–น | [readme-fastapi-redis.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-fastapi-redis.md) | [async-ml-inference](https://github.com/FerrariDG/async-ml-inference) | FastAPI, Redis |
| โ–น | [readme-mlops.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-mlops.md) | [mlops-course](https://github.com/GokuMohandas/mlops-course) | Python, Jupyter |
| โ–น | [readme-local.md](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-local.md) | Local Directory | Flink, Python |

---

## ๐Ÿš€ Getting Started

**System Requirements:**

- Python 3.9+
- Package manager/Container: `pip`, `pipx`, `docker`
- LLM service: `OpenAI`, `Ollama`, `Google Gemini`, `Offline Mode`

**Repository URL or Local Path:**

Make sure to have a repository URL or local directory path ready for the CLI.

- [**GitHub**](https://github.com/)
- [**GitLab**](https://gitlab.com/)
- [**Bitbucket**](https://bitbucket.org/)
- [**File System**](https://en.wikipedia.org/wiki/File_system)

**Choosing an LLM Service:**

- [**OpenAI**](https://platform.openai.com/docs/quickstart/account-setup): Recommended, requires an account setup and API key.
- [**Ollama**](https://github.com/ollama/ollama): Free and open-source, potentially slower and more resource-intensive.
- [**Google Gemini**](https://ai.google.dev/tutorials/python_quickstart): Requires a Google Cloud account and API key.
- [**Offline Mode**](https://github.com/eli64s/readme-ai/blob/main/examples/markdown/readme-offline.md): Generates a boilerplate README without making API calls.

---

### โš™๏ธ Installation

#### Using `pip`

> [![pip](https://img.shields.io/badge/PyPI-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/readmeai/)
>
> ```sh
> pip install readmeai
> ```

> [!TIP]
>
> [![pipx](https://img.shields.io/badge/pipx-2CFFAA.svg?style=flat&logo=pipx&logoColor=black)](https://pipxproject.github.io/pipx/installation/)
>
> Use [pipx](https://pipx.pypa.io/stable/installation/) to install and run Python command-line applications without causing dependency conflicts with other packages!

#### Using `docker`

> [![docker](https://img.shields.io/badge/Docker-2496ED.svg?style=flat&logo=Docker&logoColor=white)](https://hub.docker.com/r/zeroxeli/readme-ai)
>
> ```sh
> docker pull zeroxeli/readme-ai:latest
> ```

#### Using `conda`

> [![conda](https://img.shields.io/badge/Anaconda-44A833.svg?style=flat&logo=Anaconda&logoColor=white)](https://anaconda.org/zeroxeli/readmeai)
>
> ```sh
> conda install -c conda-forge readmeai
> ```

#### From `source`

Clone and Install

> Clone repository and change directory.
>
> ```console
> $ git clone https://github.com/eli64s/readme-ai
> $ cd readme-ai
> ```

#### Using `bash`
>
> [![bash](https://img.shields.io/badge/GNU%20Bash-4EAA25.svg?style=flat&logo=GNU-Bash&logoColor=white)](https://www.gnu.org/software/bash/)
>
> ```console
> $ bash setup/setup.sh
> ```

#### Using `poetry`
> [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
>
> ```console
> $ poetry install
> ```

* Similiary you can use `pipenv` or `pip` to install the requirements.txt.

---

### ๐Ÿค– Usage

**Environment Variables**

#### Using `OpenAI`

> Set your OpenAI API key as an environment variable.
> ```console
> # Using Linux or macOS
> $ export OPENAI_API_KEY=
>
> # Using Windows
> $ set OPENAI_API_KEY=
> ```

#### Using `Ollama`

> Set Ollama local host as an environment variable.
> ```console
> $ export OLLAMA_HOST=127.0.0.1
> $ ollama pull mistral:latest # llama2, etc.
> $ ollama serve # run if not using the Ollama desktop app
> ```
> For more details, check out the [Ollama](https://github.com/ollama/ollama-python?tab=readme-ov-file) repository.

#### Using `Google Gemini`

> Set your Google Cloud project ID and location as environment variables.
> ```console
> $ export GOOGLE_API_KEY=
> ```

**Run the CLI**

#### Using `pip`

> [![pip](https://img.shields.io/badge/PyPI-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/readmeai/)
>
> ```console
> # Using OpenAI API
> readmeai --repository https://github.com/eli64s/readme-ai --api openai
>
> # Using Ollama local model
> readmeai --repository https://github.com/eli64s/readme-ai --api ollama --model mistral
> ```

#### Using `docker`

> [![docker](https://img.shields.io/badge/Docker-2496ED.svg?style=flat&logo=Docker&logoColor=white)](https://hub.docker.com/r/zeroxeli/readme-ai)
>
> ```sh
> docker run -it \
> -e OPENAI_API_KEY=$OPENAI_API_KEY \
> -v "$(pwd)":/app zeroxeli/readme-ai:latest \
> -r https://github.com/eli64s/readme-ai
> ```

#### Using `streamlit`

> [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://readme-ai.streamlit.app/)
>
> Try directly in your browser on Streamlit, no installation required! For more details, check out the readme-ai-streamlit repository.

#### From `source`

Usage

#### Using `bash`
>
> [![bash](https://img.shields.io/badge/GNU%20Bash-4EAA25.svg?style=flat&logo=GNU-Bash&logoColor=white)](https://www.gnu.org/software/bash/)
>
> ```console
> $ conda activate readmeai
> $ python3 -m readmeai.cli.main -r https://github.com/eli64s/readme-ai
> ```

#### Using `poetry`
> [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
>
> ```console
> $ poetry shell
> $ poetry run python3 -m readmeai.cli.main -r https://github.com/eli64s/readme-ai
> ```

---

### ๐Ÿงช Tests

#### Using `pytest`
> [![pytest](https://img.shields.io/badge/Pytest-0A9EDC.svg?style=flat&logo=Pytest&logoColor=white)](https://docs.pytest.org/en/7.1.x/contents.html)
> ```console
> $ make pytest
> ```

#### Using `nox`
> ```console
> $ nox -f noxfile.py
> ```

> [!TIP]
>
> Use [nox](https://nox.thea.codes/en/stable/) to test application against multiple Python environments and dependencies!

---

## ๐Ÿ“ฆ Configuration

Customize the README file using the CLI options below.

| Option | Type | Description | Default Value |
| ------ | ---- | ----------- | -------------- |
| `--alignment`, `-a` | String | Align the text in the README.md file's header. | `center` |
| `--api` | String | LLM API service to use for text generation. | `offline` |
| `--badge-color` | String | Badge color name or hex code. | `0080ff` |
| `--badge-style` | String | Badge icon style type. | [see below][0] |
| `--base-url` | String | Base URL for the repository. | `v1/chat/completions` |
| `--context-window` | Integer | Maximum context window of the LLM API. | `3999` |
| `--emojis`, `-e` | Boolean | Adds emojis to the README.md file's header sections. | `False` |
| `--image`, `-i` | String | Project logo image displayed in the README file header. | `blue` |
| `๐Ÿšง --language` | String | Language for generating the README.md file. | `en` |
| `--model`, `-m` | String | LLM API to use for text generation. | `gpt-3.5-turbo` |
| `--output`, `-o` | String | Output file name for the README file. | `readme-ai.md` |
| `--rate-limit` | Integer | Maximum number of API requests per minute. | `5` |
| `--repository`, `-r` | String | Repository URL or local directory path. | `None` |
| `--temperature`, `-t` | Float | Sets the creativity level for content generation. | `0.9` |
| `๐Ÿšง --template` | String | README template style. | `default` |
| `--top-p` | Float | Sets the probability of the top-p sampling method. | `0.9` |
| `--tree-depth` | Integer | Maximum depth of the directory tree structure. | `2` |
| `--help` | | Displays help information about the command and its options. | |

๐Ÿšง feature under development

[0]: https://github.com/eli64s/readme-ai?tab=readme-ov-file#badges "see below"

---

### Badge Customization

The `--badge-style` option lets you select the style of the default badge set.


Style
Preview


default



flat



flat-square



for-the-badge



plastic



skills
Python Skill Icon


skills-light
Python Skill Light Icon


social

When providing the `--badge-style` option, readme-ai does two things:

1. Formats the default badge set to match the selection (i.e. flat, flat-square, etc.).
2. Generates an additional badge set representing your projects dependencies and tech stack (i.e. Python, Docker, etc.)

#### Example
>
> ```console
> $ readmeai --badge-style flat-square --repository https://github.com/eli64s/readme-ai
> ```
>

#### Output
>
> {... project logo ...}
>
> {... project name ...}
>
> {...project slogan...}
>
>
>
>
>
>
>

>
> *Developed with the software and tools below.*
>
>
>
>
> YAML
>
>
>

>
>
>
>
>
>
>

>
> {... end of header ...}
>

---

### Project Logo

Select a project logo using the `--image` option.


blue
gradient
black







cloud
purple
grey





For custom images, see the following options:
* Use `--image custom` to invoke a prompt to upload a local image file path or URL.
* Use `--image llm` to generate a project logo using a LLM API (OpenAI only).

---

## ๐Ÿ”ญ Roadmap

- [ ] Add new CLI options to enhance README file customization.
- [X] `--api` Integrate singular interface for all LLM APIs (OpenAI, Ollama, Gemini, etc.)
- [ ] `--audit` to review existing README files and suggest improvements.
- [ ] `--template` to select a README template style (i.e. ai, data, web, etc.)
- [ ] `--language` to generate README files in any language (i.e. zh-CN, ES, FR, JA, KO, RU)
- [ ] Develop robust documentation generator to build full project docs (i.e. Sphinx, MkDocs)
- [ ] Create community-driven templates for README files and gallery of readme-ai examples.
- [ ] GitHub Actions script to automatically update README file content on repository push.

---

## ๐Ÿ“’ Changelog

[Changelog][0]

---

## ๐Ÿง‘โ€๐Ÿ’ป Contributing

To grow the project, we need your help! See the links below to get started.

- [๐Ÿ”ฐ Contributing Guide][1]
- [๐Ÿ‘‹ Start a Discussion][2]
- [๐Ÿ› Open an Issue][3]







---

## ๐ŸŽ— License

[MIT][4]

---

## ๐Ÿ‘Š Acknowledgments

- [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)


Return

---

[0]: https://github.com/eli64s/readme-ai/blob/main/CHANGELOG.md "๐Ÿ“’ Changelog"
[1]: https://github.com/eli64s/readme-ai/blob/main/CONTRIBUTING.md "๐Ÿ”ฐ Contributing Guide"
[2]: https://github.com/eli64s/readme-ai/discussions "๐Ÿ‘‹ Start a Discussion"
[3]: https://github.com/eli64s/readme-ai/issues "๐Ÿ› Open an Issue"
[4]: https://github.com/eli64s/readme-ai/blob/main/LICENSE "๐ŸŽ— License"