REBAR3(1)

πŸ“¦
version 3.27.3 Β· 2 versions
, in alpine 3.24, arch rolling, fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– REBAR3(1) β€” the girlies' guide to the rebar3 manual page πŸ’–

General Commands Manual Β· REBAR3(1)

okay bestie, sit DOWN, because we're about to go through the entire rebar3 manual together and I promise it's gonna be more fun than it has any right to be. this is part 1 so don't you dare think we're done. πŸ’…


✨ NAME ✨

rebar3 β€” the tool for working with Erlang projects. that's it. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

rebar3 --version

rebar3 help

rebar3 command [options] ...

literally three shapes, that's all she wrote: ask for the version, ask for help, or run a command with some options tacked on the end. slay. ✨


✨ DESCRIPTION ✨

Rebar3 is an Erlang tool that makes it easy to create, develop, and release Erlang libraries, applications, and systems in a repeatable manner. no chaos, no "it worked on my machine", just repeatable. iconic behaviour honestly. πŸ’–

Full documentation at http://www.rebar3.org/ β€” go look, it's giving knowledge. πŸ“š


✨ ESSENTIAL COMMANDS ✨

okay so for the full command list you gotta scroll down to the COMMANDS section, but here's the starter pack, the main-character commands, the ones you'll actually be typing every single day.

Also real quick: with rebar3 help <task>, commands and plugins will display their own help information. so if you're lost, just ask. they'll tell you. 🫢

  • compile β€” Compile the current project. yes queen, build it. πŸ”₯
  • new (help [template])|template β€” Show information about templates or use one. templates are your little project blueprints. πŸŽ€
  • update β€” Fetch the newest version of the Hex index. gotta stay fresh, gotta stay updated, no cap. ✨
  • do command[,command,...] β€” Run one or more commands in a sequence. multiple commands, one girlboss move. πŸ‘‘
  • shell β€” Start the current project in a REPL. You can then use r3:do(task) to call it on the project without dropping the current state. this is the good stuff, keep your session alive while you poke at tasks. πŸ¦‹

✨ COMMANDS ✨

here we go, the full menu. every single one. no skipping, no summarising, we're eating the whole plate. πŸ“


as

Higher order provider for running multiple tasks in a sequence as a certain profiles.

(that's the original wording and I'm keeping it exactly, plural profiles and all, because facts are facts. 😌)


clean

clean [-a|--all] [-p|--profile]

Remove compiled beam files from apps.

  • -a, --all β€” Clean all apps include deps. everything. the whole closet. πŸ’€
  • -p, --profile β€” Clean under profile. Equivalent to rebar3 as <profile> clean.

compile

compile [-d|--deps_only]

Compile apps .app.src and .erl files.

  • -d, --deps_only β€” Only compile dependencies, no project apps will be built. deps only, your own apps get to nap. 😴

cover

cover [-r|--reset] [-v|--verbose] [-m|--min_coverage]

Perform coverage analysis.

  • -r, --reset β€” Reset all coverdata.
  • -v, --verbose β€” Print coverage analysis.
  • -m, --min_coverage β€” Mandate a coverage percentage required to succeed (0..100). yes, a number from 0 to 100, and yes, you have to hit it. no hiding from the numbers bestie. πŸ“Š

ct

ct [--dir] [--suite] [--group] [--case] [--label] [--config] [--spec]
[--join_specs] [--allow_user_terms] [--logdir] [--logopts] [--verbosity]
[-c|--cover] [--cover_export_name] [--repeat] [--duration] [--until]
[--force_stop] [--basic_html] [--stylesheet] [--decrypt_key]
[--decrypt_file] [--abort_if_missing_suites] [--multiply_timetraps]
[--scale_timetraps] [--create_priv_dir] [--include] [--readable]
[-v|--verbose] [--name] [--sname] [--setcookie] [--sys_config]
[--compile_only] [--retry]

