Skip to content

shell

shell is used to handle shell operations, such as:

  • Opening files and URLs
  • Showing items in their folder
  • Moving items to the bin
  • Executing command line commands
import { shell } from 'miletus';

shell.beep();

Methods

beep()

Plays the OS beep sound.

showInFolder(path)

  • path string - Path to the file.

Show path in a folder.

openFile(path)

  • path string - Path to the file.

Open path with the default application.

openURL(url)

  • url string - URL path.

Open url with the default web browser.

moveToBin(path)

  • path string - Path to the file.

Move path to the trash.

execute(command[, workDir])

  • command string - Command to be executed.
  • workDir string (optional) - The working directory in which to execute the command.

Execute a command line command.

Returns Promise<string> - Resolves with a string containing the command line output.