Assembly of international armed force in the face of great peril to humankind?

The “six-star general” thread got my juices flowing … I fully admit that the following is pretty harebrained. But anyway.

The GQ is thus:

In the event of a significant extraterrestrial threat to all of humankind, are there protocols in place now for international military cooperation? Have any treaties been signed, meetings been held, or anything of the sort taken place and made public?

And now, the IMHO portion of the discussion:

If the armed forces of the world needed to unite and more or less act as one force, how might it be accomplished? I’d assume there’d be no time for negotiations and treaties … there’d have to be a summary means of unifying command. Would the UN, as it exists now and with its existing protocols, be a means to accomplish a true unified command in a dire human emergency?

To answer the second part of the OP, IMHO, as in the past, the UN will expect America and its allies to take care of the problem.

NATO is the closest thing to an international armed force in the world. Of course, military powers Russia, China, India, Japan and Australia aren’t NATO members, although Australia manages to cooperate pretty well with the US, Canada and UK. Which makes me wonder why Australia isn’t a full-fledged NATO member. Yeah, Australia doesn’t border the North Atlantic, but neither does Italy or Turkey.