Building My First Command Line Interface (CLI) with Rust

Adam Berg
Geek Culture
Published in
5 min readNov 7, 2021

--

Rusting rustic truck down by the Skookumchuck

Update: I took some of my learnings from this write-up and started a more formal tutorial for building CLI notes app with Rust.

After telling myself over and over that today is the day I start learning rust. I finally successfully built a (very small) cli for engram.

This post will cover some of the things I learned along the way. I mostly from a TypeScript/Node background and will make comparisons between the two where applicable.

Inventing Some Requirements

I have found that having a tangible end goal increases my odds of project completion by nearly 100%. In this case, the goal is to create a command line program that simply POSTs requests to my personal notes application engram.

This is not just a learning or for fun project as I recently realized that the command line is a great place for the input of quick notes. When I’m working, I sometimes find myself investigating something in the terminal and realize that I have a thought that I’d like to follow up on later, or a I’d like to store a command I just ran so I can remember what I did later on.

Getting Started

Install rust with the command below found from their Getting started page

--

--

Adam Berg
Geek Culture

Building https://kaizen.place. writing about C, C++, rust, game development, web development, engineering management. https://devtails.xyz/