DEV Community

Cover image for πŸš€ AI-Powered README Generator – Automatically Write Beautiful READMEs with Gemini + LangChain
kanugu rajesh
kanugu rajesh

Posted on

πŸš€ AI-Powered README Generator – Automatically Write Beautiful READMEs with Gemini + LangChain

Creating good documentation is hard β€” but what if your README.md wrote itself?

Introducing the AI-Powered README Generator, a command-line tool that uses Google's Generative AI (Gemini) and LangChain to generate detailed and structured README.md files for public GitHub repositories.

πŸ“– Say goodbye to boring READMEs. Let AI do the heavy lifting.


🧠 What It Does

Given a GitHub repository URL, this tool:

  • Connects to the GitHub API to fetch repository contents
  • Understands the file structure and purpose
  • Uses a Large Language Model (via LangChain + Gemini)
  • Generates a professional-quality README.md file β€” automatically!
  • Updates/Creates the README.md file in the github repo if you own it

πŸ”§ Why Use It?

This tool is perfect for:

βœ… Instantly generating initial READMEs for new projects

βœ… Refreshing stale documentation with up-to-date content

βœ… Learning how to integrate LLMs with external APIs in a real-world scenario


πŸ“¦ Installation

Here's how you can get it up and running in 5 steps:

  1. Clone the repo
   git clone https://github.com/kanugurajesh/DocMind
   cd DocMind
Enter fullscreen mode Exit fullscreen mode
  1. Set up a virtual environment
   python -m venv venv
   source venv/bin/activate  # Windows: venv\Scripts\activate
Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies
   pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode
  1. Setup .env file

βš™οΈ How to Use

Just run the main.py script with the GitHub repository URL:

python main.py https://github.com/octocat/Spoon-Knife
Enter fullscreen mode Exit fullscreen mode

πŸŽ‰ It will generate a README_generated.md file in your current directory with the AI-crafted content.

✨ Features

πŸ€– LLM-Powered Documentation – Uses Gemini through LangChain to generate context-aware, high-quality markdown.

πŸ”— GitHub Integration – Fetches the file structure using PyGithub.

πŸ’» CLI Tool – Simple and effective to use right from your terminal.

πŸ”Œ Modular Codebase – Cleanly separated into agents and utils.

πŸ” Environment-Based Secrets – Uses .env for secure API key handling.

πŸ§ͺ Example

Want to try it on a real-world repo?

python main.py https://github.com/{username}/{repo_name}
Enter fullscreen mode Exit fullscreen mode

Check your project folder β€” you'll find a brand new README_generated.md waiting for you ✍️

Github :- https://github.com/kanugurajesh/DocMind

Smart Doc

Top comments (0)