Turn on the instant pot in saute mode. When hot add olive oil.
Add rosemary (optional) and finely chopped garlic and saute for few minutes, do not brown.
Add Italian seasoning and red chili flakes. Saue for 30 seconds. If using bell pepper, add it now and saute for a minute.
Add two cups water and salt and give a mix.
Break spaghetti to half and add the pasta in two layers in crisscross pattern.
Push the pasta with out disturbing too much. Just make sure the pasta is immersed in the water.
Close the lid and adjust the vent to the sealing position. Pressure cook on high for five minutes. You can release the pressure after five minutes. We like it little softer than al dente, so I did natural pressure release.
When you open the instant pot, you will see that the pasta is stuck together. You will also observe some liquid in the bottom of the pot ( once we mix the pasta the water will be absorbed). With the help of thongs gently mix to remove stuck spaghetti.
Add parmesan cheese and chopped parsley. Gently toss. Taste and adjust the seasoning.