Skip to content

Feature Request: CI/CD non-interactive mode with JSON output and exit codes #83

Description

@tailorgunjan93

Feature Request: CI/CD Non-Interactive Mode

Problem

git-lrc currently requires an interactive terminal and browser. This makes it
impossible to use in automated pipelines (GitHub Actions, GitLab CI, Jenkins).
This has also been requested in the community previously.

Proposed Solution

Add a --ci flag for fully non-interactive review with structured output:

# Usage
git lrc review --ci
git lrc review --ci --format=json
git lrc review --ci --fail-on=high    # exit 1 only on high severity
git lrc review --ci --fail-on=any     # exit 1 on any issue

Output Format (JSON)

{
  "commit": "a3f9c12",
  "coverage": 87,
  "iterations": 1,
  "issues": [
    {
      "file": "src/auth.go",
      "line": 42,
      "severity": "high",
      "message": "Possible SQL injection via unsanitized input"
    }
  ],
  "verdict": "fail"
}

Exit Codes

Code Meaning
0 No issues / review passed
1 Issues found above threshold
2 Review service unreachable

GitHub Actions Example

- name: AI Code Review
  run: git lrc review --ci --fail-on=high --format=json > review.json

- name: Upload Review Results
  uses: actions/upload-artifact@v3
  with:
    name: ai-review
    path: review.json

Implementation Notes

  • In --ci mode: no browser launch, no BubbleTea TUI, stdout only
  • The existing reviewdb SQLite store can still log CI results locally
  • decisionflow.go state machine works as-is; just skip interactive prompts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions