There's no built-in cheat that lets you play as clone commandos in Star Wars Battlefront 2, but the modding community has you covered. A mod called Ultimate Battlefront: The Clone Wars adds new units, including the clone commandos, to the game.
You'll need to download the mod and follow the installation and uninstallation notes in its description carefully. Just as importantly, the mod requires the Unofficial Star Wars Battlefront II v1.3 Patch, so grab that as well before you begin.
Once everything is installed, you can see all the commandos together by playing Hunt on the Tantive IV map. As for safety, these mods are clean and run smoothly, and I can say that from personal experience with them installed.
Hopefully this points you in the right direction. Enjoy the extra firepower!