Foreign policy via Twitter is obviously unwise, but Congress has given the president wide latitude to regulate foreign commerce.

Lots of high dudgeon after the president’s manic tweeting on Friday.

As to some of it, rightfully so. It was contemptible for the president to equate the dictator of Communist China to the chairman of the Federal Reserve, a patriotic American who apparently disagrees with Donald Trump on policy — and who is more attuned than the president to the need to avoid the appearance that Fed policy is susceptible to political tantrums.

Still, the righteous blasts by Trump critics in defense of Chairman Jerome Powell turned out to be so much throat-clearing. Soon followed indignant howls over what was framed as the president’s constitutional illiteracy in purporting to “order” American companies “to immediately start looking for an alternative to China, including bringing . . . your companies HOME and making your products in the USA.” Trump also said he was “ordering all carriers, including Fed Ex, Amazon, UPS and the Post Office, to SEARCH FOR & REFUSE . . . all deliveries of Fentanyl from China (or anywhere else!).”

Preliminarily, let’s stipulate that there is uncertainty, to say the least, about exactly what the president may “order” anyone to do via Twitter, even the people who work for him.

After being dazed by the tweets in the first few weeks of the Trump presidency, I’ve come to regard them as political performance art. I imagine most of us have. I tune most of it out. Other times, I chuckle . . . or gasp . . . or envision Trump rubbing his hands together in anticipation of making his critics’ heads explode. Mostly, I wonder if the president is too self-absorbed to grasp how wearying all this is — how he could easily lose a winnable reelection because he is exhausting, or because the tweets help his critics argue that he is unstable, or at least too feral for the office.

That’s the end of my throat-clearing. Now, about these “orders.”

I doubt the president can “hereby order” anything on Twitter, even an order he has the constitutional authority to issue. There is doubt about whether the tweets even qualify as presidential records. I’m not a stickler on form; I suspect, though, that something more formal is required before the chief executive can truly be said to have executed an order.

That said, it is surprising to see such dismissive commentary about the president’s legal authority to issue directives to companies doing international business.

Now don’t get me wrong. As I tried to make clear in connection with Trump’s repurposing (for border-wall construction) of funds allocated by Congress, I do not believe a president should have legislative powers — at least in the absence of a true national-security emergency, such as an imminent attack. Alas, my druthers are beside the point.

The Constitution expressly empowers Congress to regulate foreign commerce. It is a legacy of 20th-century progressives’ erosion of the Constitution’s separation of powers that Congress has delegated much of its authority to the chief executive and a sprawl of administrative agencies.

Among the resulting monstrosities is the 1977 International Emergency Economic Powers Act (codified at Title 50, U.S. Code, Sections 1701 et seq.). Under the IEEPA, the president may declare a national emergency with respect to an “unusual and extraordinary threat” to national security, the source of which is substantially outside the United States — such as threats posed by a foreign power.

When such an emergency declaration is in place, the IEEPA vests the president with sweeping powers to regulate or even prohibit financial transactions and transfers of assets involving foreign countries and their nationals. To give a sense of how broad this authority is, let’s excerpt just one subsection –1702(b) — that empowers the president to

investigate, block during the pendency of an investigation, regulate, direct and compel, nullify, void, prevent or prohibit, any acquisition, holding, withholding, use, transfer, withdrawal, transportation, importation or exportation of, or dealing in, or exercising any right, power, or privilege with respect to, or transactions involving, any property in which any foreign country or a national thereof has any interest by any person, or with respect to any property, subject to the jurisdiction of the United States.

Not easy to read, but trust me, that is one wide net.

Now sure, technically, the president does not have the power to direct American companies to consider alternatives to doing business in China. But so what? The president absolutely has the authority to make doing business in China practically impossible, such that corporate management would be nuts not to consider alternatives.

Moreover, to repeat, IEEPA explicitly grants the president the power to “prohibit . . . any . . . importation . . . of . . . or transactions involving, any property in which any foreign country or a national thereof has any interest.” I don’t see why that would not cover fentanyl deliveries from outside the United States.

Do we have a national emergency regarding China? Currently, none is listed among the dozens of emergencies declared over the last century, many of which are still pending. But it is certainly conceivable that Trump could conclude there is one. There is an extensive record in congressional hearings and government-agency reports about China’s intellectual-property theft, its prodigious hacking operations, its menacing military operations and build-up, and its aggressions against U.S. allies and interests — most recently in Hong Kong, where, the Chamber of Commerce says, more than 1,200 American firms do business.

To be clear, I am largely in agreement with our editorial. To my mind, foreign policy by tweet is a terrible practice. I believe China is a hostile state that must be confronted. I am not as convinced as my colleagues seem to be that tariffs should not be at least part of our responsive policy. I agree that the trade war is ill-conceived and that tariffs are not the best weapon and should not be the only one in the arsenal. But past presidents have used well-targeted tariffs successfully. Of course they hurt consumers, as well as U.S. exporters who bear the brunt of inevitable retaliatory tariffs; but confronting a country with which we have deep economic entanglements is necessarily going to involve pain.

My essential point, though, is that the robust constitutional safeguards from government interference that protect American businesses in the United States are not globally operative. Once you get beyond our shores, it’s a jungle out there. Yes, there are international standards, and, in the developed world at least, they are generally honored. It is a brute fact, though, that corporate America relies on the influence and might of the United States government in order to do international business profitably.

A major purpose of the federal government is to protect the American people from foreign threats. To perform that function, the government is given immense authority to regulate foreign relations and commerce. Under our Constitution’s design, that authority is less likely to be abused if it is wielded by the elected representatives most accountable to the People — which includes both those who are threatened by foreign aggression and those who conduct foreign business. That is why Congress should not delegate its power to presidents, who will always be tempted to wield the power pretextually and autocratically. We should fix that. We should not, however, doubt that the power exists.

It should not be up to President Trump alone to regulate commerce with China. Yet the claim that a president may never bar private American companies from doing business with a foreign power and its nationals is as wayward as the presidential tweets it purports to refute.