mix corex.new (corex_new v0.2.0)

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 the corex_design dependency and live design build. Ships a static neo/light assets/corex/ export (all components) you can edit or delete. Cannot combine with --mode, --theme, or --a11y. 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.
  • --a11y - preference axes (text, contrast, motion, cursor, focus, links), plug, LiveView hook, root-layout bridge, panel UI. Default off. Implies --design.
  • --lang - Localize + Gettext, path plug, locale scope helpers, language_switch.
  • --mcp / --no-mcp - when --mcp (default), adds {:corex_mcp, "~> 0.2", only: [:dev, :test]}, plug Corex.MCP on the endpoint in :dev / :test after Plug.Static, and writes .cursor/mcp.json pointing at http://localhost:4000/corex/mcp. Use --no-mcp for locked-down scaffolds. Never enable MCP in :prod or set allow_remote_access: true casually.
  • --usage-rules / --no-usage-rules - when --usage-rules (default), adds {:usage_rules, "~> 1.1", only: :dev} and usage_rules: usage_rules() (skills under .cursor/skills, package_skills: [:corex]).
  • --dev PATH - {:corex, path: PATH}, {:corex_design, path: PATH/design}, and relative corex.mjs import when building JS.
  • --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 --mode --theme --a11y
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