Socket
Socket
Sign inDemoInstall

readmeai

Package Overview
Dependencies
10
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    readmeai

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


Maintainers
1

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

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

Offline Mode Demonstration:

readmeai-streamlit-demo

[!TIP]

Offline mode is useful for generating a boilerplate README at no cost. View the offline README.md example here!


๐Ÿงฉ 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 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, 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

    llm-overview
    ๐Ÿงฉ Features
    Features Table

      prompt template.

    llm-features
    ๐Ÿ“„ Codebase Documentation
    Repository Structure

      (tree.py)

    directory-tree
    File Summaries

      prompts!

    llm-summaries
    ๐Ÿš€ Quickstart Commands
    Getting Started

      languagedependency
      InstallUsageTest
      parsers

    quick-start
    ๐Ÿ”ฐ Contributing Guidelines
    Contributing Guide

          contributing-guidelines
          Additional Sections

            Project RoadmapContributing GuidelinesLicenseAcknowledgements

          contributing-and-more
          ๐ŸŽจ Templates (wip)
          README Template for ML & Data


                ๐Ÿ—‚๏ธ Examples

                Output FileInput RepositoryInput Contents
                โ–นreadme-python.mdreadme-aiPython
                โ–นreadme-google-gemini.mdreadme-aiPython
                โ–นreadme-typescript.mdchatgpt-app-react-tsTypeScript, React
                โ–นreadme-postgres.mdpostgres-proxy-serverPostgres, Duckdb
                โ–นreadme-kotlin.mdfile.io-android-clientKotlin, Android
                โ–นreadme-streamlit.mdreadme-ai-streamlitPython, Streamlit
                โ–นreadme-rust-c.mdrust-c-appC, Rust
                โ–นreadme-go.mdgo-docker-appGo
                โ–นreadme-java.mdjava-minimal-todoJava
                โ–นreadme-fastapi-redis.mdasync-ml-inferenceFastAPI, Redis
                โ–นreadme-mlops.mdmlops-coursePython, Jupyter
                โ–นreadme-local.mdLocal DirectoryFlink, 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.

                Choosing an LLM Service:

                • OpenAI: Recommended, requires an account setup and API key.
                • Ollama: Free and open-source, potentially slower and more resource-intensive.
                • Google Gemini: Requires a Google Cloud account and API key.
                • Offline Mode: Generates a boilerplate README without making API calls.

                โš™๏ธ Installation

                Using pip

                pip

                pip install readmeai
                

                [!TIP]

                pipx

                Use pipx to install and run Python command-line applications without causing dependency conflicts with other packages!

                Using docker

                docker

                docker pull zeroxeli/readme-ai:latest
                
                Using conda

                conda

                conda install -c conda-forge readmeai
                
                From source
                Clone and Install

                Clone repository and change directory.

                $ git clone https://github.com/eli64s/readme-ai
                $ cd readme-ai
                
                Using bash

                bash

                $ bash setup/setup.sh
                
                Using poetry

                Poetry

                $ 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.

                # Using Linux or macOS
                $ export OPENAI_API_KEY=<your_api_key>
                
                # Using Windows
                $ set OPENAI_API=<your_api_key>
                
                Using Ollama

                Set Ollama local host as an environment variable.

                $ 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 repository.

                Using Google Gemini

                Set your Google Cloud project ID and location as environment variables.

                $ export GOOGLE_API_KEY=<your_api_key>
                

                Run the CLI

                Using pip

                pip

                # 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

                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

                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

                $ conda activate readmeai
                $ python3 -m readmeai.cli.main -r https://github.com/eli64s/readme-ai
                
                Using poetry

                Poetry

                $ poetry shell
                $ poetry run python3 -m readmeai.cli.main -r https://github.com/eli64s/readme-ai
                

                ๐Ÿงช Tests

                Using pytest

                pytest

                $ make pytest
                
                Using nox
                $ nox -f noxfile.py
                

                [!TIP]

                Use nox to test application against multiple Python environments and dependencies!


                ๐Ÿ“ฆ Configuration

                Customize the README file using the CLI options below.

                OptionTypeDescriptionDefault Value
                --alignment, -aStringAlign the text in the README.md file's header.center
                --apiStringLLM API service to use for text generation.offline
                --badge-colorStringBadge color name or hex code.0080ff
                --badge-styleStringBadge icon style type.see below
                --base-urlStringBase URL for the repository.v1/chat/completions
                --context-windowIntegerMaximum context window of the LLM API.3999
                --emojis, -eBooleanAdds emojis to the README.md file's header sections.False
                --image, -iStringProject logo image displayed in the README file header.blue
                ๐Ÿšง --languageStringLanguage for generating the README.md file.en
                --model, -mStringLLM API to use for text generation.gpt-3.5-turbo
                --output, -oStringOutput file name for the README file.readme-ai.md
                --rate-limitIntegerMaximum number of API requests per minute.5
                --repository, -rStringRepository URL or local directory path.None
                --temperature, -tFloatSets the creativity level for content generation.0.9
                ๐Ÿšง --templateStringREADME template style.default
                --top-pFloatSets the probability of the top-p sampling method.0.9
                --tree-depthIntegerMaximum depth of the directory tree structure.2
                --helpDisplays help information about the command and its options.

                ๐Ÿšง feature under development


                Badge Customization

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

                StylePreview
                default
                flat
                flat-square
                for-the-badge
                plastic
                skillsPython Skill Icon
                skills-lightPython 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
                $ 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 ...}


                Select a project logo using the --image option.

                bluegradientblack
                cloudpurplegrey

                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.
                  • --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


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

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



                ๐ŸŽ— License

                MIT


                ๐Ÿ‘Š Acknowledgments

                Return


                Keywords

                FAQs


                Did you know?

                Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

                Install

                Related posts

                SocketSocket SOC 2 Logo

                Product

                • Package Alerts
                • Integrations
                • Docs
                • Pricing
                • FAQ
                • Roadmap

                Stay in touch

                Get open source security insights delivered straight into your inbox.


                • Terms
                • Privacy
                • Security

                Made with โšก๏ธ by Socket Inc