# `mix phoenix_kit.install`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.102/lib/mix/tasks/phoenix_kit.install.ex#L2)

Igniter installer for PhoenixKit.

This task automatically installs PhoenixKit into a Phoenix application by:
1. Auto-detecting and configuring Ecto repo
2. Setting up mailer configuration for development and production
3. Modifying the router to include PhoenixKit routes

## Usage

The recommended one-command install (adds the dep, fetches, and runs this task):

```bash
mix igniter.install phoenix_kit
```

Requires the `igniter_new` archive (one-time setup, same as `phx_new`):

```bash
mix archive.install hex igniter_new
```

If `:phoenix_kit` is already in your project's deps, run the task directly:

```bash
mix phoenix_kit.install
```

With custom options:

```bash
mix igniter.install phoenix_kit --repo MyApp.Repo --router-path lib/my_app_web/router.ex
```

## Options

* `--repo` - Specify Ecto repo module (auto-detected if not provided)
* `--router-path` - Specify custom path to router.ex file
* `--prefix` - Specify PostgreSQL schema prefix (defaults to "public")
* `--create-schema` - Create schema if using custom prefix (default: true for non-public prefixes)

## Auto-detection

The installer will automatically:
- Detect Ecto repo from `:ecto_repos` config or common naming patterns (MyApp.Repo)
- Find main router using Phoenix conventions (MyAppWeb.Router)
- Configure Swoosh.Adapters.Local for development in config/dev.exs
- Provide production mailer setup instructions

## Note about warnings

You may see a compiler warning about "unused import PhoenixKitWeb.Integration".
This is normal behavior for Elixir macros and can be safely ignored.
The `phoenix_kit_routes()` macro is properly used and will expand correctly.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
