chatgpt-cli icon indicating copy to clipboard operation
chatgpt-cli copied to clipboard

Add CLI option for raw text mode (no colors at all).

Open mk-pmb opened this issue 2 years ago • 2 comments

To simplify using this client in scripts, I'd like a raw text mode that avoids all terminal control codes (color, cursor positioning, not sure what else). Raw text mode would thus include disabling markdown rendering. I found the markdown option, but even with that disabled, the model name and separator line are still in color. Also I'd like a CLI option for raw text mode. Also raw text mode shall be the default if standard output is not a TTY. (Even better if we can check termcap for color code support, but that's probably a feature that should be implemented upstream in Rich.) Also raw text mode shall be the default if using the dumb terminal (environment variable TERM is set to dumb).

mk-pmb avatar May 27 '23 23:05 mk-pmb

You can pipe into ansi2txt from package colorized-logs

apt install colorized-logs

monperrus avatar May 30 '23 12:05 monperrus

Thanks for the idea! Indeed I had considered using sed to stip all terminal control codes from the output and the excess newlines after the input prompt. Nonetheless, I think all of the features requested above should be in chatgpt-cli.

mk-pmb avatar May 30 '23 22:05 mk-pmb