Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (67 sloc) 2.8 KB

Using expm

This manual explains how to use expm to discover and use packages.


A little bit of necessary theory here.

expm has a very few basic primitives:

  • Package, represented by specification defined by Expm.Package record
  • Package version: named and specific. Named versions are atoms and specific versions are binaries (Like :head and "0.1"). Package version is part of package specification (Expm.Package.version)
  • Repository, an entity that implements Expm.Repository protocol. Normally all you need to know is Expm.Repository.HTTP type of repositories. This is what expm uses by default (pointing to repository)

Command line

The utility

There are two ways to get expm's command line utility:


Go and grab it using the download link at the bottom. If you want to do this automatically, use this shell command:

curl -o expm

After downloading the binary, make it executable:

chmod +x expm


Clone yrashk/expm and type make. Please note, however, that for this to work, Elixir (normally the very latest master at this moment) has to be built and its binaries should be in your PATH


Common options

  • --repository URL (-r URL)

By default, this is

  • --username USER and --password PASSWORD

Used when publishing a package to the repository


Prints expm's version

server --version

Prints repository's expm server's version


Lists all packages in the repository

search KEYWORD

Searches all packages that match the KEYWORD. KEYWORD can be a partial regular expression.

spec[:FIELD] PACKAGE [--format mix|rebar|asis] [--format-opts OPTS]

Prints out topmost PACKAGE's version's specification.

If FIELD is specified, only that field is printed.

spec[:FIELD] PACKAGE VERSION [--format mix|rebar|asis] [--format-opts OPTS]

Prints out specific PACKAGE's VERSION's specification.

If FIELD is specified, only that field is printed.

versions PACKAGE

Prints a list of PACKAGE's versions

publish [package.exs]

Publishes package to the repository. If the file name is omitted, package.exs will be used.

Web interface

Web interface allows you to browse and search packages using your browser. The central repository is available at


You can retrieve packages in your modules. Here's a brief example:

defmodule MyModule do
  use Expm[, url: ...][, repository: ...][,format: Expm.Package.Format.Mix | Expm.Package.Format.Asis]

  def my_function do
       expm("esession", version: "0.1")