TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
9.43k stars 746 forks source link

Add option to turn off markdown formater #438

Closed edshamis closed 7 months ago

edshamis commented 8 months ago

I need to pipe sgpt output, now the md formatter removes md symbols which I want to be preserved in the pipe

jeanlucthumm commented 8 months ago

https://github.com/TheR1D/shell_gpt/issues/423#issuecomment-1892219962

TheR1D commented 7 months ago

This feature was added in 1.3.0.

Markdown formatting now depends on the role description. For instance, if the role includes "APPLY MARKDOWN" in its description, the output for this role will be Markdown-formatted. This applies to both default and custom roles. If you would like to disable Markdown formatting, edit the default role description in ~/.config/shell_gpt/roles.

But it is probably a good idea to disable it based on sys.stdout.isatty() as @jeanlucthumm mentioned. But I'm not sure how exactly we should implement it, since we specifcally requiring Markdown in the role description.

edshamis commented 7 months ago

It's about disabling the formatter, not about the md format. It would be lovely to have an option to print the response as is it to stdout without using md formatter. I wonder if I'm clear?))

ryanfreckleton commented 7 months ago

I was about to request this. Yes, the issue isn't markdown output, but the formatter, Rich, I think?

Outputting Markdown format without going through Rich would enable me to use it a lot more easily as part of my flow.

TheR1D commented 7 months ago

Released in 1.4.0.