{"id":18525,"date":"2020-06-25T14:40:09","date_gmt":"2020-06-25T21:40:09","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=18525"},"modified":"2023-12-01T03:34:21","modified_gmt":"2023-12-01T11:34:21","slug":"build-ruby-cli","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/","title":{"rendered":"How to Build a Command Line Interface Using Ruby"},"content":{"rendered":"\n<p>Are you considering building a command line interface? That\u2019s a great project idea! In this guide, we discuss how to build a command line interface in Ruby.<br><\/p>\n\n\n\n<p>Before we get started, you should have Ruby installed on your computer, and you should be using a terminal that allows you to run Unix commands. If you\u2019re using a Linux or macOS-based computer, you\u2019ll already have a Unix-compatible terminal built-in. Once you\u2019ve met these requirements, you\u2019re ready to get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are Command Line Interfaces?<\/h2>\n\n\n\n<p>As you get started in your coding career, you soon learn about the terminal. The terminal window allows you to interact with command line interfaces (CLIs), which you can use to run and interact with programs using text commands.<br><\/p>\n\n\n\n<p>Using the terminal window, you can give instructions to your computer without a mouse or a visual application. This saves you time when you code because you can just focus on writing instructions. You don\u2019t need to worry about learning a new user interface for each tool you use!<br><\/p>\n\n\n\n<p>The CLIs you have interacted with so far have probably been developed by other people. For example, the Python CLI allows you to run Python from the terminal, while the Ruby CLI allows you to do the same with Ruby applications. Fortunately, you can build your own too!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Build a CLI in Ruby<\/h2>\n\n\n\n<p>To get started, open a terminal window on your machine. Then, use the <code>mkdir<\/code> command to create a folder for your code. Here\u2019s an example of this command in action:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>mkdir ruby-cli<\/pre><\/div>\n\n\n\n<p>This command creates a folder called \u201cruby-cli\u201d on our computer. We can now use <code>cd<\/code> to go into this folder and create our CLI:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>cd ruby-cli<\/pre><\/div>\n\n\n\n<p>Great! Now we\u2019re in our new \u201cruby-cli\u201d folder. That\u2019s all the setup we need to do for this article\u2014the next step is to start writing our command line interface.<br><\/p>\n\n\n\n<p>The first feature we\u2019re going to add to our command line interface is to print out the term \u201cThis is an example CLI\u201d to our terminal. We can do so by creating a new file called \u201chome.rb\u201d and inserting code into the file.<br><\/p>\n\n\n\n<p>To create a new file, we can use the following command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>nano home.rb<\/pre><\/div>\n\n\n\n<p>This will open up a <code>nano<\/code> text editor where we can put the code for our program. You can use a different text editor, such as vim or emacs, if you want.&nbsp;<br><\/p>\n\n\n\n<p>In our nano text editor, we paste the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#!\/usr\/bin\/env ruby\nputs \"This is an example CLI\"<\/pre><\/div>\n\n\n\n<p>Now, let\u2019s save by pressing Control-X on Mac, Y and then Enter. This creates a new file called \u201chome.rb\u201d in our \u201cruby-cli\u201d folder.<br><\/p>\n\n\n\n<p>In our code, the first line tells the computer to use the Ruby interpreter to run our code. This ensures that our code is run in Ruby. The second line instructs our program to print \u201cThis is an example CLI\u201d to the console.<br><\/p>\n\n\n\n<p>Now, we can run our file using the <code>ruby<\/code> command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ruby home.rb<\/pre><\/div>\n\n\n\n<p>Our code returns: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>This is an example CLI.<\/pre><\/div>\n\n\n\n<p>As you can see, we\u2019ve just created a simple CLI. When we run our \u201chome.rb\u201d file, the term \u2018This is an example CLI\u201d is printed to the console.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Accepting User Input Using Flags<\/h2>\n\n\n\n<p>Our CLI is pretty simple so far\u2014it only prints out a message to the console. What if you wanted to accept user input? We can do so using the <code>optparse<\/code> library. This allows us to parse options provided from the command line which can be used in our program.<br><\/p>\n\n\n\n<p>We\u2019re using the <code>optparse<\/code> library for a few reasons. First, the <code>optparse<\/code> library allows us to generate a help menu for each command. Second, <code>optparse<\/code> is built-in to Ruby, so you don&#8217;t need to install anything.<br><\/p>\n\n\n\n<p>Let\u2019s add in a feature that accepts a user\u2019s email address as an input and then returns it to the console.<br><\/p>\n\n\n\n<p>Open up the \u201chome.rb\u201d file in your text editor and replace its contents with this code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#!\/usr\/bin\/env ruby\nrequire 'optparse'\noptions = {}\nOptionParser.new do |op|\n  op.on(\"-e\", \"--email\", \"Your email address\") do |value|\n \toptions[:name] = value\n  end\nend.parse!\nputs 'Your email address is: ' + options[:name]<\/pre><\/div>\n\n\n\n<p>In this code, we use the <code>optparse<\/code> library to parse data that is sent through a command. We then assign the value the user has specified to a variable, and print it out to the console. In this case, we print \u201cYour email address is: \u201c, followed by the email the user has specified.<br><\/p>\n\n\n\n<p>We can use this command to try out our code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ruby home.rb -e jack@jones.com<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Your email address is: jack@jones.com<\/pre><\/div>\n\n\n\n<p>The cool thing about the <code>optparse<\/code> library is that it auto-generates a help menu. We can see this help menu by using the following code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ruby home.rb --help<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>Usage: ruby [options]\n\t-e, --email            \tYour email address<\/pre><\/div>\n\n\n\n<p>When you\u2019re running your command, you can use either the <code>-e<\/code> or the <code>--email<\/code> flag.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Accepting User Input in Your Program<\/h2>\n\n\n\n<p>In the previous example, we accepted user input using flags. However, flags can be impractical if you want to accept multiple pieces of information.<br><\/p>\n\n\n\n<p>The beauty of creating a CLI in Ruby is that any Ruby program can become a CLI. So, you don\u2019t need to learn any new conventions to get started.<br><\/p>\n\n\n\n<p>Suppose we want to build an application that retrieves a user\u2019s name and email, and checks whether they are over the age of 16.&nbsp;<br><\/p>\n\n\n\n<p>Let\u2019s start by running the following command to enter into our <code>nano<\/code> text editor:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>nano age_checker.rb<\/pre><\/div>\n\n\n\n<p>In your newly-created file, paste the following code: <\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>puts \"What is your name?\"\nname = gets\nputs \"What is your age?\"\nage = gets\nif age.to_i &gt;= 16\n  puts \"#{name}! You are 16 or older!\"\nelse\n  puts \"#{name}! You are not over the age of 16!\"\nend<\/pre><\/div>\n\n\n\n<p>After saving your file, you can run your new CLI using this command:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>ruby age_checker.rb<\/pre><\/div>\n\n\n\n<p>Our code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>What is your name?\nJames\nWhat is your age?\n17\nJames! You are 16 or older!<\/pre><\/div>\n\n\n\n<p>If we insert the value \u201c14\u201d in response to the question \u201cWhat is your age?\u201d, the following is returned:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>James! You are not over the age of 16.<\/pre><\/div>\n\n\n\n<p>You can write any Ruby code you want into your CLI. The only limit is your imagination.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>A CLI allows you to interact with a program using a terminal. It\u2019s an alternative to a user interface for a program (like what you see when you open a text editor like Atom or Notepad).<br><\/p>\n\n\n\n<p>In this guide, we\u2019ve shown you how to build a simple CLI using Ruby. Now you\u2019re ready to start building your own CLIs like a Ruby expert!<\/p>\n","protected":false},"excerpt":{"rendered":"Are you considering building a command line interface? That\u2019s a great project idea! In this guide, we discuss how to build a command line interface in Ruby. Before we get started, you should have Ruby installed on your computer, and you should be using a terminal that allows you to run Unix commands. If you\u2019re&hellip;","protected":false},"author":240,"featured_media":18526,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17278],"tags":[],"class_list":{"0":"post-18525","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-ruby"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Ruby","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Build a Command Line Interface Using Ruby | Career Karma<\/title>\n<meta name=\"description\" content=\"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Build a Command Line Interface Using Ruby\" \/>\n<meta property=\"og:description\" content=\"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-25T21:40:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:34:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"How to Build a Command Line Interface Using Ruby\",\"datePublished\":\"2020-06-25T21:40:09+00:00\",\"dateModified\":\"2023-12-01T11:34:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\"},\"wordCount\":996,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg\",\"articleSection\":[\"Ruby\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\",\"name\":\"How to Build a Command Line Interface Using Ruby | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg\",\"datePublished\":\"2020-06-25T21:40:09+00:00\",\"dateModified\":\"2023-12-01T11:34:21+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg\",\"width\":1020,\"height\":680},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ruby\",\"item\":\"https:\/\/careerkarma.com\/blog\/ruby\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Build a Command Line Interface Using Ruby\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Build a Command Line Interface Using Ruby | Career Karma","description":"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/","og_locale":"en_US","og_type":"article","og_title":"How to Build a Command Line Interface Using Ruby","og_description":"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.","og_url":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-25T21:40:09+00:00","article_modified_time":"2023-12-01T11:34:21+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"How to Build a Command Line Interface Using Ruby","datePublished":"2020-06-25T21:40:09+00:00","dateModified":"2023-12-01T11:34:21+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/"},"wordCount":996,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg","articleSection":["Ruby"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/","url":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/","name":"How to Build a Command Line Interface Using Ruby | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg","datePublished":"2020-06-25T21:40:09+00:00","dateModified":"2023-12-01T11:34:21+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"Command Line Interfaces (CLIs) are essential tools used by developers every day. On Career Karma, learn how to build a CLI using Ruby.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/build-ruby-cli\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/zan-0WzeC6JtbHU-unsplash.jpg","width":1020,"height":680},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/build-ruby-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Ruby","item":"https:\/\/careerkarma.com\/blog\/ruby\/"},{"@type":"ListItem","position":3,"name":"How to Build a Command Line Interface Using Ruby"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=18525"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/18525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/18526"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=18525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=18525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=18525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}