I can’t live without spellcheck, so I wrote a quick little script to make it easier to use aspell. Aspell is a command line spellcheck program.
I know this will work with Linux and Macs. It probably will Windows as well, but I’m unsure about the setup.
First, install aspell:
Macs
$ brew install aspell
Linux
$ sudo apt install aspell
$ sudo yum install aspell
Create the script using your favorite text editor:
$ vim spchk.sh
#!/bin/bash
# set vault directory
vault=~/Dropbox/obsidian-vault/ <-- change this path to where your obsidian vault is
# search for file, set path
obsidian_file=$(find $vault -name "${*}.md" -exec echo {} \;)
# run spell check on file
aspell --dont-backup check "$obsidian_file" <-- If you want backup files remove "--don't-backup"
Set file permission:
$ chmod 750 spchk.sh
Run spellcheck:
$ ./spchk.sh note name
If aspell finds a spelling error it will come up with a menu. If it returns silently, that means there are no spelling errors.
This is a quick and dirty way to use spellcheck with Obsidian via the command line. This setup can be improved by running out of bashrc as a function, set the path to the executable, etc. Hopefully, this will help someone, or spur someone to do something better. 