xenodium / chatgpt-shell

A multi-llm Emacs shell (ChatGPT, Claude, Gemini, Ollama) + editing integrations
https://lmno.lol/alvaro
GNU General Public License v3.0
862 stars 77 forks source link

Add a motd on the beginning of the shell #113

Closed shouya closed 1 year ago

shouya commented 1 year ago

Very occasionally I use chatgpt-shell, to the frequency that just so I can't remember the key bindings. Every time I use it I need to look up for the keys for changing the model and system prompts. I'd really like if there can be some text showing some essential keybindings/commands on the beginning of the shell. Sort of like this (interactive-haskell):

The lambdas must flow.
If I break, you can:
  1. Restart:           M-x haskell-process-restart
  2. Configure logging: C-h v haskell-process-log (useful for debugging)
  3. General config:    M-x customize-mode
  4. Hide these tips:   C-h v haskell-process-show-debug-tips
λ> 

Thinking that it may be just a specific feature only I need, I tried to hack a solution for myself. However, it seems that neither shell-maker nor chatgpt-shell doesn't provide a convenient spot for me to inject some text which is ignored for the session.

Could you provide any hints on how I can do it? Thank you for this cool package btw.

xenodium commented 1 year ago

What about a help command? Would that be enough? At present, we have a special clear command. A help command could print what you are describing. Could maybe do both, the automatic print on start (which can be turned off) and the help command. WDYT?

ps. I can get the help command out sooner.

xenodium commented 1 year ago

Could use some additional formatting...

help

shouya commented 1 year ago

The help command looks great! Although I want to argue that the ability to show a message on start would also be a handy feature to have for shell-maker. Thank you!

xenodium commented 1 year ago

The help command looks great!

Thanks! It's in now.

Screenshot 2023-06-20 at 08 25 28

! Although I want to argue that the ability to show a message on start would also be a handy feature to have for shell-maker.

This one's gonna have to wait a little bit. Needs some work.

xenodium commented 1 year ago

Although I want to argue that the ability to show a message on start would also be a handy feature to have for shell-maker.

Added a welcome message. Please give it a try. Closing feature request, but please reopen if you run into issues.

Screenshot 2023-06-20 at 21 20 12
shouya commented 1 year ago

Thank you! I want to give a small suggestion: how about moving this part https://github.com/xenodium/chatgpt-shell/commit/8c8b3e913b1760bd8728cfd2c10afeb4687643ac#diff-ec9514ff6fe21247c722600b152e10ca34f798fc9a6ae0282eb9a47a3ef0bd51R157-R163 into a separate function shell-maker--insert-welcome-message? That would allow anyone to defadvice on it more easily.

xenodium commented 1 year ago

Added chatgpt-shell-welcome-function to make things configurable without advise. Set to nil for no message or see shell-maker-welcome-message for an example.

shouya commented 1 year ago

That's perfect! Thank you!