Open files with Whisk from the command line

One nice feature of GUI tools is to have a command line app which can quickly open files. I make use of this with BBEdit all the time, calling bbedit myfile.txt.

A user wrote me an email recently with a request of this feature for Whisk. I think it is a good request. Luckily there's also easy ways to do it right now by combining the alias command with macOS's open command.

  1. Determine which shell you are using. If you are using the default shell with macOS 10.15 or later, it is zsh. Prior to this it would be bash. If uncertain, you can test with this command:
    echo $SHELL
    
    (If you are using another shell, you'll need to determine which startup file it uses)
  2. If you are using zsh, use an editor to open the ~/.zshrc file. If you are using bash, edit the ~/.bashrc file.
  3. Add this line in that file and save:
    alias whisk='open -a "Whisk"'
    
  4. Restart your shell (close the terminal window and open a new one)

Now you'll be able to use the whisk command to open files in the Whisk application! Example:

whisk path/to/file.html