Wrap the tofu in a paper towel to remove moisture and cut it into bite-sized pieces.
Cut cherry tomatoes in half and finely chop the onion and garlic.
Cook the pasta in boiling water and drain it in a colander.
Heat olive oil in a pan, sauté garlic and onion until fragrant.
Add the tofu and cook until the edges turn golden brown.
Add cherry tomatoes and season with salt and pepper.
Add the cooked pasta and mix well.
Serve on a plate and garnish with parsley or basil.