For terminal emulation, you can use iSH.
An app is allowed to use the standard method to read and write to use the standard document storage API where any installed storage providers can be accessed - iCloud, Google Drive, DropBox, the local device, etc