Best not to think of the て form as a command. It only has that meaning when it is not followed by anything else, and even then not all of the time. The てform is one verb ending verb that can be followed by many different words to create different 'grammatical' structures. It is like the るform, ます form, おう form, etc in that way.
To thank someone for doing something, you put a verb in the te form then add a thank you word. To thank someone for doing something for you, put くれる、くださる、いただく、etc in the te form, then add a thank you word.
てくれる and てくださる are very similar, the main difference being the latter elevates the person you are speaking to. Both are verb ending that are used when someone else does something for you.
~てありがとう
~てくれてありがとう
~てくださってありがとう all mean thank you for doing ~ (for me).
~てくれ! Is an informal request (for someone to do something for you). Here it means Please save her! (please get her out of there!)
彼のこと 私のこと 彼女のこと etc all basically mean the same thing as if you did not add のこと。