SACRAMENTO -- Heeding the complaints of environmentalists and Bay Area officials, state senators have stripped away provisions of a bill that could have derailed Alameda County's attempts at forming a startup public energy utility.

The East Bay county hopes to compete with PG&E by forming its own agency that can buy electricity and sell it to residents, choose green energy sources and set its own billing rates. But advocates say Assembly Bill2145 -- in its earlier, PG&E-backed form -- would have halted that plan and others in the works around the state.

The Senate energy committee moved the bill forward Monday, but not before handing clean energy advocates a victory by removing its most controversial provisions.

"Basically there's nothing left in the bill. It's just an empty shell," said Richmond City Councilman Tom Butt, who was one of dozens of people who traveled to Sacramento on Monday to speak against it. "It was sold as a consumer protection and labor bill, and it wasn't either one."

Butt represents the only East Bay city that is already powered by a "community choice aggregation" agency, known as a CCA. Marin County formed the state's first CCA in 2010, and Richmond, although in Contra Costa County, linked up to it in 2012.

Pacific Gas & Electric, one of the state's three big investor-owned utilities, still distributes electricity, reads the meters and sends the bills for Richmond residents, but the community agency now chooses where the energy comes from for most of them.

"Marin was the first and it's been a good model," Butt said in an interview Tuesday. "We joined Marin Clean Energy originally so that Richmond could reduce its carbon footprint, reduce greenhouse gases and access clean energy. ... The bonus was that it's also cheaper."

The Marin model, however, came under fire in the halls of the Capitol this month as AB2145 backers used it as an example of what's wrong with CCAs. They pointed out that the Marin agency simply bought much of its renewable energy on the open market through a deal with Shell, rather than procuring it locally. And noting that customers of Marin Clean Energy are automatically enrolled in the program, they argued that customers should have the option to learn more about an alternative energy program first.

"The way it was formed, it was like community force," not community choice, said the bill's author, Assemblyman Steve Bradford, D-Gardena, a former Southern California Edison executive who said he supports CCAs but believes they should have to "go to the communities and really sell it."

Amid mounting opposition, however, Bradford told senators on Monday he was willing to accept amendments that significantly watered down his bill.

One key provision dropped Monday would have forced every customer to opt in to a new public energy program, prohibiting an automatic enrollment model like Marin's. Community choice advocates said that provision would have made marketing a new energy program so costly that no local government would bother to try.

Another provision debated Monday would have limited a public utility agency to the boundaries of a single county, hurting cities such as Richmond that link to a neighboring agency, and counties such as Santa Cruz, San Benito and Monterey that hope to procure energy together. Senators promised to revise that provision before the bill is passed.

Groups supporting the original bill -- including corporate utilities and some labor unions -- donated more than $5 million to California Assembly members since 2011, and groups against the bill have spent about $1.1 million, according to Berkeley-based MapLight, which tracks campaign donations.

The Assembly voted 51-15 to pass the bill on May 28, but bipartisan opposition and public scrutiny grew in recent weeks as the bill headed to the Senate.

Six senators voted in favor of the amended legislation, including Mark DeSaulnier, D-Concord, and Jerry Hill, D-San Mateo. Hill had previously voted against the bill but changed his mind after the amendments were made. Voting against the bill were Ellen Corbett, D-Hayward; Lois Wolk, D-Davis, whose North Bay district includes Sonoma County, which launched the state's second CCA this year; Steve Knight, R-Lancaster, who said the original bill "really would kill CCAs in California" -- including one being formed in Lancaster.