The Pinephone comes with a USB gadget driver that presents the phone as a NIC. Plug it into a laptop, and the laptop can then be used as a terminal for the phone simply by sshing into it. X forwarding works, so you can practically run desktop programs that would be cumbersome to run with a touchscreen.
You could probably do the same with a Raspberry Pi, but it might be trickier to do with an Android phone. A phone that supports Termux or UserLAnd would work well if you used adb port forwarding.
You could probably do the same with a Raspberry Pi, but it might be trickier to do with an Android phone. A phone that supports Termux or UserLAnd would work well if you used adb port forwarding.