Skip to content
Basis of an open templating system for mix. Also see mix_gen
Branch: master
Clone or download
Latest commit ff84eab Dec 27, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Protect against bad project names Jul 17, 2018
.gitignore initial load—do not use Apr 10, 2017
ChangeLog push 0.1.12 May 18, 2017 initial load—do not use Apr 10, 2017 Add link from readme to MixTemplate module source code May 25, 2018
mix.exs force version update because I messed up hex Nov 16, 2017

Mix Template—create customized directory trees

The templating package that allows you to create custom directory trees for your Elixir project.

Manage the local installation and uninstallation of templates used by mix gen.


$ mix archive.install hex mix_templates

You probably also need to install the generator:

$ mix archive.install hex mix_generator


A high-level summary:

  • mix template

    List the locally installed templates.

  • mix template.hex

    List the templates available on hex.

  • mix template.install «source»

    Install a template from source.

  • mix template.uninstall «name»

    Uninstall the template with the given name.

  • `mix template «name» --help

    Get template-specific help. Useful to discover the extra options a template supports.

The «source» can be

    the path to a local directory tree containing the template

git https://path/to/git/repo
git https://path/to/git/repo branch git_branch
git https://path/to/git/repo tag git_tag
git https://path/to/git/repo ref git_ref
    install from a git repository

github user/project
github user/project branch git_branch
github user/project tag git_tag
github user/project ref git_ref
    install from github from the given user and project

hex hex_package
hex hex_package 1.2.3
    install from a hex package. Use mix template.hex to find
    available packages.

Templates are installed in $MIX_HOME/templates (by default ~/.mix/templates).


Details for each individual task can be found using mix help template, mix help tmplate.hex and so on.

See Mix.Tasks.Gen (in project :mix_generator) for details of how to use these templates.


Apache 2.0. See for details.

See also

For information on writing your own templates, see the moduledoc for MixTemplates, also in this package.

You can’t perform that action at this time.