Heat the oil in a large pan and cook the onion for 10 minutes, until softened. Add the chilli and garlic for the last 2 minutes.
Pour in the stock with the butterbeans and peas and simmer for 2-3 minutes, then stir in the spinach. Once just wilted, season with freshly ground black pepper and serve.