My First CLI Project Takeaways

Benjamin Cheng
2 min readDec 4, 2020

More Than Meets the Eye

A year ago, I would use cmd.exe to run predetermined lines of code posted on various troubleshooting websites and never giving a thought that I would be able to manipulate code and run it on the terminal itself. Just this week, I finished up my first CLI portfolio project using website scraping and object orientated programming from scratch. It really is a wonder knowing how much I’ve done in the past month and knowing how much more capability it with such a simple tool.

Initial Setup

The biggest challenge for this initial project is setting up the skeleton of the application from scratch. Up until this point each of the labs prior were all preset. Fortunately, there is a gem to help set up a project skeleton in Ruby.

bundle gem GEM_NAME

Running the command above sets a scaffold directory for the new program and it also initializes a Git repository right away. Additionally, many other files are also generated:

  • Gemfile
  • Rakefile
  • CODE_OF_CONDUCT.md
  • LICENSE.txt
  • README.md
  • Gemfile.lock
  • .gitignore
  • GEM_NAME.gemspec
  • lib/GEM_NAME.rb
  • lib/GEM_NAME
  • lib/GEM_NAME/version.rb

The basic layout will be given for you to start coding right away. However to use other tools, different dependencies will need to be added. For this CLI project, Nokogiri and Pry were utilized. In the .gemspec file, spec.add_development_dependency "pry" and spec.add_dependency "nokogiri" were needed in order for our program to run these tools. These were the major steps that were incredibly important that I did not give a second thought before. Of course there are many other little things along the way that were needed to fully develop the application.

Small Steps to the Big Project

My big takeaway from the first project is to really take small steps at a time. I know it’s cliche to say but it really works. Going head first into the first application is daunting. When reading over the project requirements for the first time, it seems like there was no end in sight. However, Learn.co provides many resources to give the developer to dive into the programming with the perfect amount of guidance for the programmer to be curious and learn each step. Future projects, whether for this bootcamp or a future employer, will get more and more complex and might get overwhelming at some point but you should always think small like everything we go through in life and take small steps.

--

--