For the dough: Add the flour and 1 teaspoon salt to a large bowl and stir to combine. Whisk together the sour cream, oil, water and egg in a small bowl until smooth. Add the sour cream mixture to the dry ingredients and stir with a fork to combine. Use your hands to bring the mixture together into a shaggy dough in the bowl. Lightly flour the counter and scrape the dough onto it. Knead until the dough comes together in a soft, smooth ball, 3 to 4 minutes. (Avoid adding too much flour or the dough will be tough.) Wrap in plastic wrap and let rest for 30 minutes while you make the filling.
For the filling: Heat a large skillet over medium heat and add 4 tablespoons of the butter. When melted, add the onions, season with ½ teaspoon salt and cook, stirring occasionally, until the onions are deep golden and very tender, 15 to 20 minutes. Remove ⅓ cup of the onions and set aside. Reserve the skillet with the onions for later use.
Meanwhile, put the potatoes in a large saucepan with salted water to cover by about 1 inch. Bring to a simmer and cook until tender, 15 to 18 minutes. Drain well and return to the pot. Add the Cheddar, sour cream, 4 tablespoons of the butter, 1 teaspoon salt and the reserved ⅓ cup onions and mash with a potato masher until smooth. Remove to a bowl and let cool.
Once the filling is cool, cut the dough in half. Fill a small bowl with water. Dust your work surface lightly with flour and roll one half of the dough into a 15-inch square (it doesn’t have to be perfectly square, what’s most important is that the dough is rolled thin – you should just be able to see the counter or your hand underneath the dough). Use a 3 ½-inch round cutter and cut out as many rounds of dough as you can. Place about 1 tablespoon of filling in the middle of a dough round and cup it in the palm of one hand. Lightly brush the rim of the dough round with water and fold over to make a half-moon. Press the edges well to completely seal. Repeat with the remaining dough rounds, resting the pierogi on a floured baking sheet as you go. Reserve the dough scraps. Repeat with the second piece of dough. Combine the dough scraps and roll out to get a few more pierogi; these will be a bit thicker, but that’s okay, they’ll still be delicious! The pierogi can be cooked now or frozen for later use. (To freeze: Freeze directly on the baking sheet. Once frozen solid, put in a resealable plastic bag for longer storage. Add 1 to 2 minutes onto the cooking time for frozen pierogi.)
Bring a large pot of salted water to a boil. Return the skillet with the onions to low heat and add the remaining 2 tablespoons butter to melt. Add half of the pierogi to the boiling water, stir gently and cook until tender, 3 to 4 minutes once they rise to the surface. Remove with a spider or slotted spoon to the butter and onions. Repeat with the remaining pierogi. Once they’re all in the skillet, increase the heat a bit and gently toss to coat them in the butter and onions. Season with salt if needed and serve with sour cream.