Debug PHP command line with Xdebug and Netbeans

While running FuelPHP tasks on the command line I get some trouble with debugging.
It's simple to have Xdebug running with the server but not so obvious to get it running with the command line.
I've finally found out how !