WARREN, Mich. — Over the last three months, Tesla’s stock price has more than doubled, adding tens of billions of dollars in market value, as investors have concluded that the company is poised to lead the auto industry’s transition to battery-powered vehicles.

Now General Motors is trying to make the case that it isn’t far behind Tesla, and that it is positioned to cash in if, or when, electric-vehicle sales take off.

On Wednesday, at its technical center in Warren, north of Detroit, G.M. laid out a comprehensive strategy to produce a wide array of affordable electric vehicles over the next few years. They range from compact cars to full-size pickup trucks. And unlike Tesla’s upscale models, they will be priced to appeal to mainstream consumers, G.M. officials said.

Twenty models are due by 2023, including a roomier version of the Chevrolet Bolt EV this year. An electric Hummer sport utility vehicle and the Cadillac Lyriq, another S.U.V., are expected to arrive in showrooms by 2022.