Terminal Power Users - How do you use command line tools in conjunction with Obsidian?

Self-explanatory title. Advanced search? Automations? What do you do?

4 Likes

One thing I do is use Jekyll to publish my website from my Vault.

So I just

cd directory
git add .
git commit -m “commit message”
git push

And then it updates my repo, which updates Netlify, which updates my website!

I have no idea what I’m really doing, those are just the commands that @daretorant told me to execute in order lol

This is my website: https://robhaisfield.com/

This is my Jekyll theme: GitHub - raghuveerdotnet/simply-jekyll: A simple yet highly functional jekyll theme with backlinks, wiki-style links, context menu, page preview, sidenote etc

I have a periodic table generator - a python script that reads a CSV file and creates chem-periodic-static-iodine.md etc;, which includes hand crafted chem-periodic-iodine.md if it exists.
That allows me to have an in-workflow table generated decent looking updatable complex table that I can also attach custom, hand written notes to.

grep and find are not really useful, because the obsidian built in search is so good.

I do use prefixes, so sometimes I move things into folders (mv fintech-* fintech), but it’s not making much of a difference.

1 Like

Things I’ve been using so far:

  • Calibre’s command-line interface to auto-extract a book description/blurb from the title and auto-download a cover image. This works great as a template to add quotes and notes for each book I read.
  • My tool for bulk tagging and customizing hypothes.is annotations. I use this for organizing research literature, bookmarks, and textbook notes.
  • This to create a nicely formatted markdown doc of repositories I’ve starred on Github. I usually star repos I plan on using later in different projects, so with this I can transclude their descriptions into project planning.
  • I also have a vault linked to a blog website with Pelican and Netlify.

Things I’d like to have/implement:

  • A (food) recipe manager that stores a database of ingredients (and possible substitutions), and has tagging/linking functionality. Right now I just have a template that I manually copy recipes into and then simplify into the core instructions. Feels like something that a command-line tool would be perfect for automating.

Interested in hearing more ideas and usecases!

1 Like

@ninjani I’m really interested to see your Calibre script, have you posted it anywhere?

Here it is: Get a book description from the title · GitHub! I’ve added a tiny description on using it with Obsidian and Templater.

I would love to see that food recipe manager you describe :grinning_face_with_smiling_eyes:

Just found https://cooklang.org/ which looks like it may come close!

1 Like

Mainly advanced search (rga and/or rga-fzf) when on Linux (Pop!_OS and Kali in my case). If I’m on my iMac I more often use the search functionality of Devonthink instead, as it comes with a bunch of bells and whistles (dynamic AI powered listing of related files etc). The main reason for using either for searching is that they can find content within any filetype in my Obsidian vaults, which has files of many filetypes.

Otherwise I also have a VIM (or actually NeoVIM right now) setup on both Mac/Linux that acts as a secondary input method. If I wish to type articles in a clutter-free environment I sometimes prefer that to other tools, and I always have a bunch of cmd-line windows open anyways for various purposes (activity monitoring, spotify, ssh etc) so using one of them for quick data input comes natural.

I also manage git via cmd-line to update my web site which is running Grav CMS. This means I type the content of my articles in Obsidian but then move them over to another folder, which I prefer to keep separate from Obsidian vaults (mostly due to file naming conventions), when I am getting close to publish.

I’ve created a cheatsheet script that prints my obsidian cheatsheet using glow. I use yadm to sync my configs so all I do is symlink the cheatsheet directory. If a note is called BashAnything.md I can just run “cheat bash” although I try not to use weird naming.

If this sounds useful I can post the script.

Just polished off my solution to archive any external links in my Vault.
I have some custom metadata based on @tallguyjenks PKM for any relevant URLs for that note.
I use grep to search recursively in the Obsidian vault for any file that contains the Metadata tag URL: I then just match text after that tag with http.* to return all URL’s (of importance) in my vault.

I then send those URL’s to Archivebox which will archive all the URL’s and of course skips any that is already in the archive.

It then updates all the notes that had URL’s archived with another metadata tag Archived: which then gets populated with the date as a link in ISO 8601 format.

This is really powerful for me as I do a lot of bookmarking in Obsidian, along with capturing various online media. Thankfully Archivebox is a reasonably robust way of making sure the website is captured in multiple formats, along with grabbing 99% of the media on a webpage.

Some improvements I’m working on are

  • Updating URL’s in the notes with the archived version.
  • The script runs with cron daily so I could probably only run this for files modified in the last day
  • Archive any link (more than just ones in the tag). This would be trivial to do.

If any of you have suggestions I would love to hear them!

I created a pseudo-utility for my zettelkasten vault in python. Named zk.py it lets me do a few things. Main thing is that it has a command that, when given a citekey, it queries the Zotero API to pull the metadata and quick-copy format and then creates a new source note in my vault named something like authorname2015 The title of the thing with a predefined template in it. At the top of the note it has the reference copied from Zotero automatically pasted in so its easy to refer to if I ever need it.

I use this with a simple Alfred workflow so that I can simply open Zotero, copy the citekey of the stored reference, and then trigger Alfred and run sn thecitekey e.g. sn bogle2017 and it will create the new source note in the correct place with the correct name & template etc, all behind the scenes. Then I just switch over to Obsidian and trigger the quick switcher and paste in the citekey and it takes me right to the new note so I can start taking notes from the source. (or I can just choose to create the source note from Zotero but not open Obsidian, so I’m creating a note to be processed later instead of now)

I’m also considering experimenting with iOS shortcuts and the Drafts app for pushing to the vault using either the Drafts Obsidian action or a generic create/append to file action.