raycast / script-commands

Script Commands let you tailor Raycast to your needs. Think of them as little productivity boosts throughout your day.
https://raycast.com
MIT License
5.95k stars 885 forks source link

Add script to open Claude and submit prompt #954

Closed nimobeeren closed 2 weeks ago

nimobeeren commented 1 month ago

Description

This script opens Claude in Chrome browser and submits the prompt provided as argument.

Type of change

New script command

Screenshot

https://github.com/user-attachments/assets/49f21e5f-5574-44c5-a559-4719ca94db28

Dependencies / Requirements

This script requires the following software to be installed:

Install via homebrew: brew install node chrome-cli

This script needs to run JavaScript in your browser, which requires your permission. To do so, open Chrome and find the menu bar item: View > Developer > Allow JavaScript from Apple Events

Checklist

nimobeeren commented 1 month ago

@unnamedd thanks for your review! I've implemented or replied to your comments.

I've also changed behavior to open in a new tab instead of new window, and added a note to tell the user to enable JavaScript from Apple Events. Could you give it another look?

unnamedd commented 3 weeks ago

@nimobeeren I found this link earlier today (Claude’s API now supports CORS requests, enabling client-side applications). Perhaps it might be interesting to you.

nimobeeren commented 3 weeks ago

@nimobeeren I found this link earlier today (Claude’s API now supports CORS requests, enabling client-side applications). Perhaps it might be interesting to you.

Thanks, that's good to know! I think this only applies to the API though, rather than the user-facing Claude product. I think there is a place for API-based interactions with LMMs (like Raycast AI), but this script is meant to work with the (free or paid) web interface.