Run Common Tests. this is the big one, the marathon, the ct girlies know. πŸƒβ™€οΈπŸ’¨

  • --dir β€” List of additional directories containing test suites
  • --suite β€” List of test suites to run
  • --group β€” List of test groups to run
  • --case β€” List of test cases to run
  • --label β€” Test label
  • --config β€” List of config files
  • --spec β€” List of test specifications
  • --join_specs β€” Merge all test specifications and perform a single test run
  • --allow_user_terms β€” Allow user defined config values in config files
  • --logdir β€” Log folder
  • --logopts β€” Options for common test logging
  • --verbosity β€” Verbosity
  • -c, --cover β€” Generate cover data
  • --cover_export_name β€” Base name of the coverdata file to write
  • --repeat β€” How often to repeat tests
  • --duration β€” Max runtime (format: HHMMSS)
  • --until β€” Run until (format: HHMMSS)
  • --force_stop β€” Force stop on test timeout (true | false | skip_rest)
  • --basic_html β€” Show basic HTML
  • --stylesheet β€” CSS stylesheet to apply to html output
  • --decrypt_key β€” Path to key for decrypting config
  • --decrypt_file β€” Path to file containing key for decrypting config
  • --abort_if_missing_suites β€” Abort if suites are missing
  • --multiply_timetraps β€” (yep, the original gives this one no description at all, so I'm not inventing one. it exists, it's there, that's the tea. πŸ«–)
  • --scale_timetraps β€” Scale timetraps
  • --create_priv_dir β€” Create priv dir (auto_per_run | auto_per_tc | manual_per_tc)
  • --include β€” Directories containing additional include files
  • --readable β€” Shows test case names and only displays logs to shell on failures (true | compact | false)
  • -v, --verbose β€” Verbose output
  • --name β€” Gives a long name to the node
  • --sname β€” Gives a short name to the node
  • --setcookie β€” Sets the cookie if the node is distributed
  • --sys_config β€” List of application config files
  • --compile_only β€” Compile modules in the project with the test configuration but do not run the tests
  • --retry β€” Experimental feature. If any specification for previously failing test is found, runs them.
⚠️ heads up bestie: --retry is marked Experimental feature in the original. experimental means experimental. don't be shocked if it does experimental things. πŸ™ˆ

deps

List dependencies. just... lists them. simple. clean. a little snack. πŸ“


dialyzer

dialyzer [-u|--update-plt] [-s|--succ-typings]

Run the Dialyzer analyzer on the project.

  • -u, --update-plt β€” Enable updating the PLT. Default: true
  • -s, --succ-typings β€” Enable success typing analysis. Default: true

both default to true btw, so dialyzer is doing the most right out of the box. πŸ”₯


do

Higher order provider for running multiple tasks in a sequence.


edoc

Generate documentation using edoc. docs are self care. πŸ“šβœ¨


escriptize

Generate escript archive.


eunit

eunit [--app] [--application] [-c|--cover] [--cover_export_name]
[-d|--dir] [-f|--file] [-m|--module] [-s|--suite] [-v|--verbose]
[--name] [--sname] [--setcookie]

Run EUnit Tests.

  • --app β€” Comma separated list of application test suites to run. Equivalent to [{application, App}].
  • --application β€” Comma separated list of application test suites to run. Equivalent to [{application, App}].
  • -c, --cover β€” Generate cover data. Defaults to false.
  • --cover_export_name β€” Base name of the coverdata file to write
  • -d, --dir β€” Comma separated list of dirs to load tests from. Equivalent to [{dir, Dir}].
  • -f, --file β€” Comma separated list of files to load tests from. Equivalent to [{file, File}].
  • -m, --module β€” Comma separated list of modules to load tests from. Equivalent to [{module, Module}].
  • -s, --suite β€” Comma separated list of modules to load tests from. Equivalent to [{module, Module}].
  • -v, --verbose β€” Verbose output. Defaults to false.
  • --name β€” Gives a long name to the node
  • --sname β€” Gives a short name to the node
  • --setcookie β€” Sets the cookie if the node is distributed
πŸ’€ not me noticing --module and --suite have the exact same description and the exact same [{module, Module}] equivalent. that's how the original rolls, so that's how we roll. copy it verbatim, don't "fix" it.

get-deps

Fetch dependencies. go get 'em. πŸƒβ™€οΈ


help

Display a list of tasks or help for a given task or subtask.


new

new [-f|--force]

Create new project from templates. baby's first project, so cute. πŸŽ€

  • -f, --force β€” overwrite existing files
⚠️ --force means overwrite existing files. like, actually overwrite them. be sure before you commit to that energy.

path

path [--app] [--base] [--bin] [--ebin] [--lib] [--priv] [-s|--separator]
[--src] [--rel]

Print paths to build dirs in current profile.

  • --app β€” Comma separated list of applications to return paths for.
  • --base β€” Return the `base' path of the current profile. (keeping that stray backtick exactly as the original has it, iykyk πŸ’…)
  • --bin β€” Return the `bin' path of the current profile.
  • --ebin β€” Return all `ebin' paths of the current profile's applications.
  • --lib β€” Return the `lib' path of the current profile.
  • --priv β€” Return the `priv' path of the current profile's applications.
  • -s, --separator β€” In case of multiple return paths, the separator character to use to join them.
  • --src β€” Return the `src' path of the current profile's applications.
  • --rel β€” Return the `rel' path of the current profile.

pkgs

List information for a package. πŸ“¦


release

release [-n|--relname] [-v|--relvsn] [-g|--goal] [-u|--upfrom]
[-o|--output-dir] [-h|--help] [-l|--lib-dir] [-p|--path] [--default-
libs] [-V|--verbose] [-d|--dev-mode] [-i|--include-erts] [-a|--override]
[-c|--config] [--overlay_vars] [--vm_args] [--sys_config]
[--system_libs] [--version] [-r|--root]

Build release of project. this is the big girlboss finale energy. πŸ‘‘

  • -n, --relname β€” Specify the name for the release that will be generated
  • -v, --relvsn β€” Specify the version for the release
  • -g, --goal β€” Specify a target constraint on the system. These are usually the OTP
  • -u, --upfrom β€” Only valid with relup target, specify the release to upgrade from
  • -o, --output-dir β€” The output directory for the release. This is ./ by default.
  • -h, --help β€” Print usage
  • -l, --lib-dir β€” Additional dir that should be searched for OTP Apps
  • -p, --path β€” Additional dir to add to the code path
  • --default-libs β€” Whether to use the default system added lib dirs (means you must add them all manually). Default is true
  • -V, --verbose β€” Verbosity level, maybe between 0 and 3
  • -d, --dev-mode β€” Symlink the applications and configuration into the release instead of copying
  • -i, --include-erts β€” If true include a copy of erts used to build with, if a path include erts at that path. If false, do not include erts
  • -a, --override β€” Provide an app name and a directory to override in the form <appname>:<app directory>
  • -c, --config β€” The path to a config file
  • --overlay_vars β€” Path to a file of overlay variables
  • --vm_args β€” Path to a file to use for vm.args
  • --sys_config β€” Path to a file to use for sys.config
  • --system_libs β€” Path to dir of Erlang system libs
  • --version β€” Print relx version
  • -r, --root β€” The project root directory

relup

relup [-n|--relname] [-v|--relvsn] [-g|--goal] [-u|--upfrom]
[-o|--output-dir] [-h|--help] [-l|--lib-dir] [-p|--path] [--default-
libs] [-V|--verbose] [-d|--dev-mode] [-i|--include-erts] [-a|--override]
[-c|--config] [--overlay_vars] [--vm_args] [--sys_config]
[--system_libs] [--version] [-r|--root]

Create relup of releases. upgrade paths, we love a glow-up. 🌈

  • -n, --relname β€” Specify the name for the release that will be generated
  • -v, --relvsn β€” Specify the version for the release
  • -g, --goal β€” Specify a target constraint on the system. These are usually the OTP
  • -u, --upfrom β€” Only valid with relup target, specify the release to upgrade from
  • -o, --output-dir β€” The output directory for the release. This is ./ by default.
  • -h, --help β€” Print usage
  • -l, --lib-dir β€” Additional dir that should be searched for OTP Apps
  • -p, --path β€” Additional dir to add to the code path
  • --default-libs β€” Whether to use the default system added lib dirs (means you must add them all manually). Default is true
  • -V, --verbose β€” Verbosity level, maybe between 0 and 3
  • -d, --dev-mode β€” Symlink the applications and configuration into the release instead of copying
  • -i, --include-erts β€” If true include a copy of erts used to build with, if a path include erts at that path. If false, do not include erts
  • -a, --override β€” Provide an app name and a directory to override in the form <appname>:<app directory>
  • -c, --config β€” The path to a config file
  • --overlay_vars β€” Path to a file of overlay variables
  • --vm_args β€” Path to a file to use for vm.args
  • --sys_config β€” Path to a file to use for sys.config
  • --system_libs β€” Path to dir of Erlang system libs

okay wait. that's where part 1 of this manual page ends β€” the relup options list runs out right at --system_libs and then the original just... continues in the next chunk. so we are NOT done bestie, hold on, there's more page coming. don't go anywhere. πŸ’œ

  • --version β€” Print relx version πŸ’…
  • --root β€” The project root directory 🏠

πŸ“‹ report

Provide a crash report to be sent to the rebar3 issues page. 🫢

🐚 shell

shell [--config] [--name] [--sname] [--setcookie] [--script] [--apps] [--start-clean] [--user_drv_args]

Run shell with project apps and deps in path. ✨

  • --config β€” Path to the config file to use. Defaults to {shell, [{config, File}]} and then the relx sys.config file if not specified. πŸŽ€
  • --name β€” Gives a long name to the node. 🌟
  • --sname β€” Gives a short name to the node. 🌸
  • --setcookie β€” Sets the cookie if the node is distributed. πŸͺ
  • --script β€” Path to an escript file to run before starting the project apps. Defaults to rebar.config {shell, [{script_file, File}]} if not specified. πŸ“œ
  • --apps β€” A list of apps to boot before starting the shell. (E.g. --apps app1,app2,app3) Defaults to rebar.config {shell, [{apps, Apps}]} or relx apps if not specified. πŸš€
  • --start-clean β€” Cancel any applications in the 'apps' list or release. 🧼
  • --user_drv_args β€” Arguments passed to user_drv start function for creating custom shells. πŸ’»

πŸ“¦ tar

tar [-n|--relname] [-v|--relvsn] [-g|--goal] [-u|--upfrom] [-o|--output-dir] [-h|--help] [-l|--lib-dir] [-p|--path] [--default-libs] [-V|--verbose] [-d|--dev-mode] [-i|--include-erts] [-a|--override] [-c|--config] [--overlay_vars] [--vm_args] [--sys_config] [--system_libs] [--version] [-r|--root]

Tar archive of release built of project. πŸ—œοΈ

  • --relname β€” Specify the name for the release that will be generated. ✨
  • --relvsn β€” Specify the version for the release. πŸ”’
  • --goal β€” Specify a target constraint on the system. These are usually the OTP. 🎯
  • --upfrom β€” Only valid with relup target, specify the release to upgrade from. ⬆️
  • --output-dir β€” The output directory for the release. This is ./ by default. πŸ“
  • --help β€” Print usage. πŸ†˜
  • --lib-dir β€” Additional dir that should be searched for OTP Apps. πŸ“š
  • --path β€” Additional dir to add to the code path. πŸ›€οΈ
  • --default-libs β€” Whether to use the default system added lib dirs (means you must add them all manually). Default is true. βœ…
  • --verbose β€” Verbosity level, maybe between 0 and 3. πŸ”Š
  • --dev-mode β€” Symlink the applications and configuration into the release instead of copying. πŸ”—
  • --include-erts β€” If true include a copy of erts used to build with, if a path include erts at that path. If false, do not include erts. 🧬
  • --override β€” Provide an app name and a directory to override in the form <appname>:<app directory>. πŸŽ›οΈ
  • --config β€” The path to a config file. βš™οΈ
  • --overlay_vars β€” Path to a file of overlay variables. 🎨
  • --vm_args β€” Path to a file to use for vm.args. πŸ–₯️
  • --sys_config β€” Path to a file to use for sys.config. πŸ“
  • --system_libs β€” Path to dir of Erlang system libs. πŸ“‚
  • --version β€” Print relx version. πŸ’…
  • --root β€” The project root directory. 🏠

🌳 tree

tree [-v|--verbose]

Print dependency tree. 🌲

  • --verbose β€” Print repo and branch/tag/ref for git and hg deps. πŸ”

πŸ”“ unlock

Unlock dependencies. πŸ”“

πŸ”„ update

Update package index. πŸ“¦

⬆️ upgrade

Upgrade dependencies. πŸš€

🏷️ version

Print version for rebar and current Erlang. ℹ️

πŸ”Ž xref

Run cross reference analysis. πŸ•΅οΈ


🌈 ENVIRONMENT 🌈

Environment variables allow overall rebar3 control across command boundaries. 🌐

  • REBAR_PROFILE β€” Choose a default profile. Defaults to default. 🎭
  • HEX_CDN β€” Pick an alternative hex mirror. πŸͺž
  • REBAR_CACHE_DIR β€” Location of the directory for local cache. Defaults to hex.pm. πŸ’Ύ
  • QUIET β€” Only display errors. 🀫
  • DEBUG β€” Display debug information. πŸ›
  • REBAR_COLOR=high|low β€” How much color to show in the terminal. Defaults to high. 🎨
  • REBAR_CONFIG β€” Name of rebar configuration files. Defaults to rebar.config. πŸ“„
  • REBAR_GIT_CLONE_OPTIONS β€” Arguments to add after each git clone operation. For example, the value --reference ~/.cache/repos.reference allows to create a cache of all fetched repositories across builds. πŸ“₯

🧚 Configuration File Options 🧚

See http://www.rebar3.org/v3.0/docs/configuration. πŸ”—


Source: Erlang, dated November 2018, for REBAR3(1) β€” slay bestie, bye πŸ’–βœ¨