Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

49 - Custom CLI Tool

Python Difficulty: Advanced Phase

What It Does

A file management CLI tool built with argparse supporting file search, line counting, duplicate detection, and file comparison.

Run It

python cli.py --help

Core Concepts

  • argparse for command-line parsing
  • Subcommands for different operations
  • File system walking with os.walk()
  • File comparison and duplicates
  • Rich terminal output

What You Will Learn

You will learn how to build professional CLI tools with argument parsing, subcommands, and help text.

Project Structure

49-cli-tool/
  README.md
  cli.py

Example Output

CLI File Tool
-------------
$ python cli.py search --pattern "*.py" --directory ./
Found 12 Python files

$ python cli.py count --file main.py
Lines: 156, Words: 423, Characters: 3,891

$ python cli.py duplicates --directory ./
Found 2 duplicate groups (3 files total)