Skip to content

Integrate gitStream with LinearB's AI

User Commands

LinearB's AI is available also with user commands, read more about them here

Automation Examples

Use LinearB's AI for a comprehensive Code Review

Use LinearB's AI with the code-review action to automatically review the introduced changes to the code.

code-review

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.
  • The PR is not on Draft staten and was not created by a bot.

Automation Actions:

  • Perform an AI-driven code review and append the review comments to the PR.
  • Use guidelines to add your prompts to the team or org review

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_review:
    # Trigger it only when PR is created or has new commits
    on:
      - pr_created
      - commit
    if:
      - {{ not pr.draft }}
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: code-review@v1
        args:
          approve_on_LGTM: {{ approve_pr_on_lgtm }} # optional arg, you can remove it
          guidelines: {{ guidelines }}

# Define variables
# Add conditions for PR approvals. For example - allow approval only for specific users
approve_pr_on_lgtm: false

# Add `guidelines` to customize the code review prompts:
# - For repository-specific guidelines: Place `REVIEW_RULES.md` at your repository root
# - For organization-wide guidelines: Place the file in your CM repository root and use `../cm/REVIEW_RULES.md`
# - For team-specific guidelines: Place the file in the team repository root
# The `dump` filter ensures proper YAML formatting when the file content is inserted
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_review:
    if:
      - {{ not pr.draft }}
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: code-review@v1
        args:
          approve_on_LGTM: {{ approve_pr_on_lgtm }} # optional arg, you can remove it
          guidelines: {{ guidelines }}

# Define variables
# Add conditions for PR approvals. For example - allow approval only for specific users
approve_pr_on_lgtm: false

# Add `guidelines` to add your prompts to the review, you can have org wide instructions
# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to
# the team repo.
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_review:
    if:
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: code-review@v1
        args:
          approve_on_LGTM: {{ approve_pr_on_lgtm }} # optional arg, you can remove it
          guidelines: {{ guidelines }}

# Define variables
# Add conditions for PR approvals. For example - allow approval only for specific users
approve_pr_on_lgtm: false

# Add `guidelines` to add your prompts to the review, you can have org wide instructions
# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to
# the team repo.
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}

./REVIEW_RULES.md example

This file should be created in your repo root:

1. Do not comment on missing documentation.
2. Do not comment on missing tests.
3. For JavaScript code, enforce using camelCase for variables and functions.

Add PR Description Using LinearB's AI

Use the describe-changes automation action to automatically generate and append a concise, AI-generated description to a pull request. This ensures that all PRs include meaningful and helpful descriptions, improving review efficiency.

summarized-pr

Configuration Description

Conditions (all must be true):

  • A PR is created or new code has been committed to the PR.

Automation Actions:

  • Append the AI-generated description to the PR description.

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_description:
    # Trigger it only when PR is created or has new commits
    # Note: explicit triggers are ignored for GitLab or Bitbucket
    on:
      - pr_created
      - commit
    # skip description for Draft PRs and PRs from bots
    if:
      - {{ not pr.draft }}
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: describe-changes@v1
        args:
          concat_mode: append

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_description:
    # skip description for Draft PRs and PRs from bots
    if:
      - {{ not pr.draft }}
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: describe-changes@v1
        args:
          concat_mode: append

Configuration Example

manifest:
  version: 1.0

automations:
  linearb_ai_description:
    # skip description for Draft PRs and PRs from bots
    if:
      - {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
    run:
      - action: describe-changes@v1
        args:
          concat_mode: append

Additional Resources


title: gitStream Reference - User Commands description: User commands enable manual triggering of gitStream actions through PR comments.


User Commands

User commands allow you to trigger specific gitStream actions manually by adding comments to pull requests. These commands provide on-demand execution of automation actions without requiring changes to your .cm configuration files.

GitHub Only & v2 Action Required

User commands are only supported on GitHub and require the linear-b/gitstream-github-action@v2. This feature is not available on GitLab or Bitbucket.

Overview

gitStream supports comment-triggered actions that allow you to execute specific automations on-demand. Commands are only processed when new comments are added, not when existing comments are edited.

gitStream provides visual feedback through emoji reactions on command comments. 👀 is added when a command is recognized and processing begins and 👍 is added when the command has been successfully executed.

Available Commands

Command Platform Description Action
/gs review Runs a one-time code review on the current PR Executes code-review@v1 once on the current PR
/gs desc Generates or updates the PR description with AI-powered change summary Executes describe-changes@v1 once on the current PR with concat_mode: append
/gs help Displays available commands and their descriptions Adds a new PR comment with the list of available commands

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

More Automations can be found on the Automation Library and Integrations pages.