See comment
-
-
Save simonw/d3c07969a522226067b8fe099007fe4a to your computer and use it in GitHub Desktop.
@maschinenzeitmaschine - the script can be modified to pop open a terminal that starts a chat with the highlighted text as the system prompt. Something like this:
escaped_args=""
for arg in "$@"; do
escaped_arg=$(printf '%s\n' "$arg" | sed "s/'/'\\\\''/g")
escaped_args="$escaped_args '$escaped_arg'"
done
osascript -e "tell application \"Terminal\" to do script \"/usr/local/bin/llm chat -m gpt-4 -s ${escaped_args}\""
While this is great I wish I could use this in any app. Currently I cannot access this automator workflow from within slack :/
@devtanna - It works from Slack for me. If you highlight some text in slack, you can access the workflow from the menu Slack -> Services -> LLM, or you can invoke it with a hotkey if you've set one under keyboard shortcuts.
oh cool, thanks @eliyastein ! works now :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
p.s. i'm well aware this is out of scope and needs quite some more than a shell script, but wouldn't it be insanely cool if this would not only open a text window with an answer, but an interactive shell? like a chat interface, so i could do follow-up questions? i really love the idea to have an llm available anywhere in the finder and not have to open an app or browser or terminal and copy/paste every time…