The utils parameter contains references to configuration managers, database layers, system trays, and terminal controllers.
Storage database (storage)
A simple key-value database wrapper that reads and writes custom settings data:
get<T>(key: string): T - Retrieves custom data values.
set<T>(key: string, data: T): void - Saves custom configuration values.
Inter-process communication (ipc)
A simplified IPC utility to register listeners or emit events to the renderer process:
handle(channel: string, listener: (event: any, ...args: any[]) => any): void - Registers an IPC invocation handler (equivalent to ipcMain.handle).
on(channel: string, listener: (event: any, ...args: any[]) => void): void - Listens to events (equivalent to ipcMain.on).
send(channel: string, ...args: any[]): void - Dispatches events directly to the frontend window.
Pseudo-terminals (pty)
The utils.pty property exposes the native node-pty package directly. Use it to spawn sub-shells or python executors inside interactive terminal terminals:
Directory resolution
getInstallDir(id: string): string | undefined - Returns the absolute installation path of the card.
getConfigDir(): string | undefined - Returns the main application configurations folder path.
File and Git management
trashDir(dir: string): Promise<void> - Moves a directory to the operating system recycle bin.
removeDir(dir: string): Promise<void> - Deletes a directory permanently.
isPullAvailable(dir: string): Promise<boolean> - Checks if a directory contains a valid Git repository with pull updates.
pullDir(dir: string, showTaskbarProgress?: boolean): Promise<void> - Triggers a Git pull inside the target directory.
Extension pre-commands compatibility
getExtensions_TerminalPreCommands(id: string): string[] - Gathers startup shell commands (such as Conda activations or path configurations) registered by active extensions for the target card ID. Always prepend these commands to your execution array.
Last modified on June 21, 2026