Add invalid handling to CLI