How to create python application like pipenv or django-admin or pytest etc...?

I am writing a pip module that has to run from command line. I need some steps to create python application.

Thanks in advance.