Custom Drush command without module I am a newbie into Drupal.
I recently learned to create custom Drush command inside a custom module. I am wondering if I can write a custom drush command and its definition without any module or outside module. for eg. If I have no custom module in my drupal project.
This custom command is available for execution only if my module is enabled. Can I write a drush command which is completely module independent?

Is it possible?
You might be interested in the drushify project, which will create a Drush commandfile for you, from a template.  You can give it the name of a module, and run it from a Drupal site to make a Drush command for a module, or just give it an arbitrary name and run it from outside any Drupal site, and it will create a global Drush command.

From there, you only need to go through and fill in the parts of the template that it made for you.  You may delete any of the optional hooks that you don't need -- which is usually most of them.