You can do this using the interactive command feature. The User Guide even cites the specific example you are asking about when describing how this works:
Adding Interactive Commands
An interactive command contains the input that must be entered following the execution of a command.
To enter an interactive command in the CLI Content area, use the following syntax:
CLI Command<IQ>interactive question 1<R>command response 1 <IQ>interactive question 2<R>command response 2
where <IQ> and <R> tag are case-sensitive and must be entered as uppercase.
For example:
crypto key generate rsa general-keys <IQ>yes/no<R> no
Source:
http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/3-0/user/guide/pi_ug/config-temp.html#47279