I been trying to find one, when in a pet battle is there a way to do a /click <button name>. I have my UI setup where I have all my action buttons bound thru bindpad macros. So unless there is a way to do a /click for pet battles I'll have to always mouse click it.
For some reason, Blizzard neglected to give the ability buttons global names. However, you can poke around in the PetBattleFrame and eventually find them:
PetBattleFrame.BottomFrame.abilityButtons[1]:Click()
I recomment a mod called LuaBrowser for this kind of snooping.
C_PetJournal.SummonPetByGUID(petID);
or
C_PetJournal.SummonRandomPet
/run C_PetBattles.UseAbility(ID);
with ID being the ID-th slot in your bar to use the pet's abilities