---
title: "Notes From Build Awesome Command-Line Apps"
description: "Lately I was going through book and talks on ’Build Awesome Command-Line Applications in Ruby: Control Your Computer in JS."
url: "https://h3manth.com/scribe/notes-build-awesome-command-line-apps/"
canonical_url: "https://h3manth.com/scribe/notes-build-awesome-command-line-apps/"
markdown_url: "https://h3manth.com/scribe/blog/notes-build-awesome-command-line-apps.md"
publishDate: "2012-05-20T00:00:00.000Z"
author: "Hemanth HM"
category: "linux"
tags: ["ruby","bash"]
word_count: 274
reading_time_minutes: 2
x_markdown_tokens: 504
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Notes From Build Awesome Command-Line Apps

> Lately I was going through book and talks on ’Build Awesome Command-Line Applications in Ruby: Control Your Computer in JS.

Lately I was going through book and talks on "Build Awesome Command-Line Applications in Ruby: Control Your Computer, Simplify Your Life" by David Bryant Copeland.

Major stuff /me noted down from it are as below :

**The UNIX Way**

  * grepable (One "record" perline)
  * cutable (delimited "fieIds")
  * exit codes! (O for success, nonzero for failure)
  * messaging (stderr) vs. output (stdout)

**Why Ruby?**

  * High-level abstractions
  * Still close to the metal (eg. FileUtils)
  * Fast (no heavyweight VM to start up)
  * Simple packaging/distribution with RubyGems

**Ruby, The Ecosystem**

  * CLI is part of the culture
  * Great open-source gems for command-line
  * Great open-source gems for everything else

**How you should do it**

  * Check exit codes - plays well!
  * Log the command helpful!
  * Capture the output - helpful!
  * Check exit codes plays well!
  * Log the command helpful!
  * Capture the output- helpful!
  * Think of "future you"

**Few CIL gems I liked :**

  * Rainbow - Create colored output
  * Thor - Create a command-suite app simply and easily, as well as Rails generators
  * GLI - Create awesome, polished command suites without a lot of code
  * Slop - Create simple command-line apps with a syntax similar to trollop.
  * Childprocess - Cross-platform ruby library for managing child processes
  * Formatador - produce rich output with a tag-like string syntax, including tables and progressbars
  * Highline - handle user input and output via a “Q&A” style API, including type conversions and validation

All in All it's a pretty decent read and will help one getting started and running CLI apps in a wink ;)
