Add exception handling to CLI commands