Whisk the flour, baking powder, and salt together in a large bowl
Add the sourdough discard, milk, and egg, and stir until a dough forms
Turn the dough onto a work surface and knead for 10–15 minutes until smooth and elastic
Form the dough into a ball, place it in a bowl, cover it, and refrigerate until ready to assemble
Combine the mashed potatoes, cheddar cheese, butter, chives, salt, and pepper in a bowl
Mix until the butter and cheese are melted and fully incorporated
Spread the filling in a shallow dish and let it cool completely
Roll the dough on a floured surface to about ⅛ inch thick
Cut circles using a 3-inch cutter
Place about 1 tablespoon of filling in the center of each circle
Fold the dough over the filling and pinch the edges firmly to seal
Place the pierogi on a parchment-lined baking sheet
Boil the pierogi in well-salted water for 5 minutes
Drain the pierogi and set them aside
Melt the butter in a skillet over medium heat
Sauté the sliced onion in the butter until browned
Add the boiled pierogi and cook until browned and crisp
Serve hot with crème fraîche or sour cream
