Extract command and parameters from input