The President's ability to command the military has even more nuances than you may recognize.   Every commander in the chain has both the authority and responsibility to defend his troops.  The soldiers, sailors and Marines at Pearl Harbor began shooting back as soon as they recognized they were under attack.  The 13th Cavalry  commander launched a spirited defense of Columbus NM when 1500 Mexicans under Pancho Villa attacked in search of supplies.  Col Slocum even authorized a squadron under Major Tompkins to pursue Villa into Mexico, providing a foreshadowing of the Punitive Expedition under Gen Pershing.  Of these actions, only the Punitive Expedition was based on a Presidential order,  and it didn't have a Congressional Declaration of War.