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

# complior fix

> Auto-remediate compliance findings — preview, apply, and undo fixes.

```bash theme={null}
complior fix [path] [flags]
```

## Flags

| Flag                | Description                           | Default |
| ------------------- | ------------------------------------- | ------- |
| `--dry-run`         | Preview fixes without applying        | off     |
| `--json`            | Output as JSON                        | off     |
| `--ai`              | Use LLM to fill document placeholders | off     |
| `--source <SOURCE>` | Fix source: `scan` or `eval`          | scan    |

## Examples

<Tabs>
  <Tab title="Preview">
    ```bash theme={null}
    complior fix --dry-run
    ```

    ```
    Dry-Run Fix Analysis (offline estimate)
    Fixable: 29 findings
    Predicted: 40 -> 72 (+32)

    Type A (Code Fixes):
      - no-disclosure: Add AI disclosure system message        [+5]
      - no-logging: Add audit logging middleware               [+5]
      - hardcoded-key: Move API key to .env                    [+3]

    Type B (Document Generation):
      - missing-fria: Generate FRIA template                  [+6]
      - missing-policy: Generate AI usage policy              [+4]

    Type C (Config):
      - missing-gitignore: Add .env to .gitignore             [+2]
    ```
  </Tab>

  <Tab title="Apply all">
    ```bash theme={null}
    complior fix
    ```
  </Tab>

  <Tab title="With AI">
    ```bash theme={null}
    complior fix --ai
    ```
  </Tab>

  <Tab title="From eval">
    ```bash theme={null}
    complior fix --source eval
    ```
  </Tab>
</Tabs>

## Fix types

| Type             | What it does                                                  | Example                                    |
| ---------------- | ------------------------------------------------------------- | ------------------------------------------ |
| **A (Code)**     | Modifies source files — adds imports, injects compliance code | Disclosure, logging, error handling        |
| **B (Document)** | Creates new files — compliance documents, policies            | FRIA, AI Policy, Worker Notification       |
| **C (Config)**   | Updates configuration — .gitignore, .env, package.json        | Secret externalization, dependency updates |

## Undo

Fixes are recorded in the evidence chain. To undo the last fix:

```bash theme={null}
# In TUI: press U on the Fix page
# Via API: POST /fix/undo
```

<Warning>
  Document generation (Type B) creates new files. Undo deletes those files. Code fixes (Type A) are reverted to the original content.
</Warning>
