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

# fallow migrate

> CLI reference for fallow migrate. Automatically convert your existing knip or jscpd configuration to fallow's config format.

Auto-migrate your existing knip and/or jscpd configuration to fallow. The migrate command reads your current config, translates it to fallow's format, and writes a new config file.

<Info>
  If both knip and jscpd configs exist in your project, fallow merges them into a single unified config.
</Info>

<Tip>
  Use `--dry-run` to preview the generated config before writing anything to disk.
</Tip>

```bash theme={null}
fallow migrate
```

## Options

| Flag            | Description                                                                                                                                                                                                                                                                |
| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--toml`        | Output as `fallow.toml` (mutually exclusive with `--jsonc`)                                                                                                                                                                                                                |
| `--jsonc`       | Write to `.fallowrc.jsonc` instead of `.fallowrc.json`. The generated content is the same JSONC (with `//` comments) either way; the `.jsonc` extension lets editors auto-detect JSON-with-comments syntax highlighting and silences linters that flag comments in `.json` |
| `--dry-run`     | Preview the generated config without writing                                                                                                                                                                                                                               |
| `--from <PATH>` | Path to the config file to migrate                                                                                                                                                                                                                                         |

<Tip>
  Without `--jsonc` or `--toml`, fallow auto-mirrors the source extension: a `knip.jsonc` migration writes `.fallowrc.jsonc`, a `knip.json` migration writes `.fallowrc.json`. The fallow config parser accepts comments in both extensions.
</Tip>

## What it detects

Fallow auto-detects:

* `knip.json`, `knip.jsonc`, `.knip.json`, `.knip.jsonc`, `knip.ts`, `knip.config.ts`
* `knip` field in `package.json`

<Info>
  TypeScript config files (`knip.ts`, `knip.config.ts`) are detected but cannot be parsed. Convert to `knip.json` first, then re-run migrate.
</Info>

* `.jscpd.json`
* `jscpd` field in `package.json`

## Examples

<CodeGroup>
  ```bash Auto-detect theme={null}
  # Detect config files and migrate
  fallow migrate

  # Preview without writing
  fallow migrate --dry-run
  ```

  ```bash Output format theme={null}
  # Write as TOML
  fallow migrate --toml

  # Write as JSON (default)
  fallow migrate
  ```

  ```bash Specific file theme={null}
  # Migrate a specific config file
  fallow migrate --from config/knip.json
  ```
</CodeGroup>

Warnings are shown for any config fields that can't be migrated automatically.

## See also

<CardGroup cols={2}>
  <Card title="Migrating from knip" icon="right-left" href="/migration/from-knip">
    Detailed comparison and migration guide from knip.
  </Card>

  <Card title="Migrating from jscpd" icon="right-left" href="/migration/from-jscpd">
    Detailed comparison and migration guide from jscpd.
  </Card>
</CardGroup>
