pub fn execute(cmd: &Command, state: &mut SessionState) -> Result<String>
Execute a command and update state.