Preheat the oven to 400°F (200°C).
Prepare the spaghetti squash: cut it in half lengthwise and remove the seeds.
Place the squash halves cut-side down on a baking sheet and roast for 30-40 minutes.
While the squash roasts, sauté the onions and garlic in a pan over medium heat until translucent.
Add the chopped spinach or kale, diced tomatoes, and Italian seasoning to the pan.
Once the squash is cooked and cooled slightly, use a fork to scrape out the strands.
In a large mixing bowl, combine the squash strands, sautéed vegetables, and half of the shredded cheese.
Transfer the mixture to a greased baking dish and top with the remaining cheese.
Bake for 20-25 minutes or until the cheese is melted and bubbly.
Remove from the oven and let cool for a few minutes before serving.