Over medium heat, stir the flour into the onions, cooking until it’s pale brown, about 1 minute. Stir in the beef stock and bring to a simmer. Add the kale and cook until wilted, about 6 minutes.
Place a large pot with salted water over medium heat and bring to a boil. Add the pasta and cook until just al dente, about 8 minutes. Drain the pasta, reserving about 1 cup of the pasta cooking water and return to the pot. Add the onion and stock mixture over the top, stirring in ½ cup of the pasta cooking water.
Heat the oven to broil on high. Spread the pasta in baking dish and top with the gruyere cheese and thyme. Add to the oven and broil until the cheese is melted and bubbly, about 4 to 5 minutes. Remove and top with the buttered breadcrumbs then serve immediately.