{"id":50629438,"url":"https://github.com/mashirozx/gitlab-copilot-ci","last_synced_at":"2026-06-09T06:05:45.636Z","repository":{"id":357625403,"uuid":"1237732290","full_name":"mashirozx/gitlab-copilot-ci","owner":"mashirozx","description":"A GitLab CI tool for automated code review using GitHub Copilot CLI.","archived":false,"fork":false,"pushed_at":"2026-06-06T15:25:59.000Z","size":424,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T16:20:19.951Z","etag":null,"topics":["code-review","copilot-cli","gitlab","gitlab-ci","llm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mashirozx.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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-13T13:06:17.000Z","updated_at":"2026-06-06T15:24:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f12dc0df-2f51-4c61-95d2-2e3594896677","html_url":"https://github.com/mashirozx/gitlab-copilot-ci","commit_stats":null,"previous_names":["mashirozx/gitlab-copilot-ci"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/mashirozx/gitlab-copilot-ci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mashirozx%2Fgitlab-copilot-ci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mashirozx%2Fgitlab-copilot-ci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mashirozx%2Fgitlab-copilot-ci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mashirozx%2Fgitlab-copilot-ci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mashirozx","download_url":"https://codeload.github.com/mashirozx/gitlab-copilot-ci/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mashirozx%2Fgitlab-copilot-ci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33997731,"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-06-06T02:00:07.033Z","response_time":107,"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":["code-review","copilot-cli","gitlab","gitlab-ci","llm"],"created_at":"2026-06-06T20:00:46.820Z","updated_at":"2026-06-09T06:05:45.629Z","avatar_url":"https://github.com/mashirozx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitlab-copilot-ci\n\nA Bun-based GitLab CI review binary that analyzes merge request diffs with either GitHub Copilot CLI or Pi, posts inline GitLab discussions, and maintains a top-level summary note.\n\n## Binary Artifacts\n\n| Platform | Architecture | Download |\n|----------|--------------|----------|\n| macOS | Apple Silicon | [gitlab-copilot-ci-darwin-arm64](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-darwin-arm64) |\n| macOS | Intel x86_64 | [gitlab-copilot-ci-darwin-x64](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-darwin-x64) |\n| Linux | x86_64 | [gitlab-copilot-ci-linux-x64](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-linux-x64) |\n| Linux | ARM64 | [gitlab-copilot-ci-linux-arm64](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-linux-arm64) |\n| Windows | x86_64 | [gitlab-copilot-ci-win-x64.exe](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-win-x64.exe) |\n| Windows | ARM64 | [gitlab-copilot-ci-win-arm64.exe](https://github.com/mashirozx/gitlab-copilot-ci/releases/latest/download/gitlab-copilot-ci-win-arm64.exe) |\n\n## Usage\n\nThe binary is intended to run from the target repository root during a GitLab CI merge request pipeline.\n\nEach run can:\n- fetch paginated merge request diffs from GitLab\n- ask the configured agent to generate inline findings plus a summary\n- post inline discussions on valid diff positions\n- publish a summary note that includes review findings, optional translations, model or agent timing metadata, and embedded review-history data for duplicate suppression\n\nAgent output is now fully structured. The model returns `readableModelName`, localized `summary.walkthrough`, localized structured `summary.changes`, localized `summary.otherSuggestions`, and inline `reviews[].suggestions[lang].{detail,abstract}` entries. The runtime, not the model, renders GitLab headings, tables, localized section labels, rank badges, collapsed language blocks, and the final summary note layout.\n\nWhen `--collect-runtime-stats` is enabled, the summary performance matrix also includes best-effort parent and agent runtime usage for the current OS sampler.\n\n### CLI Arguments\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `--agent` | `string` | `github-copilot-cli` | Agent provider to use for code review. Choices: `github-copilot-cli`, `pi`. |\n| `--gitlab-token` | `string` | `GITLAB_TOKEN` | GitLab API token. |\n| `--gitlab-url` | `string` | `CI_SERVER_URL` | GitLab server URL. |\n| `--agent-bin` | `string` | `AGENT_BIN` when set | Agent CLI binary name or path. |\n| `--agent-args` | `string` | none | Optional extra CLI args appended to the selected agent binary invocation. |\n| `--model` | `string` | `gpt-5.4` | Model name. Supports provider prefixes like `openai/gpt-4o` and effort suffixes like `sonnet:high`. |\n| `--copilot-github-token` | `string` | `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, or `GITHUB_TOKEN` | Optional GitHub token with Copilot access for headless authentication. |\n| `--project-id` | `string` | `CI_PROJECT_ID` | GitLab project ID. |\n| `--mr-iid` | `string` | `CI_MERGE_REQUEST_IID` | GitLab merge request IID. |\n| `--max-git-diff-page` | `number` | unlimited | Maximum number of GitLab merge request diff pages to fetch. With the current per-page size of 20, a value of `5` reads at most the first `100` diff entries. |\n| `--html-marker-prefix` | `string` | `copilot` | Prefix used to build the HTML markers that identify CLI-generated MR comments. Alias: `--html-marker-preffix`. Generates `\u003cprefix\u003e-review-marker`, `\u003cprefix\u003e-summary-marker`, `\u003cprefix\u003e-review-data-start`, `\u003cprefix\u003e-review-data-end`, and `\u003cprefix\u003e-reviewing-marker`. |\n| `--dry-run`, `--debug`, `-d` | `boolean` | `false` | Run the real review pipeline but skip all GitLab writes, including inline comments, summary notes, and reviewing-marker notes. |\n| `--log` | `array` | none | Enable log file writing. Pass without a value to write to the current directory, or provide a path such as `--log /path/to/dir`. |\n| `--max-stdout-size` | `string` | `100mb` | Maximum GitLab CI job log size used to cap live agent stdout printing. Accepts case-insensitive byte-size suffixes like `100mb`, `512kb`, or `42b`. Console stdout stops once printed output reaches `80%` of this byte limit, and printed stdout is measured with `Buffer.byteLength(...)` for accurate byte counting. This follows GitLab's job log size ceiling guidance: https://docs.gitlab.com/administration/cicd/job_logs/#maximum-log-file-size |\n| `--collect-runtime-stats` | `boolean` | `false` | Collect best-effort runtime stats for the Bun parent process and the spawned review agent. Uses OS-specific samplers for macOS, Linux, and Windows; Linux and Windows can also report best-effort agent read/write byte totals, while macOS reports memory and CPU without per-process disk I/O bytes. |\n| `--max-history-length` | `number` | `12` | Maximum number of prior review runs to keep in the summary-embedded review history. Older runs are discarded first. |\n| `--process-max-pending-time` | `number` | `30` | Maximum number of minutes to wait for an existing in-progress review marker before skipping this run. |\n| `--instruction-files` | `array` | `[]` | Repository instruction entry file paths to pass through to the LLM review prompt. Repeatable, for example `--instruction-files AGENTS.md --instruction-files .github/copilot.md`. |\n| `--extra-prompts` | `string` | none | Extra prompt text to append to the generated LLM review prompt. If provided, the model must obey it. |\n| `--should-teach-diff-compute` | `boolean` | `false` | Include prompt instructions that teach the LLM how to compute diff line positions manually from unified diff hunks. |\n| `--tools` | `array` | `[]` | Additional agent tool names to allow beyond the built-in defaults. Repeatable, for example `--tools sh --tools read_file`. |\n| `--lang` | `array` | `[]` | Display language(s) for review output, for example `--lang=zh-CN --lang=ja --lang=en`. If omitted, output defaults to the `--thinking-lang` source language. |\n| `--thinking-lang` | `string` | `en` | Primary reasoning language and the required language key included in every language-keyed summary and review record returned by the agent. If `--lang` and `--collapsed-lang` are both omitted, rendered output defaults to this language. |\n| `--collapsed-lang`, `--c-lang` | `array` | `[]` | Display language(s) that should be wrapped in a GitLab `\u003cdetails\u003e` block for both inline reviews and the summary note. |\n| `--collapse-changes-summary` | `boolean` | `false` | Wrap the summary note's `## 🚧 Changes` section in a GitLab `\u003cdetails\u003e` block. |\n| `--collapse-review-summary` | `boolean` | `false` | Wrap the summary note's `## 🔍 Review Summary` section in a GitLab `\u003cdetails\u003e` block. |\n| `--ignored-rank` | `array` | `[]` | Review rank(s) to ask the LLM to omit from inline reviews and the summary note. Allowed values: `HIGH`, `MEDIUM`, `LOW`. |\n| `--log-level` | `string` | `5` | Logger output level: `0-5` (numeric), `-999/+999` (custom), or type name `fatal`, `error`, `warn`, `log`, `info`, `debug`, `trace`, `verbose`. |\n| `--help` | `boolean` | n/a | Show help. |\n| `--version`, `-v` | `boolean` | n/a | Show version information and exit. |\n\n### Required Arguments\n\nNo CLI argument is strictly required as long as the relevant environment variables are present.\n\n- `--agent` defaults to `github-copilot-cli`.\n- `--gitlab-token`, `--gitlab-url`, `--project-id`, and `--mr-iid` typically come from the GitLab CI environment.\n\n### Example GitLab CI/CD Configuration\n\n```yaml\ncode-review:\n  image: node:26-alpine3.22\n  before_script:\n    # when using GitHub Copilot CLI as agent\n    - npm install -g @github/copilot\n    # when using Pi as agent\n    - npm install -g @earendil-works/pi-coding-agent\n  variables:\n    # note that CI_JOB_TOKEN does not have permissions to post MR comments,\n    # so a personal/repository access token with api scope is necessary here\n    GITLAB_TOKEN: \"$YOUR_GITLAB_TOKEN\" # required\n    # when using GitHub Copilot CLI as agent, a GitHub token is also required\n    # for authentication\n    GH_TOKEN: \"$YOUR_GH_TOKEN\" # optional\n    # For Pi agent, set the necessary environment variables for used provider\n    # run `pi --help` for details\n    GEMINI_API_KEY: \"$YOUR_GEMINI_API_KEY\" # optional\n  script:\n    - ./gitlab-copilot-ci \\\n        --agent \"pi\" \\ # required\n        --model \"google/gemini-3.5-flash:xhigh\" \\ # optional\n        --thinking-lang en --lang en --c-lang zh-CN \\ # optional\n        --instruction-files CLAUDE.md --instruction-files CODE-REVIEW_RULE.md \\ # optional\n        --extra-prompts \"Focus on security implications and edge cases.\" \\ # optional\n        --ignored-rank LOW \\ # optional\n        --html-marker-prefix \"xiaomi-mimo-code-review\" # optional\n```\n\n      At startup, the runtime preloads the `--thinking-lang` locale plus every language requested by `--lang` and `--c-lang`. The agent must return all of those languages directly in the structured response. Rendering then selects the requested display language from those language-keyed records, and any collapsed languages are wrapped by the runtime in GitLab `\u003cdetails\u003e` blocks.\n\n      For GitHub Copilot CLI runs, the performance matrix also parses Copilot's trailing usage lines and includes `AI Credits`, total tokens, and reasoning tokens when available.\n\n### Model Syntax\n\nThe `--model` argument accepts the same model strings used by Pi, including provider prefixes and effort shorthand:\n\n```bash\n# Provider-prefixed model, passed through as-is for both agents\n./gitlab-copilot-ci --model openai/gpt-4o\n\n# Effort shorthand, converted to Copilot CLI's --effort option\n./gitlab-copilot-ci --model sonnet:high\n\n# Use together with provider prefix for Pi, passed through as-is\n./gitlab-copilot-ci --model google/gemini-3.5-flash:xhigh\n```\n\nFor `github-copilot-cli`, the suffix after the final `:` is treated as the effort level and forwarded to the Copilot CLI `--effort` flag. For `pi`, the model string is passed through unchanged.\n\n## Development\n\n```bash\n# Run in development mode\nbun run dev\n\n# Build local binaries\nbun run build:darwin-arm64\nbun run build:darwin-x64\nbun run build:linux-x64\nbun run build:linux-arm64\nbun run build:win-x64\nbun run build:win-arm64\n\n# Lint code\nbun run lint\n\n# Format code\nbun run format\n\n# Fix and format code\nbun run biome\n\n# Type check\nbun run typecheck\n\n# Experimental TypeScript native preview check\nbun run tsgo\n\n# Unit tests\nbun run test\n```\n\n## License\n\nMIT License - Copyright (c) 2026 [Mashiro](https://github.com/mashirozx)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmashirozx%2Fgitlab-copilot-ci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmashirozx%2Fgitlab-copilot-ci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmashirozx%2Fgitlab-copilot-ci/lists"}