Livebook-driven development

What is Livebook?

Livebook is a notebook for writing Elixir and Markdown in an interactive way. We can evaluate Elixir code blocks and see the results immediately.

> mix escript.install hex livebook
> livebook server
[Livebook] Application running at http://localhost:8080/?token=xxxxx

How does Livebook benefit the development process?

Before Livebook, I write code in IEx, which is a REPL. It has some helpers to ease the way to explore code, but in my opinion, Livebook exceeds in two factors:

Code history

In fact, IEx can enable code history by setting export ERL_AFLAGS="-kernel shell_history enabled" in the shell profile file. You can also search the IEx code history with Ctrl-r and apply it. But as Livebook is essentially a notebook, you can see all texts and evaluation results without the need to set anything.


Livebook has a clean UI. You can write documents in Markdown and evaluate Elixir code blocks. It is more continuous, you can review every step of your thought by scrolling the page.

How to develop in Livebook?

Use ogp as an example.

First, I explore the idea with code blocks.

  • Install library to parse HTML with Mix.install/1.
  • Explore floki with Open Graph protocol.
  • The variables in a code block can be referenced by blocks below it.
  • As going deeper, a simple parser comes out.

Then I create an Elixir project and run the Livebook in the project.

  • Create an Elixir project with mix new ogp --module OpenGraph --sup.
  • Save the Livebook file in the project.
  • Move the parser into the project and run Livebook in Mix standalone mode.
  • Set up Mix standalone mode again successfully, uses the module from the ogp project.


Developing in Livebook is really delightful. It helps to explore the code and writing documents. Give it a try and you will love it!

Update on June 9

Livebook supports URL input since this PR, which is a perfect use case for ogp. See how it works:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store