The Salvadoran rebel command, vowing to wage war against U.S. soldiers stationed here, announced today that capturing or killing U.S. advisers was the principal objective of yesterday's bloody attack on the main Army training base at La Union, in which at least 40 Salvadoran soldiers died.

"Our war plan is directed toward defeating North American imperialists, and we are not waiting for the massive dispatch of their troops to begin fighting them," said a communique on the guerrillas' Radio Venceremos. "We have already decided to make war on the North American interventionists who are directing the war in our homeland, and we have decided to make war in every spot and every circumstance they may be in."

The rebel statement seemed calculated to portray an intensification of guerrilla resolve to strike at U.S. military personnel training, advising and equipping the Salvadoran Army in its six-year-old civil war against leftist insurgents of the Farabundo Marti National Liberation Front.

The Reagan administration has declared that U.S. military advisers are not proper targets in the war because, according to rules governing their presence here, they do not participate in combat. Rebel leaders -- both civilian and military -- have insisted that the U.S. military's role as adviser and weapons supplier makes American soldiers legitimate targets.

"In this operation of the Salvadoran Armed Forces Military Training Center carried out by our forces, the principal objective was wiping out or killing the group of 10 North American military advisers," the communique declared. "We looked for them. But if we did not find them this time, the Ronald Reagan government should become convinced once and for all that we do not fear the intervention of its troops and that it cannot try to make war on our people without suffering and paying the consequences."

The guerrilla command advanced similar arguments when it took responsibility for killing four U.S. Marine embassy guards and two other U.S. citizens at a San Salvador sidewalk cafe June 19. The first U.S. military man known to have been killed here, Navy Cmdr. Albert A. Schaufelberger III, was shot in the head in May 1983 as he picked up his girlfriend at the capital's Central American University.

Several months after Schaufelberger's killing, U.S. advisers received authorization to carry CAR15 automatic rifles, a compact version of the U.S. Army's standard M16. Previously, they had been allowed to carry only sidearms, a rule that U.S. officials said was leading to morale problems.

Five U.S. training advisers were present when guerrilla forces attacked the training base yesterday, the U.S. Embassy said. A spokesman said today that they did not fire their weapons during the assault but were prepared to do so if it had been necessary.

The base commander, Lt. Col. Joaquin Cerna Flores, said a dozen U.S. advisers usually are assigned to the base, sleeping sometimes in a small barracks set aside for them and sometimes in a house in the nearby port of La Union. A small group of U.S. advisers was seen leaving the base yesterday morning in an unmarked jeep well after the attack. At about the same time, a U.S. officer, carrying his rifle, was seen walking through the damaged base.

Embassy rules prohibit advisers or others of the approximately 120 U.S. military personnel acknowledged to be here from going "into areas where combat is likely to occur," a spokesman said.

The interpretation of this prohibition has relaxed somewhat during the past two years as the Salvadoran Army's performance improved and helicopters increased mobility. Congressional fastidiousness about rules governing the U.S. advisers here also has diminished.

Training advisers are stationed in most of the country's 14 provincial garrisons, advising Salvadoran trainers and monitoring the program. Their number rises and falls according to training cycles.

Counting administrative personnel in the capital, the number of advisers usually stands at about 65, the U.S. Embassy reported.