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

# Referência de comandos do MigraFlow CLI

> Sintaxe, argumentos, flags e exemplos de uso de todos os comandos do MigraFlow CLI para análise de schemas, geração de relatórios e revisão com IA.

## Sintaxe

```bash theme={null}
migraflow [sql_file] [context] [opções]
```

## Argumentos

| Argumento  | Descrição                                         | Exemplo                       |
| ---------- | ------------------------------------------------- | ----------------------------- |
| `sql_file` | Caminho para o arquivo `.sql` com o schema legado | `schema.sql`                  |
| `context`  | Contexto de negócio para melhorar o mapeamento    | `"ERP financeiro Oracle 11g"` |

## Opções

| Opção             | Descrição                                 | Padrão                                |
| ----------------- | ----------------------------------------- | ------------------------------------- |
| `--api-key`       | Chave de consultor                        | `MIGRAFLOW_API_KEY`                   |
| `--target`        | Dialeto de destino                        | `postgresql`                          |
| `--output`, `-o`  | Diretório de saída                        | `entrega_TIMESTAMP/`                  |
| `--review`        | Executa review de qualidade no SQL gerado | desativado                            |
| `--url`           | URL da API (para ambientes customizados)  | `https://api.migraflow.com.br/api/v1` |
| `--version`, `-v` | Exibe a versão instalada                  | —                                     |
| `--help`, `-h`    | Exibe ajuda                               | —                                     |

## Exemplos

### Análise básica

```bash theme={null}
migraflow schema.sql "sistema de RH Oracle 11g" --api-key mk_consultant_xxx
```

### Com review de qualidade

```bash theme={null}
migraflow schema.sql "ERP financeiro" --api-key mk_consultant_xxx --review
```

### Destino SQL Server

```bash theme={null}
migraflow schema.sql "legado MySQL" --api-key mk_consultant_xxx --target sqlserver
```

### Diretório de saída customizado

```bash theme={null}
migraflow schema.sql "contexto" --api-key mk_consultant_xxx --output ./entrega_cliente_abc
```

### Via variável de ambiente

```bash theme={null}
set MIGRAFLOW_API_KEY=mk_consultant_xxx
migraflow schema.sql "ERP Oracle 11g"
migraflow schema_v2.sql "ERP Oracle 11g" --review
```

## Targets suportados

| Valor        | Banco de destino        |
| ------------ | ----------------------- |
| `postgresql` | PostgreSQL 14+ (padrão) |
| `mysql`      | MySQL 8.x               |
| `sqlserver`  | SQL Server 2019+        |
