How WePay are using Elixir for a CLI platform

Within WePay’s tools team, we are always looking for ways to make our engineers more productive. One of the challenging things we are trying to do is distribute a series of automated tasks to our developers, such as a way for developers to tag a service for deployment, tail logs from ELK, cherry-pick a commit to multiple branches, or OAuth with external services. Rather than create a bunch of single use scripts, we wanted to put everything into one modular tool to perform tasks in a unified, well-tested way. The tool needed to be aware of any updates and provide a way to update itself. We also wanted this tool to be portable between our development environments and our infrastructure.

Full post here: WeTools: An Elixir Command Line Tool

Thanks to:
@josevalim for such a fun language to work with.
@NobbZ & @OvermindDL1 for helping out on some discussions.


Very nice write-up! That optimus library looks quite useful and I like how you setup your sub-commands a separate applications.

Quick question: how does a developer get the latest update for the tool?

There is a VersionCheck.main function that is called in the “uber” main()

def main(argv) do
  if Enum.member?(argv, "--help") do
    if length(argv) == 1 do
      argv = ["--help"]
      argv = ["help", List.first(argv)]
    |> Optimus.parse!(argv)
    |> process

When we create a new version our artifact repository has a json file with the latest build info. VersionCheck.main reads the remote JSON file from the repository and compares. Elixir has a really well thought out method. If there is a newer release published we nag the user to update by running we update.

The current update implementation isn’t as great as I want it to be. I want to implement update in place.


Looks quite cool! Not often you see elixir escripts being used outside of the elixir build system. :slight_smile:

1 Like

@tjhanley great article! Wondering if you are planning to open source the cli… any plan around that?