Prep the onions. Peel and slice the onions pole-to-pole into thin half-moons.
Aim for even slices so they cook at the same rate.
Start the caramelization. In a large skillet, heat the butter and olive oil over medium heat. Add onions and salt. Cook, stirring every few minutes, until they turn translucent and begin to soften, about 10 minutes.
Go low and slow. Reduce heat to medium-low.
Continue cooking, stirring occasionally, until onions are deep golden brown and jammy, 30–40 minutes. If browned bits build up, splash in a tablespoon of water and scrape the pan. Patience is key here.
Deglaze and season. Stir in garlic and thyme; cook 1 minute.
Add the white wine (or stock) and Worcestershire. Simmer until most of the liquid evaporates and the onions are glossy, 2–3 minutes. Taste and adjust salt and pepper.
Heat the oven. Preheat to 375°F (190°C).
Lightly grease a small baking dish or oven-safe skillet.
Make the creamy base. In a bowl, mix cream cheese, sour cream, and mayonnaise until smooth. Fold in 1 1/2 cups of the grated Gruyere, reserving 1/2 cup for topping. Add a pinch of cayenne or smoked paprika if you like a little warmth.
Combine. Stir the caramelized onion mixture into the creamy base until evenly distributed.
Taste again and adjust seasoning. The mixture should be well-salted and flavorful before baking.
Transfer and top. Spoon into the prepared baking dish and smooth the top. Sprinkle with the remaining Gruyere.
Bake. Bake 15–20 minutes until bubbling around the edges and lightly browned on top.
For extra color, broil 1–2 minutes—watch closely to avoid burning.
Finish and serve. Let it rest 5 minutes so it sets slightly. Garnish with chopped chives or parsley. Serve warm with toasted baguette, crackers, or crisp veggies.