City Attorney Dennis Herrera has long coveted the mayor’s office.

He ran for the job in 2011, finishing third behind winner Ed Lee and Supervisor John Avalos. A year ago, he pulled papers to try to finish Lee’s second term after the mayor’s unexpected death, saying he was “seriously” considering jumping into last June’s election. He wound up not running.

So nobody would have been all that surprised if Herrera tried again this November to unseat Mayor London Breed — and he would have been a formidable challenger. But he’s not running and instead will be on the November ballot to seek a sixth term representing the city of San Francisco in court.

“I am not running for mayor,” he said during a recording of the San Francisco City Insider podcast.

Herrera’s decision is one fewer hurdle in Breed’s quest to claim a full four-year term. And, if city history is any guide, she’d have a leg up on claiming a second term for a total of nearly 10 years in Room 200.

No name-brand candidates have pulled papers to challenge her. A walk through City Hall Monday morning to see if anybody had heard of any serious contenders pondering a campaign turned up nothing. The progressives, who couldn’t even get it together to smoothly elect a board president this month, haven’t found anybody to challenge her. The deadline to file candidacy papers is June 11.

“Short of the sky falling” Breed will win re-election, said one progressive city insider.

But why won’t Herrera run? In short, he says, because he really likes the current mayor. Since he won his job in 2001, he’s worked with four mayors: Willie Brown, Gavin Newsom, Lee and Breed.

“The relationship I’ve had with London Breed is the best I’ve had with any of them,” Herrera said. “She has been nothing but collaborative. She’s reached out. She’s been a really wonderful partner. ... We’ve been mutually supportive in what we want to do.”

Collaborative? Mutually supportive? Yes, this is the benefit of electing women to higher office. The country should try it sometime! (Herrera would support that — he’s backing California Sen. Kamala Harris for president, saying, “She has the vision to lead, and no one should ever underestimate the toughness behind that smile.”)

Herrera, 56, addressed his own political future as well as many other hot topics at City Hall in a wide-ranging interview. To hear our whole talk, listen to the podcast at sfchronicle.com/insider. Here are some of the highlights:

Proposition C: You know that squeeze City Hall finds itself in? The one in which voters approved three tax initiatives — funding child care, teacher raises and homeless services — but can’t spend the money until court challenges are resolved?

Yeah, that one. That’s Herrera’s fault. Not that he’d put it that way.

A memo from Herrera’s office in October 2017 used a somewhat obscure California Supreme Court decision to tell the city’s Department of Elections that “it is very unlikely that the city ... retains the authority to require a two-thirds vote for initiative tax measures.”

Herrera’s argument is that a tax measure placed on the ballot by politicians still needs two-thirds voter approval for passage, but measures that qualify through a voter signature drive only need a simple majority.

“The logic was so clear based on what the Supreme Court said,” Herrera said. “We wanted to put out an opinion that was transparent, where our legal reasoning was out there for everybody to see.”

The matter is expected to take years to settle in court. So is Breed giving Herrera any side-eye for putting her in this awkward position? Herrera laughed and said, “We call it like we see it.”

Pacific Gas and Electric: Herrera has never been shy in sharing his distaste for the utility. As the company approached Tuesday’s bankruptcy protection filing, he was even more adamant that City Hall should strongly consider powering the city itself.

“I think the irresponsibility of PG&E over the last two decades has been astounding,” Herrera said.

He said the current debate over whether public power is the right way forward is “a debate that needs to happen.”

Breed this month asked the San Francisco Public Utilities Commission to take three months to examine what a PG&E bankruptcy would mean for San Francisco. A PG&E spokeswoman said at the time that the company is “committed to working together with policymakers, regulators and all stakeholders to provide safe and reliable energy that our customers expect and deserve.”

Climate change and the opioid crisis: These are two of the biggest issues facing San Francisco and the nation, and Herrera’s taking them both on in court.

In 2017 his office, as well as several other counties around the state, sued some of the world’s biggest oil companies, including ExxonMobil, Shell and Chevron, over climate change. They argued that the companies knowingly produced the heat-trapping gases that are raising the world’s temperatures and causing sea level to rise. San Francisco lost its case and is appealing.

Similarly, Herrera’s office in December sued pharmaceutical companies, saying they deliberately misled doctors and the public about their products and are fueling the country’s opioid crisis.

“Both of these industries have to take responsibility,” Herrera said.

Mental illness: Less than a month ago, Herrera’s office took control of civil conservatorship cases for the most seriously mentally ill people in our city. As a supervisor, Breed pushed to move those cases out of the district attorney’s office. Herrera thinks San Francisco needs to do far more.

“Unfortunately, San Franciscans and people around this country always talk about the homeless problem,” he said. “Homelessness is a symptom. We have a mental health and drug addiction crisis in San Francisco.”

He said the city should consider opening mental health hospitals to fill the gap left when the state shuttered its own decades ago, casting many severely mentally ill people out on the streets.

“We as a society have failed them, and we need to step up,” he said.

His future: While he’s committed to seeking a sixth term as city attorney, he wouldn’t rule out trying for Room 200 again someday.

But for now, he’s enjoying life with his wife and teenage son in their Dogpatch neighborhood, frequenting the Japanese restaurant Moshi Moshi and the Dogpatch Saloon. The family recently returned from a vacation in Vietnam and Cambodia.

“I have a great job, and I’m able to do a lot of really good things where I am and still have a life,” he said. “I’ve always said I’d like to be mayor, so maybe someday I’ll do it again. Maybe I won’t.”

San Francisco Chronicle columnist Heather Knight appears Sundays and Tuesdays. Email: hknight@sfchronicle.com Twitter: @hknightsf