You can achieve this using a Python package:
To install the package, simply run:
pip install directory_tree
Once installed, you can generate a directory tree by executing:
directory_tree
Use the inline help for command-line options:
directory_tree --help