Igniter installer for PhoenixKit.
This task automatically installs PhoenixKit into a Phoenix application by:
- Auto-detecting and configuring Ecto repo
- Setting up mailer configuration for development and production
- Modifying the router to include PhoenixKit routes
Usage
The recommended one-command install (adds the dep, fetches, and runs this task):
mix igniter.install phoenix_kit
Requires the igniter_new archive (one-time setup, same as phx_new):
mix archive.install hex igniter_new
If :phoenix_kit is already in your project's deps, run the task directly:
mix phoenix_kit.install
With custom options:
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"). Must match[a-z_][a-z0-9_]*(validated; the install aborts otherwise). A non-public prefix is persisted asconfig :phoenix_kit, prefix:(in config.exs and test.exs), baked into the generated migration, and written into the generated Oban config asprefix:.--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_reposconfig or common naming patterns (MyApp.Repo). With MULTIPLE repos detected, the install halts and requires--repo(guessing between e.g. a runtime repo and a migration-only repo is unsafe) - 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.