No description
  • Python 98.7%
  • Shell 1.3%
Find a file
2026-03-06 21:26:42 +00:00
.gitignore Starting point 2026-03-06 19:56:43 +00:00
config.json.example Starting point 2026-03-06 19:56:43 +00:00
forgejo-daily-report.py Add timestamps to terminal output 2026-03-06 21:26:42 +00:00
pyrightconfig.json Add setup.sh, pyrightconfig.json, and fix type/style warnings 2026-03-06 20:36:58 +00:00
README.md Add README 2026-03-06 21:04:37 +00:00
setup.sh Add setup.sh, pyrightconfig.json, and fix type/style warnings 2026-03-06 20:36:58 +00:00

forgejo-daily-report

Generates a daily summary of Forgejo repository activity and posts it to TriliumNext as child notes under the day's date note.

For each repo with activity on the target day, it:

  1. Fetches commits via the Forgejo API
  2. Fetches the diff for each commit
  3. Sends the diffs and commit messages to Ollama for an HTML summary
  4. Posts the summary as a child note under that day's Trilium date note

Requirements

  • Python 3.11+
  • An Ollama instance with a model loaded
  • A TriliumNext instance with ETAPI enabled
  • A Forgejo instance with an API token

Setup

cp config.json.example config.json
# Edit config.json with your details
bash setup.sh

Configuration

All settings can be provided via config.json (takes precedence) or environment variables.

Key Description Default
FORGEJO_URL Base URL of your Forgejo instance https://git.nimmog.uk
FORGEJO_TOKEN API token with read:repository and read:user scopes (required)
FORGEJO_USER Forgejo username whose repos to report on nimmo
OLLAMA_URL Ollama API base URL http://192.168.8.124:11434
OLLAMA_MODEL Model to use for summarisation qwen3.5:122b
TRILIUM_URL TriliumNext base URL https://notes.nimmog.uk
TRILIUM_TOKEN ETAPI token (required)
MAX_DIFF_BYTES Max bytes of diff to send per repo 100000
DIFF_EXCLUDE_PATTERNS Extra filename patterns to exclude from diffs (config.json only, as a list) []

Usage

# Report on yesterday (default)
venv/bin/python3 forgejo-daily-report.py

# Report on a specific date
venv/bin/python3 forgejo-daily-report.py 2026-03-05

Cron

0 1 * * * /home/nimmo/scripts/forgejo-daily-report/venv/bin/python3 /home/nimmo/scripts/forgejo-daily-report/forgejo-daily-report.py

Trilium notes

Each generated note is tagged with:

  • git-report — allows searching across all reports
  • iconClass=bx bxl-git — git icon in the note tree
  • <repo-name>=<date> — e.g. nixos-config=2026-03-05, for per-repo history searches