run elixir script from mix with command line arguments like mix run my_app_script.exs arg1 arg2

  1. Mix will always compile the project it is in and then put it into the load path, as mix run explicitely “[s]tarts the current application and runs code” (from mix help run).

Also if you run a *.exs you need to specify the relative path yo your current working dir, so if you do not want to specify lib/ as a prefix you need to cd there first.