reimplement command handle logic with elixir-pipes