Where do these Terminal commands come from?
Well, these commands edit .plist files in your /Users/xyz/Library/Preferences folder.  So, if you look at these files, you can look at these files and base your Terminal commands after these.

These are XML-based files, so you can view them in a more readable format if you open them in Xcode, which is available in the Mac App Store.  

In the Terminal, the format for these is "defaults write PLIST_FILE KEY -TYPE VALUE"
where the PLIST_FILE is the name of the file in the Preferences folder without the .plist, KEY is the key that you can see in Xcode, -TYPE is the type of key that you can find Xcode (and you can find if there is an abbreviation for that type by typing "defaults" into the terminal), and value is the value you wish to set the key at.

Here are some of the string types from the Terminal:

-string &lt;string_value&gt;
-data &lt;hex_digits&gt;
-int[eger] &lt;integer_value&gt;
-float  &lt;floating-point_value&gt;
-bool[ean] (true | false | yes | no)
-date &lt;date_rep&gt;
-array &lt;value1&gt; &lt;value2&gt; ...
-array-add &lt;value1&gt; &lt;value2&gt; ...
-dict &lt;key1&gt; &lt;value1&gt; &lt;key2&gt; &lt;value2&gt; ...
-dict-add &lt;key1&gt; &lt;value1&gt; ...