CLI-Bootcamp
Ideas on how to quickly learn to build command-line tools
Part 1-Bash
Week1: Using Linux
Week2: Using Bash
- Lesson 1: Create and Use .bashrc
- Lesson 2: Sourcing shell variables from a script
- Lesson3: Using stdout and stdin
Week3: Building Bash Scripts
- Lesson 1: Build a for loop in Bash
- Lesson 2: Truncate large files with Bash
- Lesson 3: Building a command-line tool for data processing
- Lesson 4: Build Bash CLI with options
Week4: Composing File and Data Management Solutions with Linux
- Lesson 1: Understand the search commands
- Lesson 2: Setting permissions
- Lesson 3: Using regex to process text from file
- Lesson 4: Search the filesystem with find
Part 2-Build CLI in Python
Challenges
Bash and ZSH Challenges
- Customize your
~/.bashrc
with at least one alias, function and variable. - Build a Bash CLI tool that takes options
- Truncate a large file and randomly sample at the same time
- Write a find command and a locate command
- Install ohmzsh, what did you learn?
Python Challenges
- Pick a Python command-line tool library you are not familar with and build a module with a function that is called in a CLI. A few examples:
- Write a test for your python CLI tool
- Containerize your Python CLI tool and deploy to a public container repo like Github Container Registry or Docker Hub or Amazon Public Container Registry. Here is an example project.
Additional Thoughts on Challenge
- How tiny can you make your container (hint try alpine python)? What is the approach that shrinks the size?
- Can you lint your container with a linting tool like: hadolint? What about security scanning?
- Why would it be impressive to have a docker pull command for a CLI on your resume?
- Can you automatically build and push new containers in Github Actions? Hint...yes.
- Can you build a GPT-3 CLI tool? https://openai.com/blog/openai-api/
GPT 3:
- Book: https://learning.oreilly.com/library/view/gpt-3/9781098113612/
- Interview: https://learning.oreilly.com/videos/52-weeks-of/021822022VIDEOPAIML/
Advanced Challenges
-
Write a CLI in a language you don't know: