Immediately following his father's death, Moroni writes concerning the plates his father had made, which he was then completing. He recorded that the plates are "of no worth" in an economic sense, because of the Lord's "commandment." (Mormon 8: 14.) He says the Lord had spoken the words: "no one shall have them to get gain." (Id.) This means that since the Lord had spoken that the gold plates could not be obtained for economic gain, this meant the Lord had "commanded" that the plates could not give a person any economic gain. The only gain to be had was "of great worth" to the soul.
Moroni equates the Lord's remark on the plates' lack of economic value to a "commandment." This is exactly how it works. This is what D&C 1: 38 is affirming, as well: "What I the Lord have spoken, I have spoken, and I excuse not myself; and though the heavens and the earth pass away, my word shall not pass away, but shall all be fulfilled, whether by mine own voice or by the voice of my servants, it is the same."
Salvation consists in getting the word of the Lord spoken to you as a promise of eternal life. When you obtain that word, it cannot be broken. It becomes a "commandment" of the Lord's which cannot fail. This is the kind of commandment we should seek.
I've tried to answer questions about "commandments" and I've tried to discuss the subject more fully in The Second Comforter: Conversing with the Lord Through the Veil. Instead of focusing on a list of things to do or not do, I would commend to you the idea of getting from the Lord those words which will assure you eternal life. Not His words spoken to others found in scripture, but words spoken by Him to you. If you obtain this from Him, then you have a sure promise, though the heavens and earth pass away. This more sure word guarantees you, by covenant from Him whose words cannot fail, that you will be granted life with Him.