AutoDocGPT is a GitHub Action designed to automatically generate a tailored, professional README.md file for your Next.js and React projects. Powered by OpenAI's GPT technology, AutoDocGPT scans your project files, detects structures like routers and src folders, and produces meaningful, concise documentation with minimal API calls.
- Automated README Generation: Creates or updates your
README.mdfile effortlessly. - Dynamic Project Support:
- Supports Next.js (
app-routerandpages-router) and React projects. - Adapts to projects with or without a
srcfolder.
- Supports Next.js (
- Key Insights Extraction:
- Summarizes your project's structure, key components, and features.
- Extracts and documents scripts from
package.json.
- Efficient API Usage: Batch processing minimizes OpenAI API calls, optimizing token usage and cost.
- Router Type Detection: Automatically detects if the project uses
app-router,pages-router, or standard React configurations.
- Analyze Project Files: AutoDocGPT scans files in the
srcfolder (if it exists) or the entire project. - Identify Project Details:
- Detects router type (
app-router,pages-router, or React). - Extracts and processes scripts, key files, and folder structures.
- Detects router type (
- Generate Tailored Content:
- Uses OpenAI's GPT API to create concise descriptions for your files and components.
- Dynamically adapts content to your project's structure.
- Update README:
- Writes or updates the
README.mdfile in your repository with the latest details.
- Writes or updates the
- GitHub Actions Enabled: Ensure GitHub Actions are enabled for your repository.
- OpenAI API Key: Obtain an OpenAI API key and store it in your repository secrets as
OPENAI_API_KEY.
Create a workflow file (e.g., .github/workflows/autodocgpt.yml) with the following content:
name: AutoDocGPT
on:
push:
branches:
- main
workflow_dispatch:
jobs:
generate-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use AutoDocGPT
uses: morepriyam/autodocgpt@v1.0
with:
email: ${{ github.actor }}@users.noreply.github.com
name: ${{ github.actor }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}- Initial release of AutoDocGPT.
- Supports Next.js (
app-router,pages-router) and React projects. - Automatically adapts to projects with or without a
srcfolder. - Generates summaries for files, components, and scripts.
- Efficient API usage with batch processing. Contributing markdown Copy code
We welcome contributions! To contribute:
- Fork this repository.
- Create a feature branch:
git checkout -b feature/new-feature Commit your changes: bash Copy code git commit -m "Add new feature" Push to the branch: bash Copy code git push origin feature/new-feature Open a pull request. yaml Copy code
- OpenAI: For providing the GPT API that powers this action.
- GitHub Actions: For enabling seamless CI/CD workflows. License markdown Copy code
This project is licensed under the MIT License.