Repository navigation
Add Script Commands - #38
Open
amanmprojects wants to merge 1 commit into
Open
amanmprojects wants to merge 1 commit into
amanmprojects wants to merge 1 commit into
Conversation
Executable scripts with @raycast.* headers in ~/.config/oma-cast/script-commands (plus config.json scriptCommandDirectories) become root-search commands, per SPEC §9.9 and ref 03 §5. - Modes: compact (running toast with Cancel, then the last line), silent (HUD), fullOutput (streamed output view: copy, run again, stop) and inline (first line as the subtitle, refreshed on refreshTime >= 10 s). - Up to three text/password/dropdown arguments as pills; needsConfirmation uses the alert. - Search / Create / Reload Script Commands built-ins; invalid headers are listed with the reason. - RPC: scriptCommands.getScripts|reload|runScript|cancelScript|getRun. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Adds Raycast Script Commands (SPEC §9.9, ref 03 §5), part of Phase 2. Nothing is added to the shell's dependencies: scanning and running use bash, and the rest is QML/JS.
What it does
An executable script with
@raycast.*header comments in~/.config/oma-cast/script-commandsbecomes a root-search command. It gets frecency ranking, aliases, favourites and the disable action like any other command. Extra folders go in config.json as"scriptCommandDirectories": ["~/bin/raycast"].compact: a running toast with Cancel on Ctrl+T, then the last line of outputsilent: closes the launcher and shows the last line in the OSDfullOutput: a view that streams the output; ↵ copies it, Ctrl+R runs the script again, Stop is in the action panelinline: the first line is the row's subtitle, refreshed everyrefreshTime(at least 10 s)text,password,dropdown) as pills. Dropdowns step with ↑/↓ (the samestepOptionas Quicklinks #8) and start on their first option. Passwords show as dots.percentEncodedis applied.packageNamedefaults to the Title-Cased folder name, andcurrentDirectoryPathresolves against the script's folder.needsConfirmationuses the existing alert.omarchy-launch-editor.scriptCommands.getScripts|reload|runScript|cancelScript|getRun, named after Raycast's namespace.Scripts run as
bash -lc 'cd "$1"; shift; exec "$@"'with the script path and arguments as argv elements, so argument text never goes through a shell. LC_ALL is unset, as ref 03 §5 describes.Design choices ([I]/[D] in comments)
Not included
ANSI colours in the output view (they're stripped),
iconDark, and a settings page for the folders.Testing
node --test tests/*.test.js: 121 pass. New tests intests/script-commands.test.jscover header parsing, arguments, output handling, the template, and Search Script Commands sections and actions. One test also runs the real scan, run and create bash scripts against a temp folder.omarchy plugin validate pluginpasses.tests/smoke.shpasses (worst toggle 83 ms).The code, tests and this description were written with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code