{"id":48050617,"url":"https://github.com/matheussricardoo/git-sage","last_synced_at":"2026-04-04T14:21:26.270Z","repository":{"id":339568512,"uuid":"1162468824","full_name":"matheussricardoo/git-sage","owner":"matheussricardoo","description":"AI-powered git commit generator using local LLMs via Ollama. Runs entirely offline, no API key required.","archived":false,"fork":false,"pushed_at":"2026-02-27T13:44:31.000Z","size":39,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-27T18:46:47.706Z","etag":null,"topics":["ai","cli","convertional-commits","git","llm","offline","ollama","rust","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matheussricardoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-20T09:53:49.000Z","updated_at":"2026-02-27T13:44:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matheussricardoo/git-sage","commit_stats":null,"previous_names":["matheussricardoo/git-sage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matheussricardoo/git-sage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheussricardoo%2Fgit-sage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheussricardoo%2Fgit-sage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheussricardoo%2Fgit-sage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheussricardoo%2Fgit-sage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matheussricardoo","download_url":"https://codeload.github.com/matheussricardoo/git-sage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matheussricardoo%2Fgit-sage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","cli","convertional-commits","git","llm","offline","ollama","rust","terminal"],"created_at":"2026-04-04T14:21:24.370Z","updated_at":"2026-04-04T14:21:25.706Z","avatar_url":"https://github.com/matheussricardoo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"100%\" src=\"https://capsule-render.vercel.app/api?type=waving\u0026color=222222\u0026height=200\u0026section=header\u0026text=git-sage\u0026fontSize=55\u0026fontColor=fff\u0026animation=twinkling\u0026fontAlignY=40\u0026desc=AI-powered%20Git%20Commit%20Generator%20%7C%20Rust%20%7C%20Ollama\u0026descAlignY=60\u0026descSize=18\"\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ci\u003eA CLI tool that uses a local LLM via Ollama to automatically generate Conventional Commit messages from your staged git diffs.\u003c/i\u003e\n\u003c/p\u003e\n\n---\n\n### Features\n\n\u003cdiv align=\"center\"\u003e\n\n| Feature |\n|:---|\n| Local LLM — no API key, runs fully offline |\n| GPU-accelerated inference via Ollama |\n| Follows the Conventional Commits specification |\n| Split mode — one commit per file with `-s` |\n| Interactive prompt — accept, edit or skip each suggestion |\n| Lock file auto-included in the first accepted commit |\n| Colored output for quick visual scanning |\n| Spinner feedback while the model is generating |\n| Diff truncation warning with suggested `--ctx` value |\n\n\u003c/div\u003e\n\n---\n\n### Technologies\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://skillicons.dev\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=rust,linux\u0026theme=dark\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003csub\u003eTokio • Reqwest • Clap • Inquire • Serde • Indicatif • owo-colors • Ollama\u003c/sub\u003e\n\u003c/div\u003e\n\n---\n\n### Getting Started\n\n#### 1. Install Ollama\n\n```bash\ncurl -fsSL https://ollama.com/install.sh | sh\n```\n\n#### 2. Pull the model\n\n```bash\nollama pull qwen2.5-coder:3b\n```\n\n#### 3. Clone \u0026 build\n\n```bash\ngit clone https://github.com/matheussricardoo/git-sage.git\ncd git-sage\ncargo build --release\n```\n\n#### 4. (Optional) Install globally\n\n```bash\ncargo install --path .\n```\n\n---\n\n### Usage\n\n```bash\n# Stage your files first\ngit add .\n\n# Generate a single commit for all staged files\ngit-sage\n\n# Generate one commit per file (split mode)\ngit-sage -s\n\n# Prompt to push after all commits are done\ngit-sage -s --push\n\n# Use a different model\ngit-sage -s --model qwen2.5-coder:7b\n\n# Adjust model creativity (0.0 = deterministic, 1.0 = creative)\ngit-sage -s --temp 0.2\n\n# Increase context window for large diffs\ngit-sage -s --ctx 4096\n\n# Run fully on CPU (no GPU)\ngit-sage --gpu 0 --threads 8\n```\n\n#### Interactive prompt\n\nFor each suggestion you can choose:\n\n```\n--- src/main.rs\n⠋ Generating commit message...\nSuggestion: feat(main): add --push flag and colored output\n\n\u003e Commit this file?\n  Yes    ← commit as-is\n  No     ← skip this file\n  Edit   ← open the message for editing before committing\n```\n\n#### Truncation warning\n\nWhen a diff exceeds the context window, a warning is shown with a suggested fix:\n\n```\nDiff truncated (6000/12400 bytes). Use --ctx 4133 for full analysis.\n```\n\n---\n\n### Structure\n\n```\nsrc/\n├── main.rs           # CLI args, commit workflow, split logic, colored output\n├── llm.rs            # Ollama API client, spinner, truncation logic\n├── git.rs            # Git diff helpers, generic lock file detection\n└── instructions.txt  # System prompt for the LLM\n```\n\n---\n\n### Model Configuration\n\nAll model parameters are controlled via CLI flags — no need to edit source code or recompile.\n\n```bash\ngit-sage --model \u003cMODEL\u003e --threads \u003cN\u003e --gpu \u003cN\u003e --ctx \u003cN\u003e --temp \u003cF\u003e\n```\n\nTo see all available models locally:\n\n```bash\nollama list\n```\n\nTo pull a different model:\n\n```bash\nollama pull \u003cmodel-name\u003e\n# Examples:\nollama pull qwen2.5-coder:7b\nollama pull deepseek-coder:6.7b\nollama pull llama3.2:3b\n```\n\n---\n\n### CLI Flags\n\nAll parameters have sensible defaults tuned for a **GTX 1050 Ti (4GB VRAM) + i5-7400 + 8GB RAM** setup.\n\n| Flag | Default | Description |\n|:---|:---:|:---|\n| `-s, --split` | `false` | Generate one commit per staged file |\n| `-t, --temp` | `0.0` | Model temperature (`0.0` = deterministic, `1.0` = creative) |\n| `--model` | `qwen2.5-coder:3b` | Ollama model to use |\n| `--threads` | `4` | CPU threads (set to your core count) |\n| `--gpu` | `99` | GPU layers to offload (`99` = all, `0` = CPU only) |\n| `--ctx` | `2048` | Context window in tokens (increase for large diffs) |\n| `--push` | `false` | Prompt to push commits to remote after finishing |\n\n---\n\n### Lock File Support\n\ngit-sage automatically detects staged lock files and attaches them to the first accepted commit. No manual handling needed. Supported lock files:\n\n| Language | Lock File |\n|:---|:---|\n| Rust | `Cargo.lock` |\n| Node (npm) | `package-lock.json` |\n| Node (yarn) | `yarn.lock` |\n| Node (pnpm) | `pnpm-lock.yaml` |\n| Python (poetry) | `poetry.lock` |\n| Python (pipenv) | `Pipfile.lock` |\n| Ruby | `Gemfile.lock` |\n| Go | `go.sum` |\n| PHP | `composer.lock` |\n| Nix | `flake.lock` |\n\n---\n\n### Model Selection Guide\n\nChoose based on your available VRAM:\n\n| VRAM | Recommended Model | Notes |\n|:---:|:---|:---|\n| 2 GB | `qwen2.5-coder:1.5b` | Fast, lower accuracy |\n| 4 GB | `qwen2.5-coder:3b` | Best quality/speed ratio for 4 GB cards |\n| 6 GB | `qwen2.5-coder:7b` | Noticeably better descriptions |\n| 8 GB+ | `deepseek-coder:6.7b` | High quality output |\n| CPU only | `qwen2.5-coder:1.5b` | Use `--gpu 0`, expect slower inference |\n\n\u003e The default `qwen2.5-coder:3b` in Q4 quantization uses ~1.9 GB of VRAM and fits entirely on a 4 GB card.\n\n#### Checking your specs\n\n**GPU VRAM (Linux):**\n\n```bash\nnvidia-smi --query-gpu=name,memory.total,memory.free --format=csv\n```\n\n**CPU core count:**\n\n```bash\nnproc\n```\n\n**RAM:**\n\n```bash\nfree -h\n```\n\n**Check if Ollama is using your GPU:**\n\n```bash\nollama ps\n# The \"Processor\" column shows GPU % vs CPU %\n```\n\n---\n\n### Author\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/matheussricardoo\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=github\" alt=\"GitHub\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.linkedin.com/in/matheus-ricardo-426452266/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://skillicons.dev/icons?i=linkedin\" alt=\"LinkedIn\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cimg width=\"100%\" src=\"https://capsule-render.vercel.app/api?type=waving\u0026color=222222\u0026height=120\u0026section=footer\"/\u003e\n\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheussricardoo%2Fgit-sage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatheussricardoo%2Fgit-sage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatheussricardoo%2Fgit-sage/lists"}