demo.mp4
This is a script to search, download and maintain a local repository of Obsidian plugins, which can be used as a reference for your own research and development.
As an absolute beginner to TypeScript, and a lover of Obsidian I often want to take a look at how someone has achieved a certain feature, called on an API, etc. A quick way to do that is by searching through the existing codebase of the ever growing library of plugins out there.
- First, set up your environment to have
jq
,fzf
, andgh
. On macOS the simplest way to do that is with Homebrew:brew install jq fzf gh
. - Copy the
obsidian-plugin-downloader.sh
script to a directory in your$PATH
- Make sure it's executable (
chmod +x obsidian-plugin-downloader.sh
) - You can adjust the
$OUTDIR
variable to set the destination directory of your choice (default:~/Downloads/obsidian-plugins
)
- Open a Terminal window (bash, zsh, etc)
- Type
obsidian-plugin-downloader.sh
- The list of plugins should be displayed. You can type in the search field at the top to filter the list—both the names and descriptions of the plugins are searchable.
- Choose one or more to download. You can move with the arrow keys, use <TAB> to select/deselect, or press ⌃A / ⌃S to select/deselect all.
- Make your selections and press <ENTER>
- Plugins should be downloaded!
The script will automatically check to see if you have the latest version of the plugin, and will download newer versions as needed.
It's nice to have a tool like ripgrep
to search through the code if you are looking for API references etc. For example:
rg 'this.app.workspace.onLayoutReady' --glob '*.ts'