MIX(1)
π MIX(1) β the software project management tool π
ok so bestie. this is the manual page for mix, from the General Commands Manual, and honestly? she's iconic. let's get into it π«Ά
β¨ NAME β¨
mix β The software project management tool
πΈ SYNOPSIS πΈ
mix [TASK] [project_name]
elixir [OPTIONS] -S mix [TASK] [project_name]
π¦ DESCRIPTION π¦
so mix is out here doing two jobs at once and slaying both: it organizes your code into projects, and then it maintains them. for the maintenance part it's got some genuinely advanced features β dependency management, packaging, preparing documentation, testing, the whole little buffet π
look at the SYNOPSIS again, specifically the second way of running it. the tea is that mix is literally just an Elixir script. that's it. so you can invoke it through elixir(1) exactly like any other script, and that's lowkey useful when you wanna run mix with particular options. periodt.
π DEFINITIONS π
all of the mix functionality lives inside a set of tasks. a task is a piece of code written in Elixir that's meant to solve one particular problem. like programs, a lot of tasks take input parameters and/or support options that slightly modify their behavior β but some of them just don't, and that's fine too, we don't judge π
there are two types of tasks:
- local tasks β the ones that become available after you install this or that archive
- built-in tasks β the ones offered by
mixitself
and the run task gets executed by default if you haven't specified any other one. no cap.
even though the greater part of mix is tasks, this man page does not contain the help info for each individual one, because mix is self-descriptive like that β¨. so just use the help task and you can pull up both the full list of local/built-in tasks and the info for a particular task. iykyk.
two more definitions, quick fire:
- An archive, in terms of Erlang/OTP, is the ZIP file with the
.ezextension which contains a precompiled OTP application with all its dependencies [1]. - An application is an entity that helps to combine sets of components into a single unit to simplify their reusing in other systems [2].
π ENVIRONMENT π
MIX_ARCHIVESβ lets you specify the directory into which the archives should be installed (seemix help archive.install). by default the~/.mix/archivesdirectory is used for this purpose.MIX_DEBUGβ when it's set, it outputs debug information about each task before running it.MIX_ENVβ lets you specify which environment should be used. thedevenvironment is used by default if you haven't specified another one.
sometimes you genuinely have to use a particular set of configuration parameter values, or perform particular steps when you compile or run a project (or in some other cases, bestie, life is chaos). the mix environments let you group values of configuration parameters and steps together so you can switch between them by specifying the necessary environment via MIX_ENV. chef's kiss π©βπ³π
MIX_TARGETβ lets you specify which target should be used. thehosttarget is used by default if you haven't specified another one.MIX_EXSβ lets you change the full path to themix.exsfile (see the FILES section). the most obvious use case is having more than one copy ofmix.exsin a project, but it's worth noting thatMIX_EXSshould be used only if themixenvironments (see above) are not enough to solve the problem. like, don't reach for it first, okay? πMIX_HOMEβ path to Mix's home directory, stores configuration files and scripts used by MixMIX_INSTALL_DIRβ Specifies directory whereMix.install/2keeps installs cacheMIX_INSTALL_FORCEβ RunsMix.install/2with empty install cacheMIX_PATHβ lets you expand the code path. if theMIX_PATHenvironment variable has a value which consists of multiple paths, they must be colon-separated (for Unix-like operating systems) or semicolon-separated (for Windows).
as mentioned above, there are two types of tasks: local and built-in. these tasks are always visible to mix because the directories they live in are part of the code path. so if a task belongs to neither one type nor the other, MIX_PATH is how you tell mix where it should search for that task. communication, queen π
MIX_QUIETβ when it's set, it does not print information messages to the terminal. silence. blessed silence. π€«
π FILES π
mix.exsβ Contains the most significant information related to the project, such as its name, version, list of dependencies and so on. as a rule, the file is namedmix.exsand located at the top of the project's source tree, but you can change the full path to it using theMIX_EXSenvironment variable (see the ENVIRONMENT section). she's flexible πmix.lockβ Allows locking down the project dependencies with a proper version range before performing any updates. it's useful when you know that your project is incompatible with newer versions of certain dependencies. the file is located at the top of the project's source tree as well asmix.exs(see above).
β REFERENCES β
[1] https://www.erlang.org/doc/man/code.html#id103620
[2] https://www.erlang.org/doc/design_principles/applications.html
π₯ SEE ALSO π₯
π 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 π§
- Main website: https://elixir-lang.org
- Documentation: https://elixir-lang.org/docs.html
- Package manager: https://hex.pm
ok that's the whole page, you're fully caught up bestie β¨ one last thing before you go: this beauty ships from Debian and she's dated May 27, 2015 β a vintage icon, honestly, still serving ππ go write something amazing, mwah π«Ά
π¦ where this page comes from
- alpine 3.24: elixir-doc 1.19.7-r0 Β· Apache-2.0
- arch rolling: elixir 1.20.4-1 Β· Apache-2.0
- fedora 43: elixir 1.19.6-2.fc43 Β· Apache-2.0
- fedora 44: elixir 1.19.5-4.fc44 Β· Apache-2.0
- fedora 44: elixir 1.19.6-2.fc44 Β· Apache-2.0
- nixos 26.05: elixir 1.20.5
- nixpkgs unstable: elixir 1.20.5
- ubuntu stonking: elixir 1.20.1.dfsg-2ubuntu2 Β· Apache-2.0
- π the page's license: Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms