In a large skillet, heat the butter over medium heat. Add the onions and cook until soft and translucent, about 20 minutes, stirring occasionally.
Add the minced garlic and thyme to the skillet and cook for 2 minutes, until fragrant.
Sprinkle the flour over the onions and stir to combine. Cook for 2-3 minutes, until the mixture starts to brown.
Slowly pour in the beef broth, while continuously whisking, to avoid any lumps. Then add the white wine and continue to cook, stirring constantly, until the mixture thickens, about 10 minutes.
Cook pasta according to the package instructions, drain and set aside.
Remove the skillet from the heat and stir in the grated Gruyère cheese until melted and fully combined. Season with salt and pepper to taste.
Combine the cooked pasta with the cheese sauce and toss until the pasta is evenly coated.
Serve hot, garnished with fresh parsley if desired. Enjoy your delicious French Onion Pasta!