# \#generators

**URL:** https://forum.elixirforum.com/tag/generators/1180.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Phx\_new is over 9000! New users coming strong](https://forum.elixirforum.com/t/phx-new-is-over-9000-new-users-coming-strong/74433)

<div class="topic-metadata">

**Author:** [@netoum](https://forum.elixirforum.com/u/netoum)\
**Replies:** 3\
**Last updated:** [February 27, 2026, 6:59am UTC](https://forum.elixirforum.com/t/phx-new-is-over-9000-new-users-coming-strong/74433 "2026-02-27T06:59:28Z")

</div>

Phoenix generators are fighting back :laughing: Ok, it is not over 9000 but got a sudden increase recently. Going from 800 to over 3000, maybe more, it broke the graph. Very curious the reason behind it, maybe someone …

---

## [Project - Automate common Phoenix tasks so you can start building your idea faster](https://forum.elixirforum.com/t/project-automate-common-phoenix-tasks-so-you-can-start-building-your-idea-faster/73867)

<div class="topic-metadata">

**Author:** [@marcxrand](https://forum.elixirforum.com/u/marcxrand)\
**Replies:** 5\
**Last updated:** [January 15, 2026, 7:06pm UTC](https://forum.elixirforum.com/t/project-automate-common-phoenix-tasks-so-you-can-start-building-your-idea-faster/73867 "2026-01-15T19:06:01Z")

</div>

Why? Every time I start a new Phoenix project, I find myself doing the same repetitive stuff: swapping esbuild for Bun, adding Oban, configuring Credo, removing DaisyUI components I don’t need, setting up pgvector, etc…

---

## [Would one-time self-replacing macro/compile-time-function instead of CLI generators be possible?](https://forum.elixirforum.com/t/would-one-time-self-replacing-macro-compile-time-function-instead-of-cli-generators-be-possible/71767)

<div class="topic-metadata">

**Author:** [@Petr](https://forum.elixirforum.com/u/Petr)\
**Replies:** 2\
**Last updated:** [July 21, 2025, 4:40pm UTC](https://forum.elixirforum.com/t/would-one-time-self-replacing-macro-compile-time-function-instead-of-cli-generators-be-possible/71767 "2025-07-21T16:40:02Z")

</div>

There is an example in Ash Framework of adding a resource Album into Music domain mix ash.gen.resource Tunez.Music.Album --extend postgres. It generates a new module Album and modifies Music module – adding the Album in…

---

## [devenv\_new – Mix task wrapper to create projects in a new devenv.sh Nix environment](https://forum.elixirforum.com/t/devenv-new-mix-task-wrapper-to-create-projects-in-a-new-devenv-sh-nix-environment/71671)

<div class="topic-metadata">

**Author:** [@serpent](https://forum.elixirforum.com/u/serpent)\
**Replies:** 17\
**Last updated:** [July 17, 2025, 4:46pm UTC](https://forum.elixirforum.com/t/devenv-new-mix-task-wrapper-to-create-projects-in-a-new-devenv-sh-nix-environment/71671 "2025-07-17T16:46:11Z")

</div>

A Mix task that wraps any Elixir Mix project generator in a devenv.sh environment. Note that you can install Nix on top of macOS or most Linux distros without requiring a full NixOS setup. Installation Install the arch…

---

## [Thinking Elixir 259 - Chris McCord on phoenix.new](https://forum.elixirforum.com/t/thinking-elixir-259-chris-mccord-on-phoenix-new/71505)

<div class="topic-metadata">

**Author:** [@brainlid](https://forum.elixirforum.com/u/brainlid)\
**Replies:** 1\
**Last updated:** [July 8, 2025, 9:53pm UTC](https://forum.elixirforum.com/t/thinking-elixir-259-chris-mccord-on-phoenix-new/71505 "2025-07-08T21:53:55Z")

</div>

Episode 259 of Thinking Elixir. News includes the public launch of Phoenix.new - Chris McCord’s revolutionary AI-powered Phoenix development service with full browser IDE and remote runtime capabilities, Ecto v3.13 relea…

---

## [Igniter is cool. Phoenix.new is cool. How can we help?](https://forum.elixirforum.com/t/igniter-is-cool-phoenix-new-is-cool-how-can-we-help/71014)

<div class="topic-metadata">

**Author:** [@kingdomcoder](https://forum.elixirforum.com/u/kingdomcoder)\
**Replies:** 8\
**Last updated:** [May 26, 2025, 11:21am UTC](https://forum.elixirforum.com/t/igniter-is-cool-phoenix-new-is-cool-how-can-we-help/71014 "2025-05-26T11:21:01Z")

</div>

I recently started playing with Igniter and it’s a great code generator already as it is. With Chris’ keynote, I can also see our trend as a community towards the next generation of codegen tools. My hunch is that Ignite…

---

## [Mix phx.gen\* Tweaking destinations for generated files and directories](https://forum.elixirforum.com/t/mix-phx-gen-tweaking-destinations-for-generated-files-and-directories/70359)

<div class="topic-metadata">

**Author:** [@DidactMacros](https://forum.elixirforum.com/u/DidactMacros)\
**Replies:** 6\
**Last updated:** [April 8, 2025, 1:51pm UTC](https://forum.elixirforum.com/t/mix-phx-gen-tweaking-destinations-for-generated-files-and-directories/70359 "2025-04-08T13:51:44Z")

</div>

When I use generators I can enforce some nesting for the contexts (and their associated schemas) but this does not seem to be the case for the web files, I’m also a bit worried with respect to the tests, is corresponding…

---

## [Igniter for Express -\> Ash rewrite?](https://forum.elixirforum.com/t/igniter-for-express-ash-rewrite/69586)

<div class="topic-metadata">

**Author:** [@Gonza](https://forum.elixirforum.com/u/Gonza)\
**Replies:** 2\
**Last updated:** [February 24, 2025, 11:29pm UTC](https://forum.elixirforum.com/t/igniter-for-express-ash-rewrite/69586 "2025-02-24T23:29:11Z")

</div>

Hey, I’m thinking about migrating a NodeJS backend to Ash. It’s one of those times in the life of a project where you start to think a full rewrite would be cheaper and better than fixing everything that’s been breaking …

---

## [No resources generated with ash\_postgres.gen.resources](https://forum.elixirforum.com/t/no-resources-generated-with-ash-postgres-gen-resources/68454)

<div class="topic-metadata">

**Author:** [@nano2007](https://forum.elixirforum.com/u/nano2007)\
**Replies:** 5\
**Last updated:** [January 2, 2025, 5:54am UTC](https://forum.elixirforum.com/t/no-resources-generated-with-ash-postgres-gen-resources/68454 "2025-01-02T05:54:13Z")

</div>

I am just getting started with Elixir, Ash etc., so most likely I am missing some configuration or step here. I tried to go through the docs and code but have no luck so far. When trying to generate a resource(s) from a…

---

## [Phx.gen.live with my custom field as 'id'](https://forum.elixirforum.com/t/phx-gen-live-with-my-custom-field-as-id/68048)

<div class="topic-metadata">

**Author:** [@pelopo](https://forum.elixirforum.com/u/pelopo)\
**Replies:** 9\
**Last updated:** [December 17, 2024, 10:13am UTC](https://forum.elixirforum.com/t/phx-gen-live-with-my-custom-field-as-id/68048 "2024-12-17T10:13:59Z")

</div>

When generating live views through phx.gen.live the entire set of table, schema and corresponding liveviews (.ex and heex), router links are generated with a default id field that is not even visually present in the sche…

---

## [AshAuthentication Igniter Installers](https://forum.elixirforum.com/t/ashauthentication-igniter-installers/66578)

<div class="topic-metadata">

**Author:** [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Replies:** 3\
**Last updated:** [November 8, 2024, 3:31pm UTC](https://forum.elixirforum.com/t/ashauthentication-igniter-installers/66578 "2024-11-08T15:31:17Z")

</div>

:police\_car\_light: New AshAuthentication Installers :police\_car\_light: The AshAuthentication igniter installers are released! Today on stream, we wrapped up the first (and hardest) strategy generator, for password auth …

---

## [Getting "protocol Phoenix.HTML.FormData not implemented" from \`phx.gen.live\` generated code](https://forum.elixirforum.com/t/getting-protocol-phoenix-html-formdata-not-implemented-from-phx-gen-live-generated-code/64905)

<div class="topic-metadata">

**Author:** [@ostap](https://forum.elixirforum.com/u/ostap)\
**Replies:** 1\
**Last updated:** [July 17, 2024, 4:10am UTC](https://forum.elixirforum.com/t/getting-protocol-phoenix-html-formdata-not-implemented-from-phx-gen-live-generated-code/64905 "2024-07-17T04:10:41Z")

</div>

Hi. I ran this command: mix phx.gen.live Forms Form forms domain:string bg\_color:string primary\_color:string title:string description:text Then ran the migrations and added routes to the web scope. However, when I try…

---

## [Did anything come of %MyApp.Scope{} from Chris McCord's ElixirConf 2023 Field Notes?](https://forum.elixirforum.com/t/did-anything-come-of-myapp-scope-from-chris-mccords-elixirconf-2023-field-notes/63672)

<div class="topic-metadata">

**Author:** [@gregjohnson](https://forum.elixirforum.com/u/gregjohnson)\
**Replies:** 4\
**Last updated:** [May 20, 2024, 11:09pm UTC](https://forum.elixirforum.com/t/did-anything-come-of-myapp-scope-from-chris-mccords-elixirconf-2023-field-notes/63672 "2024-05-20T23:09:13Z")

</div>

Did anything come of the additional struct for user connection variables: %MyApp.Scope{ user: ..., org: ...., user\_agent: ..., client\_ip: ..., } from Chris McCord’s ElixirConf 2023 Field Notes @ 05:07?

---

## [Ecto changeset generated with phx.gen.context does not require id for update](https://forum.elixirforum.com/t/ecto-changeset-generated-with-phx-gen-context-does-not-require-id-for-update/63552)

<div class="topic-metadata">

**Author:** [@poipoi](https://forum.elixirforum.com/u/poipoi)\
**Replies:** 7\
**Last updated:** [May 15, 2024, 11:22am UTC](https://forum.elixirforum.com/t/ecto-changeset-generated-with-phx-gen-context-does-not-require-id-for-update/63552 "2024-05-15T11:22:31Z")

</div>

Hi everyone, When you generate a context with phx.gen.context, the generator creates a changeset function in the schema file that casts certain attributes and marks others as required. However, the id is neither cast no…

---

## [How to use phx.gen.html in an Ash setup?](https://forum.elixirforum.com/t/how-to-use-phx-gen-html-in-an-ash-setup/58809)

<div class="topic-metadata">

**Author:** [@wintermeyer](https://forum.elixirforum.com/u/wintermeyer)\
**Replies:** 20\
**Last updated:** [October 11, 2023, 5:02am UTC](https://forum.elixirforum.com/t/how-to-use-phx-gen-html-in-an-ash-setup/58809 "2023-10-11T05:02:47Z")

</div>

I have a minimal Ash, PostgreSQL and Phoenix setup in which I do a mix phx.gen.html Shop Product products name:string price:float --no-context Obviously the controller doesn’t work out of the box. With some minor chang…

---

## [How is it possible to install older versions of Phoenix and Liveview?](https://forum.elixirforum.com/t/how-is-it-possible-to-install-older-versions-of-phoenix-and-liveview/58631)

<div class="topic-metadata">

**Author:** [@ppicom](https://forum.elixirforum.com/u/ppicom)\
**Replies:** 4\
**Last updated:** [October 3, 2023, 6:05pm UTC](https://forum.elixirforum.com/t/how-is-it-possible-to-install-older-versions-of-phoenix-and-liveview/58631 "2023-10-03T18:05:39Z")

</div>

Hi! I’m running the latest version of Phoenix and LiveView, which is making it very hard for me to follow the book “Programming Phoenix LiveView” (I am new to the elixir ecosystem). That’s why I decided to downgrade, but…

---

## [Nitpick: confirm\_changeset should be renamed to confirmation\_changeset](https://forum.elixirforum.com/t/nitpick-confirm-changeset-should-be-renamed-to-confirmation-changeset/58607)

<div class="topic-metadata">

**Author:** [@chocolatedonut](https://forum.elixirforum.com/u/chocolatedonut)\
**Replies:** 1\
**Last updated:** [October 1, 2023, 11:50am UTC](https://forum.elixirforum.com/t/nitpick-confirm-changeset-should-be-renamed-to-confirmation-changeset/58607 "2023-10-01T11:50:11Z")

</div>

Looking at the generated code, there’re email\_changeset and other \<noun\>\_changesets. Hence, for consistency, confirm\_changeset should be renamed (in the generators) to confirmation\_changeset. Confirm = verb Confirmatio…

---

## [Modifying Phoenix Generator and Failing to Maintain Old Behavior](https://forum.elixirforum.com/t/modifying-phoenix-generator-and-failing-to-maintain-old-behavior/58272)

<div class="topic-metadata">

**Author:** [@dewetblomerus](https://forum.elixirforum.com/u/dewetblomerus)\
**Replies:** 4\
**Last updated:** [September 15, 2023, 7:56pm UTC](https://forum.elixirforum.com/t/modifying-phoenix-generator-and-failing-to-maintain-old-behavior/58272 "2023-09-15T19:56:22Z")

</div>

@victorbjorklund thanks for your @ThinkingElixir #167 on Phoenix Generators. This would solve a problem at work where we want all new services to have certain observability libraries installed and to respond to a health…

---

## [Phoenix Blog Post: Customizing Phoenix Generators](https://forum.elixirforum.com/t/phoenix-blog-post-customizing-phoenix-generators/58227)

<div class="topic-metadata">

**Author:** [@brainlid](https://forum.elixirforum.com/u/brainlid)\
**Replies:** 1\
**Last updated:** [September 11, 2023, 9:29pm UTC](https://forum.elixirforum.com/t/phoenix-blog-post-customizing-phoenix-generators/58227 "2023-09-11T21:29:02Z")

</div>

During a recent interview, I learned how easily the Phoenix generators can be customized for our projects. How did I not know this? Do others not know this? This post documents this invisible feature that’s easy to use a…

---

## [Podcast: Thinking Elixir 167 - Customizing mix phx.new?](https://forum.elixirforum.com/t/podcast-thinking-elixir-167-customizing-mix-phx-new/58092)

<div class="topic-metadata">

**Author:** [@brainlid](https://forum.elixirforum.com/u/brainlid)\
**Replies:** 0\
**Last updated:** [September 5, 2023, 12:17pm UTC](https://forum.elixirforum.com/t/podcast-thinking-elixir-167-customizing-mix-phx-new/58092 "2023-09-05T12:17:15Z")

</div>

Episode 167 of Thinking Elixir. We’ve all run “mix phx.new”, but have you ever thought to customize what that does? We talk with Victor Björklund who explains how we can create customized Phoenix project generators and w…

---

## [OpenAPI Generator - Generate client code from an OpanAPI description](https://forum.elixirforum.com/t/openapi-generator-generate-client-code-from-an-opanapi-description/54016)

<div class="topic-metadata">

**Author:** [@aj-foster](https://forum.elixirforum.com/u/aj-foster)\
**Replies:** 6\
**Last updated:** [August 17, 2023, 8:44pm UTC](https://forum.elixirforum.com/t/openapi-generator-generate-client-code-from-an-opanapi-description/54016 "2023-08-17T20:44:54Z")

</div>

Background OpenAPI is a standard for documenting API resources. Libraries like Spex allow you to generate OpenAPI descriptions of your endpoints to share with consumers. Then, the OpenAPI community provides a series of c…

---

## [Phx.gen missing primary keys and bad types in references](https://forum.elixirforum.com/t/phx-gen-missing-primary-keys-and-bad-types-in-references/56553)

<div class="topic-metadata">

**Author:** [@gcb](https://forum.elixirforum.com/u/gcb)\
**Replies:** 2\
**Last updated:** [June 16, 2023, 6:34pm UTC](https://forum.elixirforum.com/t/phx-gen-missing-primary-keys-and-bad-types-in-references/56553 "2023-06-16T18:34:02Z")

</div>

i’m not getting primary keys for phx.gen.html/json. mix phx.gen.html Content Community communities name:string:unique description:string user\_id:references:users resulted in def change do │ create table(:communiti…

---

## [Why are my auto generated LiveView tests failing?](https://forum.elixirforum.com/t/why-are-my-auto-generated-liveview-tests-failing/53436)

<div class="topic-metadata">

**Author:** [@LTheGreats](https://forum.elixirforum.com/u/LTheGreats)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 6:36pm UTC](https://forum.elixirforum.com/t/why-are-my-auto-generated-liveview-tests-failing/53436 "2023-01-29T18:36:12Z")

</div>

I have installed the latest Phoenix 1.7 release candidate, and created a new project with all of the default options. I ran the tests and they all passed. Then, I used the built in generators to create a new LiveView and…

---

## [Show the difference of the generators after a Phoenix update: phx.new , phx.gen.auth](https://forum.elixirforum.com/t/show-the-difference-of-the-generators-after-a-phoenix-update-phx-new-phx-gen-auth/53037)

<div class="topic-metadata">

**Author:** [@water](https://forum.elixirforum.com/u/water)\
**Replies:** 3\
**Last updated:** [January 7, 2023, 9:34pm UTC](https://forum.elixirforum.com/t/show-the-difference-of-the-generators-after-a-phoenix-update-phx-new-phx-gen-auth/53037 "2023-01-07T21:34:37Z")

</div>

Thought I’d post it. It might be useful to others. I used it to apply the changes to an existing project. #!/usr/bin/env bash if \[\[ $# == 0 \]\]; then printf "First parameter should be the phoenix version (eg. 1.7.0-r…

---

## [Phx.gen.html vs phx.gen.live](https://forum.elixirforum.com/t/phx-gen-html-vs-phx-gen-live/51574)

<div class="topic-metadata">

**Author:** [@water](https://forum.elixirforum.com/u/water)\
**Replies:** 1\
**Last updated:** [November 5, 2022, 5:52pm UTC](https://forum.elixirforum.com/t/phx-gen-html-vs-phx-gen-live/51574 "2022-11-05T17:52:58Z")

</div>

I’m reading, 1. Intro to Contexts — Phoenix v1.8.8, and it’s all about phx.gen.html. When would you use phx.gen.live instead? I generated both and they look similar/identical in the browser. They both use .heex files m…

---

## [How do you recreate the base HTML templates in Phoenix?](https://forum.elixirforum.com/t/how-do-you-recreate-the-base-html-templates-in-phoenix/51423)

<div class="topic-metadata">

**Author:** [@dfalling](https://forum.elixirforum.com/u/dfalling)\
**Replies:** 5\
**Last updated:** [October 30, 2022, 6:37pm UTC](https://forum.elixirforum.com/t/how-do-you-recreate-the-base-html-templates-in-phoenix/51423 "2022-10-30T18:37:23Z")

</div>

I stripped all the HTML templates, views, and layouts out of my Phoenix app years ago because it’s just been an API. I’m now converting it to a Phoenix LiveView app. Is there a way to recreate the base templates and lay…

---

## [How to \`--no-confirm\` mix phx tasks?](https://forum.elixirforum.com/t/how-to-no-confirm-mix-phx-tasks/46853)

<div class="topic-metadata">

**Author:** [@ahmed-es](https://forum.elixirforum.com/u/ahmed-es)\
**Replies:** 2\
**Last updated:** [March 28, 2022, 3:44pm UTC](https://forum.elixirforum.com/t/how-to-no-confirm-mix-phx-tasks/46853 "2022-03-28T15:44:49Z")

</div>

Hello everybody, how do I run something like mix phx.gen.html Abc abc --no-confirm? What happens without --no-confirm You are generating into an existing context. ... \* It's OK to have multiple resources in the sam…

---

## [Phx\_gen\_tailwind - easily add Tailwind to a new Phoenix 1.6+ project](https://forum.elixirforum.com/t/phx-gen-tailwind-easily-add-tailwind-to-a-new-phoenix-1-6-project/41999)

<div class="topic-metadata">

**Author:** [@kevinlang](https://forum.elixirforum.com/u/kevinlang)\
**Replies:** 3\
**Last updated:** [January 4, 2022, 2:10pm UTC](https://forum.elixirforum.com/t/phx-gen-tailwind-easily-add-tailwind-to-a-new-phoenix-1-6-project/41999 "2022-01-04T14:10:54Z")

</div>

Hey all, I created a phx.gen.tailwind Mix task that adds Node + TailwindCSS to a new Phoenix project. Essentially, it does the following steps for you: Copy over a package.json file into your assets/ directory with ta…

---

## [Context module name and Ecto schema module name for more than one word database tables](https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396)

<div class="topic-metadata">

**Author:** [@kalkatfyodor](https://forum.elixirforum.com/u/kalkatfyodor)\
**Replies:** 17\
**Last updated:** [December 11, 2021, 5:13pm UTC](https://forum.elixirforum.com/t/context-module-name-and-ecto-schema-module-name-for-more-than-one-word-database-tables/44396 "2021-12-11T17:13:54Z")

</div>

Normally, for a simple one word table, I would be using something like this: $ mix phx.gen.context Cars Car cars model:string price:string But what about if I want to have a table called cars\_all and cars\_from\_alternat…

---

## [Configuring Phoenix generator to use a default schema when creating ecto schema](https://forum.elixirforum.com/t/configuring-phoenix-generator-to-use-a-default-schema-when-creating-ecto-schema/41709)

<div class="topic-metadata">

**Author:** [@jonbirke0927](https://forum.elixirforum.com/u/jonbirke0927)\
**Replies:** 2\
**Last updated:** [August 21, 2021, 5:24pm UTC](https://forum.elixirforum.com/t/configuring-phoenix-generator-to-use-a-default-schema-when-creating-ecto-schema/41709 "2021-08-21T17:24:39Z")

</div>

Hello everyone, When using the phoenix generators to create a new context (i.e. mix phx.gen.context ContextName SchemaName table\_name column\_name:column\_type), I continually run into an issue where the default schema be…

[Next page](https://forum.elixirforum.com/tag/generators/1180.md?match_all_tags=true&page=1&tags%5B%5D=generators)
