This project is a Next.js starter that leverages AI (specifically, Google's Gemini model via Genkit) to automatically generate comprehensive README files for GitHub repositories. It supports both public and private repositories (the latter requiring a Personal Access Token). Users can customize the length of the generated README and choose whether to include emojis, as well as translate the README into multiple languages.
- AI-Powered README Generation: Automatically generates README files based on repository analysis using Genkit and Google AI.
- Customizable Length: Users can specify the desired length of the README (short, medium, or long).
- Emoji Support: Option to include emojis in the README for enhanced readability.
- Multi-Language Translation: Supports translation of the generated README into multiple languages.
- Private Repository Support: Can generate READMEs for private repositories using a GitHub Personal Access Token.
- User Edits: Allows the user to edit the AI-generated README content.
- TypeScript
- Next.js
- @genkit-ai/googleai
- @genkit-ai/next
- Genkit
- @radix-ui (various components)
- Tailwind CSS
- @tanstack/react-query
- Firebase
Before you begin, ensure you have met the following requirements:
- Node.js (version >=18)
- npm or yarn
- A Google Cloud project with the Gemini API enabled and the necessary credentials configured for Genkit.
- (For private repositories) A GitHub Personal Access Token with 'repo' scope.
-
Clone the repository:
git clone https://github.com/slammers001/readme-ai-generator.git cd readme-ai-generator -
Install dependencies:
npm install # or yarn install -
Set up environment variables:
- Copy
.env.exampleto.env. - Fill in the necessary API keys and credentials in the
.envfile. This typically includes credentials for Genkit/Google AI and optionally a GitHub Personal Access Token for private repositories.
- Copy
-
Patch packages:
npx patch-package
-
Run the development server:
npm run dev # or yarn dev -
Open your browser and navigate to
http://localhost:9002(or the port specified in your.envfile). -
Enter the URL of the GitHub repository you want to generate a README for.
-
Customize the README length and other options as desired.
-
Click the "Generate README" button.
This project provides a user interface for generating README files. Here's how to use it:
-
Enter Repository URL: Provide the URL of the GitHub repository. For example:
https://github.com/slammers001/readme-ai-generator -
Configure Options: Select the desired README length (short, medium, or long) and whether to include emojis.
-
Generate README: Click the "Generate README" button. The application will use AI to analyze the repository and generate a README file.
-
Review and Edit: The generated README will be displayed in a preview window. You can edit the content directly in the preview window and use the "Improve" button to refine the README using AI based on your edits.
-
Download: Once you are satisfied with the README, you can download it as a Markdown file.
readme-ai-generator/
βββ .env.example # Example environment variables
βββ next.config.ts # Next.js configuration
βββ package.json # Project dependencies and scripts
βββ package-lock.json # Dependency lock file
βββ postcss.config.js # PostCSS configuration
βββ src/
β βββ ai/ # AI-related code
β β βββ flows/ # Genkit flows for generating and improving READMEs
β β β βββ generate-readme.ts # Flow to generate the README
β β β βββ improve-readme.ts # Flow to improve the README based on user edits
β β β βββ translate-readme.ts # Flow to translate the README to a different language
β β βββ genkit.ts # Genkit AI configuration
β β βββ tools/ # Custom Genkit tools
β β βββ github-repo-tool.ts # Tool to fetch repo info from GitHub
β βββ app/ # Next.js application code
β β βββ globals.css # Global CSS styles
β β βββ layout.tsx # Root layout component
β β βββ page.tsx # Main page component
β βββ components/ # React components
β β βββ custom/ # Custom components
β β β βββ logo.tsx # Logo component
β β β βββ readme-preview.tsx # Readme Preview component
β β β βββ repo-input-form.tsx # Input form for repo URL and options
β β β βββ theme-toggle-button.tsx # Theme Toggle button component
β β βββ ui/ # UI components (Radix UI)
β βββ hooks/ # Custom React hooks
β β βββ use-toast.ts # Custom hook for displaying toasts
β βββ lib/ # Utility functions
β βββ utils.ts # Utility functions
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, concise messages.
- Submit a pull request.
|
MIT
Generated by ReadMeMagic