Exploring APIs with Neovim and Hurl

Hurl is a very interesting project that extends the functionality of curl. It offers an alternative to more GUI oriented software like Postman.

Hurl is foremost a command line tool and should be easy to use on a local computer, or in a CI/CD pipeline. Some tools in the same space as Hurl (Postman for instance), are GUI oriented, and we find it less attractive than CLI

Hurl FAQ

This caught my attention. I’ve been a user of Postman for a while, but over time I’ve found the tool to be more and more clunky, especially when working on larger projects.

All of these problems have been resolved for me by combining Neovim and Hurl. To do this I wrote a plugin, nvim-hurl.nvim, it runs hurl files and displays the response those files get from the server.

Using this setup I was able to solve all the issues I had with Postman leveraging the power of Neovim and Hurl together.

This setup also lets me take advantage of the entire Neovim plugin ecosystem.

The plugin also offers additional features for hurl, like being able to swap in and out variable files with Hurlsvf {variables_file}.

gif showing off Hurlsvf and HurlRun

This lets you change URL like in the demonstration above, but could also be used to quickly and easily change OAuth tokens for example.

It also offers a way to interactively explore APIs with a command named CurlGoFromCursor. It runs a simple curl command from your cursor allowing you to quickly navigate through links in RESTful APIs.

gif showing off HurlGoFromCursor

Because the Hurl file is just text, and the response is just text, it’s very easy to add functionality to the plugin and very easy to integrate into an existing workflow. Hurl might not have all the features of some of its GUI competitors at the moment, but it doesn't need those features if it's so easy to integrate it into other tools that have those features.