For this configuration:
export XDEBUG_CONFIG="idekey=netbeans"
Then just run the script you want to debug
php ./myscript.php argument1 argument2
Remember to start the debuger so the IDE starts listening on the port
export XDEBUG_CONFIG="idekey=netbeans"
php ./myscript.php argument1 argument2