Skip to content
make real CLIs in elixir
Elixir
Latest commit 2b8b8f2 Jan 13, 2016 @Lac dammit
Failed to load latest commit information.
config base structure for mix app Jan 13, 2016
lib update repo url Jan 13, 2016
test add tests Jan 13, 2016
.gitignore add docs compilation Jan 13, 2016
LICENSE initial Dec 23, 2015
README.md dammit Jan 13, 2016
meld update repo url Jan 13, 2016
mix.exs add docs compilation Jan 13, 2016
mix.lock add docs compilation Jan 13, 2016

README.md

meld logo

Hex.pm hexdocs

Meld is a command-line utility that makes it easy to provide a mix task as a global command, enabling real CLIs.

Usage

meld link ./my_mix_project mix_task

Where '/.my_mix_project' is a directory containing an Elixir app with a mix task that can be run. 'mix_task' is the mix task name, that means that it can be run with 'mix mix_task'.

Meld will create a shell script in its directory at ~/.meld. This shell script will cd into the specified directory and run the mix task. By adding the Meld directory to the global PATH, a simulated global executable is achieved.

The default name is DIRECTORY-NAME_MIX-TASK-NAME. So, in our example, the script name would be my_mix_project_mix_task (I hope you don't name your projects like that). You can, however, override the default name. Just run meld help link for more info.

There's also a screencast for explaining the linking process:

asciicast

 Usage as library

Meld.link "./my_mix_project", "mix_task" # to link
Meld.unlink "mix_task" # to unlink

 Installation

You need Elixir with Erlang OTP installed.

 On OSX:

  1. brew tap stuffs/tap to tap to where the meld formula is located.
  2. brew install meld (if that doesn't work, brew install stuffs/tap/meld).
  3. meld setup to create the ~/.meld folder.

As a one-liner, that's:

brew tap stuffs/tap; brew install meld; meld setup

On Linux:

  1. Run curl -kLO https://cdn.rawgit.com/sup/meld/releases/download/0.1.2/meld to download the binary.
  2. Make it executable: chmod +x ./meld
  3. Next, move it into your PATH somewhere. You can symlink it into /usr/local/bin or somewhere else, or just move it there. But of course, you can also use it if it's not in the PATH. Run either:
    • sudo ln -s meld /usr/local/bin/meld
    • sudo mv meld /usr/local/bin/meld The former is easier to update, I recommend that.
  4. Now, run meld setup (or ./meld setup if it's not in the PATH). This creates the Meld script directory under ~/.meld, under which all linked scripts are going to be saved.
  5. Make sure that the ~/.meld folder is in your PATH and has the correct rights assigned to it (chmod 755 ~/.meld).

And that's it! You're ready to link some tasks!

 License

MIT, see LICENSE.

Something went wrong with that request. Please try again.