mix mob.new_plugin (mob_dev v0.5.17)

Copy Markdown View Source

Generates the skeleton for a new mob plugin under plugins/<name>/.

mix mob.new_plugin <name> [--tier <0|1|2>] [--dest <DIR>]

Tiers (per MOB_PLUGINS.md):

  • 0 (default) — pure-Elixir helpers. No manifest, no native code.
  • 1 — native NIF + Elixir wrapper. Manifest with :nifs; ships an Erlang NIF stub and the matching C source. Wired into the build by MobDev.Plugin.Merge.nifs/1 + the build.zig -Dplugin_c_nifs arg.
  • 2 — native UI component via Mob.UI.native_view + Mob.Component. Manifest with :ui_components; ships an Elixir Mob.Component module, the matching Kotlin Composable, and a Swift View placeholder.

Options

  • --tier <0|1|2> — plugin tier; defaults to 0.
  • --dest <DIR> — destination directory; defaults to plugins/<name> relative to the current working directory.

Activating

After scaffolding:

# mix.exs
defp deps, do: [{:<name>, path: "plugins/<name>"} | ]

# mob.exs
config :mob, :plugins, [:<name>]