{"id":50440858,"url":"https://github.com/brbousnguar/ai-git-flow-cli","last_synced_at":"2026-05-31T19:02:05.096Z","repository":{"id":348034930,"uuid":"1166494492","full_name":"brbousnguar/ai-git-flow-cli","owner":"brbousnguar","description":"AI-powered scripts for generating commit messages and release notes using local Ollama — includes a Next.js web app","archived":false,"fork":false,"pushed_at":"2026-05-28T14:45:23.000Z","size":243,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T15:21:26.555Z","etag":null,"topics":["ai","automation","git","local-ai","nextjs","ollama"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brbousnguar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-25T09:32:32.000Z","updated_at":"2026-05-28T14:35:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/brbousnguar/ai-git-flow-cli","commit_stats":null,"previous_names":["brbousnguar/ai-git-tools","brbousnguar/ai-git-flow-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brbousnguar/ai-git-flow-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brbousnguar%2Fai-git-flow-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brbousnguar%2Fai-git-flow-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brbousnguar%2Fai-git-flow-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brbousnguar%2Fai-git-flow-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brbousnguar","download_url":"https://codeload.github.com/brbousnguar/ai-git-flow-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brbousnguar%2Fai-git-flow-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33744447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","automation","git","local-ai","nextjs","ollama"],"created_at":"2026-05-31T19:02:04.261Z","updated_at":"2026-05-31T19:02:05.078Z","avatar_url":"https://github.com/brbousnguar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Local Git Flow\n\nCLI tools for AI-assisted Git workflows in Git Bash and PowerShell.\n\n## Commands\n\nThe intended setup is through aliases in `~/.bashrc`:\n\n```bash\nalias ai-commit='node /d/Projects/RocheBB/Tools/ai-local-git-flow/bin/ai-commit.js'\nalias ai-release='node /d/Projects/RocheBB/Tools/ai-local-git-flow/bin/ai-release.js'\n```\n\nReload Git Bash after editing `~/.bashrc`, or run:\n\n```bash\nsource ~/.bashrc\n```\n\nYou can also run the tools from this repository:\n\n```bash\nnpm run ai-commit --\nnpm run ai-release --\n```\n\n## PowerShell setup\n\nFrom this repository, register the local CLI package once:\n\n```powershell\nnpm link\n```\n\nThis creates `ai-commit.ps1` and `ai-release.ps1` shims in your npm user command folder, for example:\n\n```powershell\nC:\\Users\\\u003cyou\u003e\\AppData\\Roaming\\npm\n```\n\nMake sure that folder is on your PowerShell `PATH`, then restart PowerShell or open a new terminal. After that, run the commands from any Git repository:\n\n```powershell\nai-commit --yes -t SFSC-1573 -m \"implement SSO authentication\"\nai-release\n```\n\nIf your execution policy blocks npm `.ps1` shims, run the CLI through npm from this repo instead:\n\n```powershell\nnpm run ai-commit -- --yes -t SFSC-1573 -m \"implement SSO authentication\"\nnpm run ai-release --\n```\n\n## Install\n\n```bash\nnpm install\n```\n\n## Configuration\n\nConfiguration is loaded from `config.json`.\n\nFor OpenAI cloud usage, create `.env` next to the scripts:\n\n```env\nOPENAI_API_KEY=sk-your-key\n```\n\nOptional JIRA enrichment for ticket-aware commit generation:\n\n```env\nJIRA_BASE_URL=https://your-company.atlassian.net\nJIRA_EMAIL=your.email@company.com\nJIRA_API_TOKEN=your-token\n```\n\nUse `config.json` to switch providers:\n\n```json\n{\n  \"provider\": \"cloud\"\n}\n```\n\nor:\n\n```json\n{\n  \"provider\": \"local\",\n  \"local\": {\n    \"default\": \"qwen2.5-coder:14b\",\n    \"baseURL\": \"http://localhost:11434/v1\",\n    \"endpoints\": [\n      {\n        \"name\": \"mac-mini-m4-pro\",\n        \"baseURL\": \"http://192.168.1.95:11434/v1\",\n        \"default\": \"qwen3-coder:30b-64k\",\n        \"models\": {\n          \"devstral:24b-64k\": \"Mac Mini model for complex implementation and reasoning\",\n          \"qwen3-coder:30b-64k\": \"Mac Mini default for coding, diffs, and workflow generation\"\n        }\n      },\n      {\n        \"name\": \"local\",\n        \"baseURL\": \"http://localhost:11434/v1\",\n        \"default\": \"qwen2.5-coder:14b\"\n      }\n    ]\n  }\n}\n```\n\nWhen `local.endpoints` is configured, the CLI tries them in order. The Mac Mini Ollama server is checked first, then the local machine is used as fallback. Each endpoint can keep its own default model list, so Mac Mini models do not need to match local models.\n\nYou can override the configured AI runtime for a single CLI run:\n\n```bash\nai-commit --cloud\nai-commit --ollama-auto\nai-commit --local-ollama\nai-commit --hosted-ollama\nai-commit --provider cloud --model gpt-5.1-codex-mini\nai-commit --ollama-url http://localhost:11434/v1 --model qwen2.5-coder:14b\n```\n\nRuntime options are supported by both `ai-commit` and `ai-release`:\n\n- `--provider \u003ccloud|ollama-auto|local-ollama|hosted-ollama\u003e`: override `config.json` provider selection\n- `--cloud`: use OpenAI cloud for this run\n- `--ollama-auto`: use configured Ollama endpoints and fallback order, for example Mac Mini first and this machine second\n- `--local-ollama`: use only this machine's localhost Ollama endpoint, skipping Mac Mini\n- `--hosted-ollama`: use only non-localhost Ollama endpoints from `local.endpoints`\n- `--model \u003cname\u003e`: override the configured model for this run\n- `--ollama-url \u003curl\u003e`: use one explicit Ollama-compatible `/v1` base URL for this run\n\n## ai-commit\n\nGenerates branch-name variants, commit-message variants, GitHub labels, commits staged changes, pushes the branch, and creates a PR.\n\nStage files first:\n\n```bash\ngit add \u003cfiles\u003e\n```\n\nRun the workflow:\n\n```bash\nai-commit\n```\n\nCommon options:\n\n```bash\nai-commit -m \"new feature, add customer request endpoint\"\nai-commit -t SFSC-1573 -m \"new feature, implement SSO authentication\"\nai-commit -l \"bug,enhancement\" -m \"hotfix, critical security patch\"\nai-commit -m \"update RAML customer request type\" -n bug\nai-commit --yes -t SFSC-1573 -m \"implement SSO authentication\"\nai-commit --dry-run --local-ollama\nai-commit --dry-run --local-ollama --stream --progress\n```\n\nOptions:\n\n- `-t, --ticket \u003cnumber\u003e`: ticket or issue number, for example `SFSC-1573`\n- `-m, --message \u003ctext\u003e`: context for branch naming and commit message generation\n- `-l, --labels \u003clabels\u003e`: comma-separated GitHub labels\n- `-n, --exclude-label \u003clabel\u003e`: exclude a label from suggestions and PR creation\n- `-d, --debug`: print LLM request details\n- `--debug-context`: print context windows used for generation\n- `--dry-run`: generate and select branch/commit values without renaming the branch, committing, pushing, or creating a PR\n- `--progress`: print heartbeat messages while waiting for local model calls\n- `--stream`: stream raw local Ollama output tokens while they are generated; also enables `--progress`\n- `--think`: enable local Ollama thinking mode; by default the CLI disables thinking for faster structured branch and commit generation\n- `-y, --yes`: non-interactive mode; choose variant 1 for the branch and commit message\n\nWhen `-m, --message` is provided, that developer context is treated as the highest-priority intent. JIRA and diff context are skipped for generation so naming and commit wording stay aligned with the supplied message.\n\nFor AI agents such as Codex or Claude, prefer staging the intended files first and then running:\n\n```bash\nnpm run ai-commit -- --yes -t SFSC-1573 -m \"short implementation context\"\n```\n\nThe `--yes` flag keeps the workflow non-interactive while still using this CLI for branch naming, commit messages, labels, push, and PR creation.\n\nBranch and commit generation use split context windows:\n\n- Branch names use `prompts/branch-naming.md` plus JIRA ticket context, unless `-m` is provided. If neither `-m` nor JIRA context is available, branch names are inferred from the staged git diff.\n- Commit messages use `prompts/commit-message.md` plus the staged git diff, unless `-m` is provided.\n\nWhen a JIRA ticket is provided, the ticket type is used to correct GitHub labels: Task/Tache maps to `enhancement`, and Bug maps to `bug`. Explicit `-l, --labels` values still take priority.\n\n## ai-release\n\nGenerates release PR title and notes by comparing the development branch with the production branch.\n\n```bash\nai-release\nai-release -v v1.1.23\nai-release -l \"release,enhancement\"\nai-release --debug\n```\n\nThe script auto-detects:\n\n- production branch: `main` or `master`\n- development branch: `develop` or `dev`\n\nIt fetches remotes, summarizes commit messages grouped by ticket ID, then can create the release PR through GitHub CLI.\n\nUse `-d, --debug` to print release LLM request details.\n\n## Automatic GitHub Releases\n\nWhen a pull request from `develop` into `main` is merged, GitHub Actions creates the next patch tag and a GitHub Release with generated release notes.\n\nExamples:\n\n- No existing tags: creates `v1.0.0`\n- Latest tag `v1.0.0`: creates `v1.0.1`\n- Latest tag `v1.2.9`: creates `v1.2.10`\n\nThe workflow can also be run manually from the GitHub Actions tab.\n\n## Requirements\n\n- Node.js 18+\n- Git\n- GitHub CLI (`gh`) authenticated for PR creation\n- OpenAI API key or local Ollama-compatible endpoint\n\n## Runtime\n\n- Node.js ES modules\n- OpenAI SDK\n- `dotenv`\n- Git CLI\n- GitHub CLI (`gh`)\n- Optional JIRA REST enrichment for commit generation through `.env`\n\n## Project Files\n\n- `bin/ai-commit.js`: commit workflow CLI\n- `bin/ai-release.js`: release PR workflow CLI\n- `src/ai-common.js`: shared config, OpenAI/Ollama client, token usage, console formatting\n- `config.json`: provider/model/pricing configuration\n- `prompts/branch-naming.md`: branch naming rules used in prompts\n- `prompts/commit-message.md`: commit message rules used in prompts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrbousnguar%2Fai-git-flow-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrbousnguar%2Fai-git-flow-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrbousnguar%2Fai-git-flow-cli/lists"}