need to reinstall mac os x but the command key is broken
You can force restart by holding the power button for a few seconds.

If the Option key works, hold that during restart. This will present you with a list of all valid bootable partitions.

If that doesn't work try plugging in an external keyboard.