Commands

Here are some useful shell (etc) commands for use with Elixir.

IEx

# In shell
iex                           # start IEx
iex foo.ex                    # start IEx on foo.ex file
iex -S mix                    # start IEx on current project

# In IEx
c "foo.exs"                   # compile and run foo.exs file
cd "~"                        # return to home directory
clear, ls, pwd                # run named Unix command
h                             # get help
h System                      # get help for System module
ls "foo"                      # list directory "foo"
System.halt                   # halt the EVM and exit
v N                           # value of IEx line N

Mix

mix compile                   # compile current project
mix do deps.get, compile      # get dependencies and compile
mix docs                      # generate documentation
mix escript build             # build an escript (zip archive)
mix help                      # get help for Mix
mix help <t>                  # get help for task <t>
mix new <p>                   # create file tree for project <p> 
mix run <c>                   # run command <c>
mix run -e 'Foo.bar(42)'      # run a specified function 
mix test                      # run all tests
mix test --trace              # run all tests, tracing execution
mix test test/<f>:4           # run test at line 4 of <f>

Other Shell

elixir foo.exs                # compile and run foo.exs file
elixirc bar.ex                # compile bar.ex file


This wiki page is maintained by Rich Morin, an independent consultant specializing in software design, development, and documentation. Please feel free to email comments, inquiries, suggestions, etc!

Topic revision: r7 - 04 Feb 2015, RichMorin
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email