Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mk-pmb opened this issue May 27, 2023 · 2 comments
Open

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

mk-pmb opened this issue May 27, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mk-pmb
Copy link

mk-pmb commented May 27, 2023

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 mk-pmb changed the title Add raw mode. Add CLI option for raw mode. May 28, 2023
@mk-pmb mk-pmb changed the title Add CLI option for raw mode. Add CLI option for raw text mode (no colors at all). May 28, 2023
@marcolardera marcolardera added the enhancement New feature or request label May 29, 2023
@monperrus
Copy link
Contributor

You can pipe into ansi2txt from package colorized-logs

apt install colorized-logs

@mk-pmb
Copy link
Author

mk-pmb commented May 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants