Lookup 5e-style magic items in an Obsidian vault or a directory. Assumes one file per item, and formatting similar to:
# Noun of Action
* **Rarity:** uncommon
* **Type:** Wondrous item
* **Attunement:** No
* **Source:** 5.1 SRD (D&D 2014)
It does magic stuff...
but should also work with explicit properties:
---
rarity: uncommon
type: wondrous-item
attunement: [bard]
source: the-internet
---
# Lyre of Enchantent
Explanation of magic item...
Only tested on macOS, I'm afraid.
magic-items -h
magic-items [-a attune] [-b base_dir] [-d items_dir] [-f force_dir]
[-n num] [-r rarity] [-s source] [-t type] [-v vault]
[match]
Options:
-h show help
-a *str*
search for items with attunement containing *str*
-b *base_dir*
set the location of your vaults to *base_dir*
-d *dir*
search within *dir* in the vault
-f *dir*
force the directory to *dir* (disables -o, ignores any
values in the environment or added via -b, -d, -v)
-n *number*
show at most *number* results, picked randomly
-o open matches in Obsidian
-r *str*
search for items with rarity of *str*
-s *str*
search for items with a source containing *str*
-t *type*
restrict results to the given *type* (eg potion, scroll, weapon)
-v *name*
set the vault to *name*
*match*
restrict results to files that contain word/phrase *match*
(case-insensitive)
Environment Variables:
- OBSIDIAN_BASE_DIR
Set to the directory that contains your vaults. Can be overridden
with the -b
argument.
- OBSIDIAN_DND_VAULT
The name of the vault that contains the magic items. Can be
overridden with the -v
argument.
% magic-items -f /Users/norm/Downloads/5e_artisanal_database/magic_items/md/5.1_srd_\(d\&d_2014\) dragon
necklace-of-adaptation.md
dragon-slayer.md
orb-of-dragonkind.md
deck-of-illusions.md
dragon-scale-mail.md
arrow-of-slaying.md