pmjoe
I need to develop a CLI application and I’m wondering how suitable Elixir is for this kind of application. The application must be distributed to clients and it should be as simple as possible to run, ideally a static build with a single binary. I know Elixir has some build systems and I’m wondering if some of these systems can produce a binary, in the end, packing everything inside like the Erlang VM, etc, etc…
Protecting the source code is also desirable.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hi all,
I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
How do I tell Hologram not to escape HTML when substituting into templates?
{Textile.render(@product.long_description)}
escapes the HTM...
New
I’d like to create a file with 600 permissions (rw-------), but there’s a race condition if I create it and then change the permissions. ...
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
When I use Mix.install with a git dependency, using git@github.com:... how do I change the SSH identity used?
I’ve got two Github accoun...
New
Hello all. I have a question as to best practices for code organization when implementing a liveview with a lot of responsibilities.
Sup...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ityonemo
You should not use elixir for this.
hauleth
Use Go, Zig, or Rust for that. Elixir is a poor choice there.
ityonemo
maybe I should be more specific about the different points:
Not generally possible. If you’re okay with a zipped artifact that decompresses into a directory, I would argue that deployment with Elixir as a client application in theory could be easier, than say python, but I have not heard of anyone who has done this.
Releases (zipped directory) do this. But you must know a considerable amount about your target environment for this to work successfully.
This is probably a show-stopper.
Other concerns, if you are expecting a responsive cli app (think like grep) where you might be integrating it as a part of a toolchain that runs very quickly (like generating tab-completion suggestions on a command line), this is not going to be feasible. But if you’re building something where it is going to do something necessarily long-running (like fetching files over the internet) it’s not the worst. I deployed an internal CLI tool once that concurrently-downloaded files from dropbox, S3, box, gcloud… but this was internal and not meant for customer distribution, so realistically it only had to work on one flavor of MacOS, and one flavor of linux.
Also, the erlang vm will default to hogging as many processes as there are CPUs on your system, so you may want to think about that too.
HDT186
You can have a look at Bakeware, which compiles an Elixir, a Scenic or a Phoenix application into single executable binary.
hauleth
Bakeware still doesn’t main problem with Elixir for CLI tooling - startup time. Most of the CLI tools is one-time quick tools that are launched often and that finish quickly. In such environment Erlang features aren’t that appealing and do not bring much to the table except familiarity.
jswny
Any language with a runtime that’s not super light like Go is not going to be good for CLI applications. If you are making a CLI app which is going to run for a bit and won’t need to be called quickly and opened many times or piped into etc, you could get away with it. It depends on the use case but in general Elixir is definitely not good for this use case.
hauleth
Disagree. Python, Ruby, Perl, etc. are quite good solution for CLI tools. Sometimes even Java is ok solution.
tme_317
I’ve written several CLI apps in elixir for interactive use (i.e. converting data, automating ansible, etc) using escripts. Due to familiarity I write Elixir code much faster than anything else and it works great if you can don’t mind the ~200ms “boot time” (depending on machine of course) to run the CLI app as the whole VM must be brought up even for a quick task.
For me that is a good tradeoff for interactive use as I can control the small internal team’s environment these tools are distributed to and make sure proper Erlang is installed. Your case of “packing … Erlang VM” and “distributed to clients” leads me to suggest what others have already said in Go, Rust, etc which would be much faster to boot and easier to distribute. I haven’t tried Bakeware maybe that solves the distribution problem at least.
derek-zhou
From a pure runtime startup time perspective:
perl < python2 < python3 < ruby < java < elixir < nodejs
So elixir is not the worst. Hell, many CLI programs are written in nodejs; I cringe every time I run webpack.
carterbryden
I think really the main reasons why I usually wouldn’t go for elixir for a CLI app is that you probably won’t get or need it’s best benefits in a CLI too. Things like reliability and recovery features, distributed computing, maybe concurrency. But you’d still have to deal with a lot of the tradeoffs - lower portability, startup times, etc.
Elixir is designed to do a lot of things really well but it’s hard to beat languages that were designed specifically to be good for CLI tools without trading off the things that make it great for all other stuff.
Then again if your cli tool needs to be able to run a long lived command with a focus on reliability and concurrency, elixir would probably be great.