[Upcoming] Mon.school course: Building Command-line applications with Python


The course would focus on building command-line applications using Python. I haven’t seen beginner-friendly courses on building command-line applications.

This course would offer a great way to understand how command-line applications work.

Mini-projects would be built throughout the course. A final exercise would be open-ended, where the learners would share their projects on social media tagging mon.school - the winners would be given a prize! (IndiaFOSS 3.0 tickets, etc.)

Course Syllabus

At the end of the course, the learner would have understood:

  • What is a terminal, and how it works (in a simplified way)
  • What is a CLI
  • What are the components of a CLI
  • How does interaction work in a CLI
  • How does argparse work
  • How to build CLIs using argparse
  • What is click
  • How to use click to build CLI apps
  • Unit testing CLI apps
  • Making use of Github Actions to test CLI apps

Course Structure

Every chapter would have:

  • 3-4 subchapters/sections
  • A lot of illustrations to enrich the learning experience!
  • Exercises at the end of each chapter
  • Simple quizzes in the middle of each chapter



  • :green_circle: = would be in the course
  • :yellow_circle: = considering to add it in the course
  • :orange_circle: = might not be beginner-friendly, on hold

Chapter 1:

  • (:green_circle:) What is a terminal?
  • (:green_circle:) What is a CLI?
  • (:green_circle:) Components of a CLI (commands, subcommands, flags, args, etc.)
  • (:green_circle:) Examples of CLIs (breaking down the most common CLIs (git, etc.) and understanding their structure - commands, subcommands, flags, etc.)
  • (:yellow_circle:) Brief history of CLIs and the terminal
  • (:orange_circle:) What’s inside the terminal?
  • (:green_circle:) Quiz on CLIs and terminals

Chapter 2:

  • (:green_circle:) A basic Python primer (part 1)
  • (:green_circle:) A basic Python primer (part 2)
  • (:green_circle:) Understanding pip and virtual environments
  • (:green_circle:) Preparing our Python environment using virtualenv
  • (:green_circle:) Running our basic Python app
  • (:green_circle:) Quiz on Python basics

Chapter 3:

  • (:green_circle:) Introduction to argparse
  • (:green_circle:) A miniature CLI using argparse
  • (:green_circle:) Mini-project 1: building a “greeter” CLI (a CLI which could print Hello, <username>! The current time is <timestamp>)
  • (:green_circle:) Exercise: build a CLI to print the first X lines of a file (head).
  • (:green_circle:) Solution walkthrough
  • (:green_circle:) Quiz on argparse

Chapter 4:

  • (:green_circle:) Introduction to click
  • (:green_circle:) Understanding the structure for building CLIs with click
  • (:green_circle:) Mini project 2: Build a CLI for note-taking (add and view notes)
  • (:green_circle:) Exercise: Add a new command to delete notes
  • (:green_circle:) Solution walkthrough
  • (:green_circle:) Quiz on click

Chapter 5:

  • (:yellow_circle:) Basic pytest tutorial
  • (:yellow_circle:) Unit testing Python CLIs
  • (:orange_circle:) Using Makefiles/tox to ease testing
  • (:orange_circle:) Using Github Actions for setting up pipelines

Chapter 6:

  • (:orange_circle:) Packaging Python applications
  • (:orange_circle:) Packaging our previously built CLIs
  • (:yellow_circle:) Best practices for building CLIs

Course completion:

  • “What’s next” section with guided path (resources) to build command-line applications
  • Open-ended project