I haven’t tried them myself, but there are minimalist/pure text I/O versions of frotz and glulxe which should probably work quite well for this use case.
For frotz, it’s the so-called “dumb” interface, and for glulxe, it’s a version compiled for using the “CheapGlk” library.
Links:
frotz: David Griffith / frotz · GitLab
description of dumb version: DUMB · master · David Griffith / frotz · GitLab
cheapglk: GitHub - erkyrath/cheapglk: Cheapass implementation of the Glk API
(the link title is taken automatically from the Github repo site title, “cheapass” is Zarf’s own description, not mine )
I’m not sure if there are pre-compiled binaries available for the current versions, but I saw this older version: Release glulxe built with cheapglk and remglk - cheapglulxe, remglulxe · MikulasZelinka/glulxe · GitHub linked from this thread: Compiling Glulxe and Cheapglk in linux - #32 by myke.
Here’s also a link to a thread where someone describes a similar project: IF through Google Translate via command line