The commands are generated in accordance with the instructions in the personalization scripts.
A personalization script is a textual description containing information about what should be recorded on the chip, information about a specific application on the chip that is being personalized, about the type of chip, and about the necessary interactions with cryptographic devices during personalization.
The CPP includes a script interpreter that "reads" the text of the personalization script and generates the appropriate chip personalization commands, and a subroutine for interacting with cryptographic devices (HSM).