Core command handling.