I'm having trouble getting the correct translation of the sentence because of the で particle. I don't know if it's being used as a particle or the imperative form of 元気.
The で is a particle. According to 明鏡国語辞典:
The で expresses 動作を行うときの様態, the manner of an action, how or in what manner an action is done.
In 「元気で過ごす」, 「元気で」 (vigorously, cheerfully, healthily) describes how the action 「過ごす」 (spend the day) is done.
the imperative form of 元気
元気 is a noun or na-adjective, so it has no imperative form, at least in the modern Japanese grammar.
で in the above sentence is used as a particle not as the imperative form of 元気.
"で is a case particle that indicates state or condition of action" in the given sentence, which is made from にて by a euphonic change.
These explanations are written here as:
The given sentence could be written as: