It was in the desert.
I Am
Moses received the Ten Commandments on the top of Mt. Sinai from God.
Moses called God "I AM WHO I AM" when he spoke to him at the burning bush.
God called Moses because He wanted Moses to lead the Exodus ( release all the slaves in Egypt ) He also knew that the Lord believed in him so he saved him and the slaves because they believed in him too.
God instructed Moses to lead the Israelites out of slavery in Egypt and to receive the Ten Commandments on Mount Sinai.
Mount Sinai
God was but when moses smashed the 1st set God made him write the next.
Moses was a shepherd when God called him to lead the Israelites out of Egypt.
God can and will call anyone to work for him, Moses was called when he was looking after the sheep that belonged to his father in law jethro. God spoke to Moses from the burning bush.
Here it shows that god can call anyone, and also use anyone for his work.
It was god who wrote it.
Most usually think of Moses, but God also called Abraham His friend. (Isa 41:8)