mix corex.new (corex_new v0.1.0-rc.1)

Copy Markdown View Source

Creates a new Phoenix application with Corex installed.

Install archives:

mix archive.install hex phx_new
mix archive.install hex corex_new

mix corex.new PATH runs mix phx.new PATH --no-install with forwarded Phoenix flags, then writes Corex-owned files and patches into that app. --no-install is always passed to Phoenix so dependency fetching stays under Corex control.

LiveView, HTML, esbuild, and the default Phoenix asset setup are always on - Corex does not forward --no-live, --no-html, --no-esbuild, or --no-assets.

mix phx.new --dev (Phoenix from a Git checkout) is not forwarded. --dev on this task means a Corex path dependency only.

Corex-only options

  • --no-design - skip copying consumer design assets into assets/corex/ and omit Corex design @import blocks in app.css. Default is --design (design on).
  • --tailwind / --no-tailwind - Tailwind in the generated Phoenix app defaults on. --no-tailwind is forwarded to phx.new only together with --no-design. If --design is on, --no-tailwind is ignored (Corex design CSS expects Tailwind).
  • --mode - plugs, mode toggle, root-layout bridge for light/dark. Implies --design.
  • --theme - themes (Neo/Uno/Duo/Leo), plugs, theme toggle, layout bridge. Implies --design.
  • --lang - Localize + Gettext, path plug, locale scope helpers, language_switch.
  • --designex - copy token sources into assets/corex/design/, add :designex, asset aliases. Implies --design.
  • --mcp / --no-mcp - when --mcp (default), plug Corex.MCP is added to the endpoint in :dev / :test after Plug.Static.
  • --dev PATH - {:corex, path: PATH} and relative corex.mjs import when building JS; design copies from that checkout when --design is on.
  • --install / --no-install - whether Corex runs mix deps.get in the new project after generation (prompt if omitted). Does not change Phoenix’s --no-install step.

Options forwarded to mix phx.new

Same semantics as Phoenix’s installer - see mix help phx.new on Hexdocs.

Supported switches include for example:

  • --database (postgres, mysql, sqlite3, mssql, …)
  • --adapter (bandit, cowboy)
  • --app, --module, --web-module, --prefix
  • --binary-id, --verbose, --inside-docker-env
  • --no-dashboard, --no-mailer, --no-gettext, --no-version-check

--no-ecto is rejected (Corex expects Ecto in generated apps).

--no-gettext is incompatible with --lang.

--umbrella is not supported here yet; use mix phx.new --umbrella and guides/manual_installation.md.

After generation

The installer prints Phoenix-style follow-up steps (cd, mix deps.get when dependencies were not fetched, database setup when Ecto is enabled, mix assets.setup / mix assets.build, optional mix localize.download_locales with --lang, then mix phx.server / iex -S mix phx.server).

Examples

mix corex.new hello_world
mix corex.new my_app --mode --theme --lang
mix corex.new my_app --no-design --no-tailwind
mix corex.new my_app --dev ../corex

To update the generator before creating a project:

mix local.corex
mix corex.new my_app