Heat the olive oil in a large pot over medium heat.
Add the sliced onions and cook, stirring frequently, until caramelized (about 15-20 minutes).
Stir in the minced garlic and cook for an additional 1-2 minutes until fragrant.
Pour in the broth and add the dried thyme; bring to a gentle simmer.
Add the pasta to the pot, stirring to combine, and ensure it’s submerged in the liquid.
Cover the pot and cook until the pasta is al dente, about 10-12 minutes, stirring occasionally.
Once cooked, remove from heat and stir in the shredded Gruyère cheese until melted and creamy.
Season with salt and pepper to taste, then serve hot, garnishing with additional cheese or fresh thyme if desired.