Fill a pot with water and place over high heat. Bring to a boil, add 1 teaspoon salt and spaghetti and cook to al dente according to instructions on package. Reserve 1 cup pasta water and drain spaghetti.
In a large skillet or high-sided saute pan over medium-high heat, add oil. Add onion and remaining ½ teaspoon salt and cook, 3 to 5 minutes till onion is golden brown.
Add harissa, tomatoes, and olives and cook 3 minutes, stirring frequently. Tomatoes should start to break down.
Add ¾ to 1 cup pasta water to the pan, ¼ cup at a time. Mix well and bring to a boil. Once boiling, cover, reduce heat to low and simmer for 10 minutes.
Remove lid, stir, and cook another 5 minutes until sauce reaches desired consistency.
Add spaghetti to the pan and toss with harissa sauce.
Serve with optional toppings of chiffonade basil, plain Greek yogurt, toasted pine nuts.