What started as a sporadic rebellion by local tribesmen and about six guerrilla bands has mushroomed into a mass revolt in the eight months since Soviet forces invaded Afhanistan last December and installed Babrak Karmal as president.

Persistent reports from a variety of Afghan and diplomatic sources during the past week outline a picture of widespread insurrection: roads are cut, shooting continues in several cities and towns despite nightly curfews, and some areas are completely out of government control.

The situation in Herat, the ancient trading center strategically located where the borders of Iran. Afghanistan and the Soviet Union meet, is the most graphic illustration of the inability of Soviet forces to control this Texas-sized country.

It was in Herat that the first major blow of the antiMarxist rebellion struck. Today, according to residents who fled to Kabul this week, the city has become a lawless battleground, with rival armed bands of rebels cruising its streets in broad daylight.

Afghan security forces sometimes chellenge the armed rebel bands, some of whom have as many as 300 fighters, and battle go on day and night.

But, according to the residents who fled to Kabul, the increased lawlessness in the last three weeks has left the rebels in effective control of the city.

Soviet troops do not enter the old city. They confine their activities to controlling the airport outside of town, seeking the new military airfield they built at Shindand, 50 miles south of Herat, and attempting to keep the vital road links from Herat southeast to Kandahar and east across the country to the capital city of Kabul.

The Soviet forces, however, have been unable to keep the Kabul-Herat road open with regularity. It frequently has been closed this week, according to people who finally were able to reach here.

Government control is equally tenuous elsewhere.

In Jalalabad, for example, a city east of Kabul on the road that leads through the Khyber Pass into Pakistan, curfew starts at 10 p.m. -- two hours earlier than here -- and there is shooting nightly. Rebel gangs operate at will in the outskirts of the city, according to several reports reaching here.

These same sources -- both diplomatic and Afghan -- say that the key trading road between Kabul and Pakistan, which runs through Jalalabad, has been closed since Tuesday after two buses ran over a land mine and blew up, killing most of the passengers. The mines were placed on the road between Kabul and Sarobi, just 25 miles east of Kabul on the other side of the spectacularly beautiful Kabul Gorge.

Similarly, Kandahar, the fourth major city in Afghanistan, is reported to be largely in rebel hands with the Soviet troops staying out of the central area while holding the airfield and communication network.

Fighting still continues around the outskirts of Ghazni, southwest of here, according to well-informed sources. Two weeks ago an Afghan Army division mutinied there, with an undetermined number of troops reportedly joining the rebel forces, when the division's commander was replaced.

A United Nations rural development chief returned here Saturday after being unable for three weeks to leave the center of Ghazni to go 2 1/2 miles to the site of a project.

The central City of Ghazni was reported to be peaceful. But skirmishes were said to break out regularly in surrounding villages where it is believed remnants of the 14th Infantry Division have gone into hiding with most of their equipment.

There are also reports of tribal rebellion in the northern region of Afghanistan bordering the Soviet Union, which had been quiet until recently. a

According to unconfirmed reports reaching here, bands of as many as 300 Uzbek and Turkoman tribesmen, riding on horseback, have been making nighttime attacks on government facilities such as schools and police stations in the provinces of Badghis, Faryab and Jowzjan in the north.

The area is thinly settled and the government has never had much control. But any attacks such as those reported presumably would discourage increased government activity there.

Even though those areas border the Soviet Union and many of the people are related on both sides of the frontier, there are few Soviet troops in the inhospitable, hot and rocky region of northwest Afghanistan.

The Soviet forces, meanwhile, were reported today to have mounted what appears so far to be a minor offensive against rebel forces near Samangan, which sits astride one of the prime road supply links with the Soviet Union.

[The Afghan government Sunday announced for the first time that it was having serious trouble controlling Moslem rebels in the Balkh Province bordering the Soviet Union, Reuter reported. Kabul Radio quoted the provincial governor's report of air and ground offensives against the rebels. The governor claimed that a large number of the rebels had been captured and others would be destroyed soon, the reports said.]

Afghanistan's capital, Kabul, has remained an oasis of calm in recent weeks amid the increasing rebellion that appears to be spreading throughout the rest of that country.

It is in Herat that the situation seems to be most out of control. There has not been a Soviet presence there since the uprising of April 1979, before the invasion, when Soviet's "advisers" in the city were mutilated and killed, according to sources.

Until the last three weeks, however, the city appeared to be calmly going about its business with neither the rebels nor the Afghan authorities trying to assert themselves.

For some unexplained reason that situation changed in mid-July, according to residents there.

One longtime resident of the city said that dozens of rebel bands had grabbed control of various neighborhoods in Herat.

Rebels seeking members of rival groups and government officials even began kidnaping patients from the Nur Eye Clinic, a voluntary organization. It's staff of six, including Western Europeans and one American doctor, decided Tuesday to leave the city because the situation had deteriorated so badly. The chartered plane that picked them up at the airport reportedly was the first to land there in 22 days.

One factor that led to their decision to pull out of the city, according to one source, were signs that began appearing on the streets of Herat saying "Kill Russians, and Americans as well."

Most of Herat's residents are Shiite Moslems who are influenced by Iran's revolutionary and religious leader, Ayatollah Ruhollah Khomeini, and there was speculation that this may account for their anti-American feelings.