Skip to main content

Auto-Close Command

Close GitHub issues that have been confirmed as duplicates after the configured grace period.

Syntax

simili auto-close [OPTIONS]

Options

OptionShortTypeDescriptionDefault
--repostringRepository (owner/name). Falls back to GITHUB_REPOSITORY env var-
--grace-period-minutesnumberOverride grace period in minutes (useful for testing)-
--config-cfilePath to configuration file.github/simili.yaml
--dry-runboolSimulate without making changesfalse
--help-hboolShow help message-

Grace period precedence

The effective grace period is resolved in this order (highest wins):
  1. --grace-period-minutes CLI flag
  2. auto_close.grace_period_hours in simili.yaml
  3. Built-in default: 72 hours

Examples

Standard auto-close run

simili auto-close --repo owner/repo --config .github/simili.yaml

Dry-run (preview only)

simili auto-close --repo owner/repo --dry-run

Testing with zero grace period

simili auto-close --repo owner/repo --grace-period-minutes 0 --dry-run

Using environment variable for repo

export GITHUB_REPOSITORY="owner/repo"
simili auto-close --config .github/simili.yaml

Human activity detection

The auto-closer will skip an issue if any of the following occur after the potential-duplicate label was applied:
  • A non-bot user posts a negative reaction (👎 or 😕) on the bot’s triage comment
  • The issue is reopened by a human
  • A non-bot comment is posted on the issue

Output

{
  "processed": 12,
  "closed": 3,
  "skipped_grace_period": 7,
  "skipped_human_activity": 2,
  "errors": 0,
  "details": [
    {
      "number": 45,
      "action": "closed",
      "reason": "grace period expired"
    },
    {
      "number": 52,
      "action": "skipped",
      "reason": "human_activity: non-bot comment detected"
    }
  ]
}

Scheduling with GitHub Actions

Run auto-close on a schedule:
name: Simili Auto-Close

on:
  schedule:
    - cron: '0 */6 * * *'  # Every 6 hours
  workflow_dispatch:

jobs:
  auto-close:
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read
    steps:
      - uses: actions/checkout@v4

      - uses: similigh/simili-bot@v0.2.0
        with:
          command: "auto-close"
          config_path: ".github/simili.yaml"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          QDRANT_URL: ${{ secrets.QDRANT_URL }}
          QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}

Configuration

auto_close:
  grace_period_hours: 72   # Wait 3 days before closing
  dry_run: false
See Configuration Schema for full details.

Next steps