IEX(1)

๐Ÿ“ฆ
version 1.20.4 ยท 4 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu stonking

๐Ÿ’– IEX(1) โ€” the manual page, but make it a group chat ๐Ÿ’–

okay bestie, welcome to the iex manual page, straight out of the General Commands Manual โœจ this is literally your ticket to the Elixir shell, and I'm gonna walk you through every single flag like we're texting at 2am ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

iex โ€” The Elixir shell. that's it, that's the name, she's iconic ๐Ÿ’…


โœจ SYNOPSIS โœจ

iex [OPTIONS]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so the interactive shell is the whole vibe for evaluation, debugging and introspection of the Elixir runtime system ๐Ÿ’œ like, you get to poke the runtime and see what it does, live, no cap.

you can also use it for testing small pieces of code without going through the whole drama of saving that code in a file first. no file, no commitment, just vibes ๐ŸŒˆ


๐ŸŽ€ OPTIONS ๐ŸŽ€

ngl, a lot of these options were borrowed from the Erlang shell, so if you want extra lore you can hit up erl(1) as an additional source of info. iykyk ๐Ÿ“š

  • -h, --help โ€” displays the help message to the standard error (stderr) and exits. she leaves immediately, main character exit ๐Ÿ’…
  • -v, --version โ€” displays the Elixir version to the standard output (stdout) and exits. short and sweet ๐Ÿ“
  • -e, --eval expression โ€” evaluates the specified expression (see the --rpc-eval option). one-liner queen โœจ
  • -r file โ€” requires the specified file. in other words, the file gets checked for existence at the start of iex ๐Ÿ”
  • -S script โ€” runs the specified script. go off ๐ŸŽฌ
  • -pa directory โ€” adds the specified directory to the beginning of the code path. if the directory already exists, it will be removed from its old position and put to the beginning ๐Ÿ’ซ
    • see also the function Code.prepend_path/1.
  • -pr file โ€” does the same thing as -r (see above) but in parallel. multitasking icon ๐Ÿงš
  • -pz directory โ€” adds the specified directory to the end of the code path. if the directory already exists, it will be neither removed from its old position nor put to the end. lowkey stubborn, respect ๐Ÿ’€
    • see also the function Code.append_path/1.
  • --app application โ€” starts the specified application and all its dependencies. bring the whole squad ๐Ÿ‘‘
  • --boot file โ€” specifies the name of the boot file, file.boot, which is used to start the system. unless File contains an absolute path, the system searches for file.boot in the current and $ROOT/bin directories.
    • defaults to $ROOT/bin/start.boot.
    • the option is equivalent to Erlang's -boot.
  • --boot-var var dir โ€” if the boot script contains a path variable var other than $ROOT, this variable is expanded to dir. used when applications are installed in another directory than $ROOT/lib.
    • the option is equivalent to Erlang's -boot_var.
    • see also the function :systools.make_script/1,2 in SASL.
  • --erl parameters โ€” serves the same purpose as ELIXIR_ERL_OPTIONS (see the ENVIRONMENT section). โœจ
  • --erl-config file โ€” specifies the name of a configuration file, file.config, which is used to configure applications. note that the configuration file must be written in Erlang ๐Ÿซก
    • the option is equivalent to Erlang's -config.
  • --cookie value โ€” specifies the magic cookie value ๐Ÿ”ฎ if the value isn't specified via the option when the node starts, it will be taken from the file ~/.erlang.cookie (see the FILES section). distributed nodes can interact with each other only when their magic cookies are equal.
    • see also the function Node.set_cookie/2.
  • --hidden โ€” starts a hidden node. ๐Ÿ™ˆ
    • connections between nodes are transitive. for example, if node A is connected to node B, and node B is connected to node C, then node A is connected to node C. the option --hidden allows creating a node which can be connected to another node, escaping redundant connections.
    • the function Node.list/0 allows getting the list of nodes connected to the target node; however, the list won't include hidden nodes. depending on the input parameter, the function Node.list/1 allows getting the list which contains only hidden nodes (the parameter :hidden) or both hidden and not hidden nodes (the parameter :connected).
  • --logger-otp-reports val โ€” enables or disables OTP reporting (val can be either true or false).
  • --logger-sasl-reports val โ€” enables or disables SASL reporting (val can be either true or false).
  • --sname name โ€” gives a node a short name and starts it. short names take the form of name@host, where host is the name of the target host (hostname(1)) which runs the node. the nodes with short names can interact with each other only in the same local network ๐Ÿ 
  • --name name โ€” gives a node a long name and starts it. long names take the form of name@host, where host is the IP address of the host which runs the node. in contrast to the nodes with short names, the nodes with long names aren't limited by boundaries of a local network (see above). ๐ŸŒ
  • --pipe-to pipedir logdir โ€” starts the Erlang VM as a named pipedir and logdir (only for Unix-like operating systems). ๐Ÿง
  • --rpc-eval node expression โ€” evaluates the specified expression on the specified node (see the --eval option). remote queen behavior ๐Ÿ‘‘
  • --vm-args file โ€” reads the command-line arguments from file and passes them to the Erlang VM.
    • the option is equivalent to Erlang's -args_file.
  • --dot-iex file โ€” loads the specified file instead of .iex.exs (see the FILES section). ๐Ÿ“
  • --remsh node โ€” connects to the specified node which was started with the --sname or --name options (see above). ๐Ÿ”Œ
  • -- โ€” separates the options passed to the compiler from the options passed to the executed code. the great divider, honestly ๐Ÿšง

๐Ÿ“ NOTES ๐Ÿ“

these following options can be given more than once: --boot-var, --erl-config, --eval, --rpc-eval. yeah she's flexible like that ๐Ÿ’…


๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

  • ELIXIR_ERL_OPTIONS โ€” allows passing parameters to the Erlang runtime. โœจ

๐Ÿงš FILES ๐Ÿงš

  • ~/.erlang.cookie โ€” stores the magic cookie value which is used only when it wasn't specified via the option --cookie (see above). if the file doesn't exist when a node starts, it will be created. ๐Ÿ”ฎ
  • .iex.exs โ€” after iex starts, it seeks the file .iex.exs and, in a case of success, executes the code from the file in the context of the shell. at first the search starts in the current working directory; then, if necessary, it continues in the home directory. ๐Ÿก

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

elixir(1), elixirc(1), mix(1)


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Elixir is maintained by The Elixir Team.

This manual page was contributed by Evgeny Golyshev.

Copyright (c) 2012 Plataformatec.

Copyright (c) 2021 The Elixir Team.


๐ŸŒ INTERNET RESOURCES ๐ŸŒ


and that's the whole page bestie ๐Ÿฅน this one shipped out from Debian and it's dated February 3, 2019 โ€” go read it in the wild, you're gonna slay ๐Ÿ’…โœจ๐Ÿ’–

๐Ÿ“ฆ where this page comes from