A smart tool that automatically checks and updates your project's documentation when code changes are made. It works with GitHub and uses a local AI model (Ollama) to analyze and update documentation.
graph TD
A[GitHub Repository] -->|Pull Request Created| B[GitHub Actions]
B -->|Trigger| C[Documentation Checker]
C -->|Read| D[Documentation Files]
C -->|Get| E[Code Changes]
C -->|Analyze| F[Ollama Service]
F -->|Return Analysis| C
C -->|Create| I[Documentation PR]
I -->|Update| A
- When someone creates or updates a pull request in your GitHub repository
- The tool automatically:
- Checks what code has changed
- Looks at your documentation (like README.md and files in the docs folder)
- Uses Ollama to see if the documentation needs updates
- If updates are needed, it creates a new pull request with the changes
- If everything is up to date, it does nothing
- Create a new folder called
.github/workflows
in your repository - Copy the
doc-checker.yml
file into the.github/workflows
folder - Copy the
doc-checker.py
andrequirements.txt
files to the root of your repository
-
Install Ollama:
- For Mac: Open Terminal and run:
curl -fsSL https://ollama.com/install.sh | sh
- For Windows: Download from Ollama's website
- For Linux: Follow instructions at Ollama's website
- For Mac: Open Terminal and run:
-
Download an AI model:
- Open Terminal (or Command Prompt on Windows)
- Run:
ollama pull llama2
(or any other model you prefer)
-
Start Ollama:
- The service should start automatically
- You can check if it's running by opening: http://localhost:11434
-
In your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Add these secrets (optional, as these are the defaults):
- Name:
LLM_MODEL
, Value:llama2
(or your chosen model) - Name:
OLLAMA_HOST
, Value:http://localhost:11434
- Name:
- Make sure your documentation is in one of these places:
README.md
file in your repository- Files in a
docs/
folder - You can add more locations by editing the
DOC_PATHS
indoc-checker.py
- Create a new branch in your repository
- Make some changes to your code
- Create a pull request
- The tool will automatically run and check if documentation needs updates
-
Action not running
- Check if the files are in the correct locations
- Make sure you've added all required secrets
- Check the Actions tab in your repository for error messages
-
Ollama not working
- Make sure Ollama is running
- Check if you can access http://localhost:11434
- Try running
ollama list
to see if your model is downloaded
-
Documentation not being updated
- Check if your documentation files are in the correct locations
- Make sure the AI model has enough context to understand the changes
You can change these settings by editing the files:
-
In
doc-checker.py
:DOC_PATHS
: Add more folders or files to checkMODEL
: Change the AI model (for advanced users)
-
In
.github/workflows/doc-checker.yml
:- Change when the tool runs (default: on pull requests)
- Adjust Python version (default: 3.11)
- Check the GitHub Actions documentation
- Visit Ollama's website for Ollama help
- A GitHub repository
- Python 3.11 or newer
- Ollama installed and running
MIT - Feel free to use and modify as needed!