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

# Auto-Close Command

> CLI reference for the auto-close command

# Auto-Close Command

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

## Syntax

```bash theme={null}
simili auto-close [OPTIONS]
```

## Options

| Option                   | Short | Type   | Description                                                          | Default               |
| ------------------------ | ----- | ------ | -------------------------------------------------------------------- | --------------------- |
| `--repo`                 |       | string | Repository (`owner/name`). Falls back to `GITHUB_REPOSITORY` env var | -                     |
| `--grace-period-minutes` |       | number | Override grace period in minutes (useful for testing)                | -                     |
| `--config`               | `-c`  | file   | Path to configuration file                                           | `.github/simili.yaml` |
| `--dry-run`              |       | bool   | Simulate without making changes                                      | false                 |
| `--help`                 | `-h`  | bool   | Show 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

```bash theme={null}
simili auto-close --repo owner/repo --config .github/simili.yaml
```

### Dry-run (preview only)

```bash theme={null}
simili auto-close --repo owner/repo --dry-run
```

### Testing with zero grace period

```bash theme={null}
simili auto-close --repo owner/repo --grace-period-minutes 0 --dry-run
```

### Using environment variable for repo

```bash theme={null}
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

```json theme={null}
{
  "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:

```yaml theme={null}
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

```yaml theme={null}
auto_close:
  grace_period_hours: 72   # Wait 3 days before closing
  dry_run: false
```

See [Configuration Schema](/reference/config-schema#autocloseconfig) for full details.

## Next steps

<CardGroup cols={2}>
  <Card title="Duplicate detection guide" href="/guides/duplicate-detection">
    How duplicate detection works
  </Card>

  <Card title="Process command" href="/reference/cli/process-command">
    Process individual issues
  </Card>
</CardGroup>
