Alma 12:31; “Wherefore, he gave commandments unto men, they having first transgressed the first commandments as to things which were temporal, and becoming as Gods, knowing good from evil, placing themselves in a state to act, or being placed in a state to act according to their wills and pleasures, whether to do evil or to do good.”
Genesis 3:5, 24; “For God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil. So he drove out the man; and he placed at the east of the garden of Eden Cherubims, and a flaming sword which turned every way, to keep the way of the tree of life.”
God did not give a commandment to Adam to sin and become as gods.
The Lord explicitly told Adam NOT to eat from the tree of knowledge.