gh-minimize

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 4 Imported by: 0

README

gh minimize

releases ci

GitHub CLI extension to minimize (hide) issue and pull request comments with a reason such as "off-topic", "resolved", or "spam".

Install

Make sure you have version 2.0 or newer of the GitHub CLI installed.

gh extension install heaths/gh-minimize

Usage

List comments

List issue or review comments so you can find comment IDs:

gh minimize list 123
gh minimize list 123 --author octocat --author hubot --body-grep 'obsolete.*context'
gh minimize list 123 --json id,author,isMinimized
gh minimize list 123 --jq '.[].author'
gh minimize list 123 --jq '[.[] | select(.authorType == "bot")]'
gh minimize list 123 --template '{{range .}}{{printf "%s\t%t\n" .author .isMinimized}}{{end}}'

Use -R / --repo to target another repository in [HOST/]OWNER/REPO format.

Minimize or unminimize comments

Minimize or unminimize a comment directly by ID:

gh minimize --id MDEyOklzc3VlQ29tbWVudDE= --reason off-topic
gh minimize --id MDEyOklzc3VlQ29tbWVudDE= --undo

Filter comments in an issue or pull request by author and/or body regex:

gh minimize 123 --author octocat --body-grep 'obsolete.*context' --reason outdated
gh minimize 123 --author octocat --body-grep 'obsolete.*context' --undo

Valid --reason values:

  • abuse
  • duplicate
  • low-quality
  • off-topic
  • outdated
  • resolved
  • spam
GitHub Actions

You can use this extension in an issue_comment (used for both issues and pull requests) workflow with only the permissions needed to minimize comments:

on:
  issue_comment:
    types:
    - created
    - edited

permissions:
  pull-requests: write

jobs:
  minimize:
    if: ${{ github.event.issue.pull_request }}
    runs-on: ubuntu-latest
    steps:
    - run: |
        gh ext install heaths/gh-minimize
        gh minimize ${{ github.event.pull_request.number }} --author github-actions --body-grep 'new changes have been pushed to this pull request' --reason outdated
      env:
        GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

License

Licensed under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL