Clojure has
lein new
, Elixir hasmix new
and now Elm haselm new
!
With elm new
you can easily start a new Elm project from the command line.
The idea is to be able to start coding right away instead of wasting time setting up the initial Elm architecture boilerplate. This is especially useful if you do a lot of prototyping.
- No dependencies β all you need is a shell (like bash, zsh, fish, etc.)
- Very simple to install and use. Auto-completion included.
- 100% test covered. It just works!
Simply choose between:
- sandbox β good for learning about the Elm Architecture
- element β an Elm application embedded in an HTML element
- document β an application that has control over the full HTML document
- application β a single-page app
elm-new # Initialize a Browser.document in the current directory
elm-new my-project # Initialize a Browser.document in my-project/
elm-new my-project --beginner # Initialize a Browser.sandbox in my-project/
elm-new my-spa --navigation # Initialize a Browser.application in my-spa/
elm-new hello --hello-world # Initialize a "Hello, world!" program in hello/
elm-new --version # Prints the installed version
elm-new --help # Prints all possible commands
$ elm-new my-awesome-project
my-awesome-project
βββ .gitignore
βββ README.md
βββ elm.json
βββ src
βββ Main.elm
1 directory, 4 files
Your Elm program has been created successfully.
You can use "elm make" to compile it:
cd my-awesome-project
elm make src/Main.elm
Run "elm" for more commands.
Linux, Mac OS X and Windows are supported.
npm install -g elm-new
yarn global add elm-new
choco install elm-new
brew install simonewebdesign/tap/elm-new
git clone https://github.com/simonewebdesign/elm-new
cd elm-new && sudo make install
See here for other installation options.
Older versions of Elm are also supported:
- Elm 0.19 => elm-new v2.0.0+
- Elm 0.18 => elm-new v1.3.0
- Elm 0.17 => elm-new v1.1.3
- Elm 0.16 => elm-new v0.1.0
So, for example, if you're using Elm 0.18, you'll want to grab elm-new v1.3.0. You can either install it via brew
or npm
, or download it straight from the releases page.
The choices also differ depending on the Elm version. For example, for Elm 0.18 you could choose between:
Html.program
β the default. Run:elm-new my-project-name
Html.beginnerProgram
β good for learning. Run:elm-new my-project --beginner
Navigation.program
β SPA with routing. Run:elm-new my-project --navigation
Contributors are welcome! Just fork this repo and start hacking away.
Make sure to check out CONTRIBUTING.md to get started.