https://www.brennancenter.org/our-work/research-reports/alien-enemies-act-explained
The president may invoke the Alien Enemies Act in times of “declared war” or when a foreign government threatens or undertakes an “invasion” or “predatory incursion” against U.S. territory. The Constitution gives Congress, not the president, the power to declare war, so the president must wait for democratic debate and a congressional vote to invoke the Alien Enemies Act based on a declared war. But the president need not wait for Congress to invoke the law based on a threatened or ongoing invasion or predatory incursion. The president has inherent authority to repel these kinds of sudden attacks — an authority that necessarily implies the discretion to decide when an invasion or predatory incursion is underway.