Where is the source code of dfx command?

Where is the source code of dfx command? I want to build it locally. Can anyone help me

Building instructions just got updated. Please see the new version; it’s much simpler now.