Repository navigation
Add Script Commands - #74
Open
nchudleigh wants to merge 2 commits into
Open
nchudleigh wants to merge 2 commits into
nchudleigh wants to merge 2 commits into
Conversation
Executables in ~/.config/omacast/script-commands with Raycast's @raycast.* headers become root-search commands (SPEC §9.9). Text, password and dropdown arguments are pills; silent shows a HUD with the last output line, compact a toast. fullOutput and inline run as compact for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wait for both the exit and the end of output before reading the last line, with stderr merged into stdout as Raycast reads it. Let the runner's cd resolve currentDirectoryPath, and clear argument pills after a compact run so a second ↵ starts fresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executable scripts in
~/.config/omacast/script-commands/now show up in root search, using Raycast's Script Commands headers (SPEC §9.9). For example, a "Switch Display" script with a dropdown of monitor inputs:What works
core/ScriptCommands.jsparses the headers: any comment style, keys in any case,argument1..3,currentDirectoryPath,needsConfirmation, and the package name defaulting to the folder name.services/ScriptCommandSource.qmlscans the folder each time the launcher opens. It keeps files that are executable, 1 byte to 2 MB, and have no.template.in the name, and reads only the first 60 lines.services/ScriptRunner.qmlruns the file underbash -lcfrom its folder, with$1..$3and stdin closed.←/→(or a click) cycles the options and typing is ignored. Password values show as dots.silentcloses the launcher and shows a HUD with the last output line.compactshows "Running…", then a toast, or a HUD if the launcher has closed. A failed run shows the last line of stderr.Not in this PR
fullOutputandinlinescripts run ascompact. The output view and inline refresh can follow.Privacy (please check): script arguments are the one place user text reaches an argv, because
$1..$3is the Script Commands interface. This is noted in SPEC §9.9 and in the README's Privacy section.Testing
node --test tests/*.test.js: 146 pass.tests/script-commands.test.jsadds parser, argv, cycling and outcome tests, plus tests that run the real scan and runner shell snippets.omarchy plugin validate .passes.→shows "‹ Alpha ›";🤖 Generated with Claude Code