> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qoder Action

Qoder Action is a standard GitHub Actions component that brings the powerful capabilities of Qoder CLI into your GitHub workflow, enabling intelligent code collaboration directly within PRs and Issues. With simple configuration, you can run Qoder CLI on GitHub Actions Runners to provide your team with two core out-of-the-box capabilities: automated PR reviews and @qoder interactive collaboration.

[Visit Qoder Action Repository →](https://github.com/QoderAI/qoder-action)

## Key Features

* **Automated PR Reviews**: Every pull request automatically receives a comprehensive code review, detecting code defects, security vulnerabilities, test coverage gaps, and other issues—improving code quality before merging
* **@qoder On-Demand Assistance**: Mention @qoder in any comment to get code explanations, implementation suggestions, or direct fixes
* **Deep Project Understanding**: Respects your project's coding standards, architectural patterns, and business logic
* **Quick Setup**: Complete configuration in minutes and immediately boost team efficiency
* **Secure and Reliable**: Code runs on GitHub Runners, ensuring data security

## Quick Start

### Option 1: Quick Setup (Recommended)

Run the `/setup-github` command in qodercli and follow the guided setup.

### Option 2: Manual Setup

#### 1. Install GitHub App and Get Access Token

1. Visit [Qoder Integrations](https://integrations.qoder.com)
2. Link your Qoder account with your GitHub account and install the qoderai GitHub App to your target repository
3. Generate a Qoder Personal Access Token

**Note**: If you previously installed qoderai, visit the [GitHub App installation list](https://github.com/settings/installations) to check if qoderai has any permission upgrade requests. If so, please grant the necessary permissions.

#### 2. Add Qoder Access Token to Repository Secrets

In your repository, go to **Settings > Secrets and variables > Actions** and add `QODER_PERSONAL_ACCESS_TOKEN` with your Qoder Personal Access Token.

#### 3. Select and Install Workflow

Visit [Qoder Action examples](https://github.com/QoderAI/qoder-action/tree/main/examples), choose a workflow that fits your needs, and copy it to your repository's `.github/workflows/` directory.

* **Code Review**: Automatically analyzes pull request code quality, test coverage, and security issues
* **Assistant**: Enables interactive conversations (@qoder) in Issues and PRs to explain code or fix problems

#### 4. Start Using

* **Code Review**: Create a new pull request and wait for Qoder's feedback
* **Assistant**: Comment `@qoder explain this code` or `@qoder fix this issue` in any Issue or PR

## Best Practices

### Customize Output Language

Specify the output language in the prompt:

```
- name: Run Qoder Code Review
  uses: QoderAI/qoder-action@v0
  with:
    qoder_personal_access_token: ${{ secrets.QODER_PERSONAL_ACCESS_TOKEN }}
    prompt: |
      /review-pr
      REPO:${{ github.repository }} PR_NUMBER:${{ github.event.pull_request.number }}
      OUTPUT_LANGUAGE: Chinese
```

### Define Review Rules Using AGENTS.md

Create an `AGENTS.md` file in your repository root. Qoder CLI will automatically load its content as context:

```
# Project Code Review Guidelines

## Review Focus
- All database queries must use parameterized queries; string concatenation is prohibited
- API endpoints must include authorization checks
- Sensitive information (passwords, tokens) must not be hardcoded or logged
- All external input must be validated and sanitized

## Checks to Ignore
- Code duplication checks in test files (`*.test.js`, `*.spec.ts`)
- Code style issues in auto-generated files (`generated/`, `dist/`)
- Complexity warnings in mock data files

## Team Conventions
- Use async/await instead of Promise.then()
- Component names use PascalCase
- Utility functions use camelCase
- Constants use UPPER_SNAKE_CASE
```

### Skip Reviews Based on PR Size

For large PRs, you can add skip conditions to avoid excessive credit consumption:

```
steps:
  - name: Check PR Size
    id: check_size
    run: |
      # Get the number of lines added in the PR
      LINES_CHANGED=$(jq .pull_request.additions < $GITHUB_EVENT_PATH)
      echo "Lines changed: $LINES_CHANGED"

      # Skip review if over 500 lines to control costs
      if [ "$LINES_CHANGED" -gt 500 ]; then
        echo "skip=true" >> $GITHUB_OUTPUT
      else
        echo "skip=false" >> $GITHUB_OUTPUT
      fi

  - uses: QoderAI/qoder-action@v0
    if: steps.check_size.outputs.skip == 'false'  # Only execute if PR size is within threshold
    # ... other configuration
```

**For more configuration examples,** visit the [Recipes documentation](https://github.com/QoderAI/qoder-action/tree/main/recipes) for complete configuration examples and best practices.

## Technical Support

* **GitHub Repository**: [https://github.com/QoderAI/qoder-action](https://github.com/QoderAI/qoder-action)
* **Issue Reporting**: [https://github.com/QoderAI/qoder-action/issues](https://github.com/QoderAI/qoder-action/issues)
