Cook the spaghetti in salted water according to the packet instructions, drain and keep warm.
Cut the avocados in half, remove the stones, scoop out the flesh, mash with a fork. Immediately mix in the lime juice, oil and garlic, season the pesto. Stir in the pine nuts, tomatoes and basil. Mix the pesto in with the spaghetti.