Must my command-line tool be an extension?
If the tool is command-line only, it probably shouldn't be an extension.

If you need to bootstrap CiviCRM from the command line, and you can presume that the cv tool is in the path, and your tool is PHP-based, you can add the line:



eval(`cv php:boot`);


or just:



cv php:boot --level=classloader


This should give you the ability to call CiviCRM classes without creating an extension.