FileRunner in descending priority order and delegates to the first runner whose supports returns true.
All runner types live in com.klyx.api.data.runner.
FileRunnerRegistry
Resolve the registry from a plugin as a service:
Registering a runner whose
id matches an existing one replaces the previous registration.
FileRunner
Implement this interface to handle a specific kind of file:FileRunRequest
The request handed to every runner when the user hits Run:
The
extension convenience property is the most common way to match a file:
FileRunnerContext
Runtime helpers handed torun. Use it to interact with the host:
Running a command in the terminal
runInTerminal opens the terminal screen and executes the command directly — no login shell, prompt, or MOTD, only the command’s stdout/stderr and stdin:
FileRunner. To run a command or open an interactive shell from anywhere else in your plugin (toolbar action, settings, lifecycle), use TerminalManager.runInTerminal(...) / TerminalManager.openTerminal() instead. See Terminal.
Opening a custom screen
Runners that preview a file can navigate to a screen registered viaScreenRegistry:
ScreenRegistration lets you remove the screen earlier if needed.
Example
A Python runner registered duringonLoad:
Best practices
- Keep
supportscheap: It runs on every file open to decide whether to show the Run button - Register with a stable
id: Re-registering with the same id replaces the runner - Unregister on
onUnload: Keep theFileRunnerRegistrationand callunregister()to clean up - Use
runInTerminalfor interpreters: It handles opening the terminal, running the command, and setting the working directory