First, God made him a reasonable creature and endued him with original righteousness, which was a perfection necessary to enable him to answer the end of his creation. Eminently in this respect he is said to be created in the image of God (Genesis 1: 26, 27) and to be made upright (Ecclesiastes 7: 29). This uprightness or rectitude of nature consisted in the perfect harmony of his soul with that law of God which he was made under and subjected to.
1. This was an eternal law and an invariable rule of righteousness by which those things that are agreeable to the holiness and rectitude of the divine nature were required and whatever is contrary to it was prohibited. This law was only internal and subjective to Adam, being communicated to him with his reasonable nature and written in his heart, so that he needed no external revelation to perfect his knowledge of it. And therefore in the history of his creation there is no other account given of it but what is comprised in this (and which is twice repeated) that he was made in the image of God. The apostle teaches us this consists in righteousness and true holiness (Ephesians 4: 24). The sum of this law was afterward given in ten words on Mount Sinai and yet more briefly by Christ who reduced it to two great commands respecting our duty both to God and our neighbor (Matthew 22: 37-40). And this as a law and rule of righteousness is in its own nature immutable and invariable, as is the nature and will of God himself whose holiness is stamped on it and represented by it.
2. It pleased the sovereign Majesty of Heaven to add to this eternal law a positive precept in which he charged man not to eat of the fruit of one tree in the midst of the garden of Eden. This tree was called the tree of the knowledge of good and evil (Genesis 2: 16, 17; 3: 3). The eating of this fruit was not a thing evil in itself but was made so by divine prohibition. So it was necessary that the will of God concerning this should be expressly signified and declared to man. Otherwise by the light of nature he would have been no more directed to abstain from the fruit of this tree than of any other in the garden; indeed, he would not have been under any bond of duty to it. But the command being once given out, this positive law had its foundations surely laid in the law of nature. For it is an infallible dictate “that it is a most righteous and reasonable thing that man should obey God, and that the will of the creature should ever be subject to the will of the Creator.” Therefore the heart of an upright man could not but naturally close with and submit to the will of God by whatever means made known to him. There can be no transgression of a positive precept without the violation of that eternal law that is written in his heart.
Coxe, Nehemiah; Owen, John. Covenant Theology: From Adam to Christ (Kindle Locations 607-627). RBAP. Kindle Edition.