readme-auto-generator
v1.1.1
Published
Automatically generates a professional README.md using Google Gemini AI.
Readme
readme-auto-generator

Description
Tired of spending hours crafting the perfect README? readme-auto-generator is your intelligent assistant, leveraging the cutting-edge power of Google Gemini AI to instantly generate professional, comprehensive, and engaging README.md files for your projects. This intuitive CLI tool analyzes your project's structure, dependencies, and key code snippets to create a README that truly reflects your work, saving you valuable time and ensuring consistency across all your repositories. Focus on coding, and let AI handle the documentation!
Features
- AI-Powered Generation: Utilizes Google Gemini AI to create high-quality, relevant README content.
- Automatic Project Analysis: Intelligently scans your project's files,
package.json, and respects.gitignorerules to understand your project's context. - Dependency & Script Detection: Automatically identifies installed packages and defined npm scripts to include in the README.
- Framework Detection: Smartly detects common frameworks and languages like Node.js (React, Next.js, Express, Vue, Discord Bot), Python, Java, and Minecraft Plugins.
- Secure API Key Management: Provides a secure way to set and store your Google Gemini API key locally.
- User-Friendly CLI: A simple and clean command-line interface for seamless operation.
- Safe Output: Generates a
README-draft.mdfile to prevent accidental overwrites of existingREADME.mdfiles. - Update Notifications: Keeps you informed about new versions of
readme-auto-generator. - Content Truncation: Handles large files gracefully by truncating content to focus on essential parts for AI analysis.
Installation
To get started with readme-auto-generator, you'll need Node.js (version 20 or higher recommended) installed on your system.
Install globally via npm:
npm install -g readme-auto-generatorObtain a Google Gemini API Key:
- Visit the Google AI Studio and create a new API key.
Set your API Key: Once you have your key, configure
readme-auto-generatorwith it:readme-gen --set-key YOUR_GEMINI_API_KEYYour API key will be securely stored in your home directory (
~/.readme-generator-config.json).
Usage
Navigate to the root directory of the project for which you want to generate a README, then simply run:
readme-genThe tool will analyze your project and generate a README-draft.md file in the current directory.
# Example Workflow
cd ~/my-awesome-project
readme-gen --set-key sk-xxxxxx # Only needed once
readme-gen
# Output
Analyzing project at: /home/user/my-awesome-project
Parsing project structure...
Scanning files...
Building prompt...
Waiting for Gemini AI response...
README generated successfully!
Draft saved to: /home/user/my-awesome-project/README-draft.md
Please review README-draft.md and rename it to README.md if you are satisfied.Review the generated README-draft.md. If you're satisfied with the content, rename it to README.md:
mv README-draft.md README.mdTech Stack
readme-auto-generator is built with a modern Node.js and TypeScript stack, leveraging powerful AI capabilities.
| Technology | Description | | :-------------- | :---------------------------------------- | | Node.js | JavaScript runtime environment | | TypeScript | Strongly typed superset of JavaScript | | Google Gemini AI| Core AI model for README generation | | Commander.js | Node.js CLI framework | | Ora | Elegant terminal spinner for loading states| | Ignore | Utility for parsing .gitignore files | | Update Notifier | Notifies users of new package versions |
Project Structure
The project follows a modular structure for clarity and maintainability:
.
├── dist/ # Compiled JavaScript output
├── src/ # Source code
│ ├── cli.ts # Main command-line interface logic
│ ├── config.ts # API key loading and saving
│ ├── gemini.ts # Google Gemini API interaction
│ ├── parser.ts # Project structure and dependency parsing
│ ├── promptBuilder.ts # Constructs the AI prompt
│ ├── scanner.ts # File system scanning and content extraction
│ └── utils.ts # Utility functions for CLI output
├── package.json # Project metadata, scripts, and dependencies
├── package-lock.json # Records exact dependency versions
├── tsconfig.json # TypeScript compiler configuration
└── CHANGELOG.md # Project change logAPI Key Configuration
This project relies on the Google Gemini API to generate READMEs. You need to provide your API key for the tool to function.
How to get an API Key:
- Go to the Google AI Studio.
- Sign in with your Google account.
- Click "Get API Key" or "Create API Key".
- Copy the generated key.
Setting the API Key: Use the
--set-keyoption with thereadme-gencommand:readme-gen --set-key YOUR_GEMINI_API_KEYYour key will be saved locally in a configuration file within your home directory (
~/.readme-generator-config.json) and is not committed to source control or shared externally.
Screenshots
Add screenshots or GIF demonstrating the CLI in action here.
Contributing
We welcome contributions to readme-auto-generator! If you have suggestions for improvements, new features, or bug fixes, please follow these steps:
- Fork the repository.
- Clone your forked repository to your local machine.
- Create a new branch for your feature or fix (
git checkout -b feature/your-feature-name). - Make your changes and ensure tests pass (if any).
- Commit your changes with a clear and descriptive message.
- Push your branch to your forked repository.
- Open a Pull Request to the
mainbranch of this repository.
Please ensure your code adheres to the existing style and conventions.
License
This project is licensed under the MIT License - see the LICENSE file for details.
