**Important:** Launch Obsidian from the terminal where the variable is set, or use the startup script. Desktop shortcuts won't have access to the variable.
1. **Generate a Nostr key** (if needed):
```bash
./start-obsidian.sh --generate-key
```
Add the shown export command to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.).
### Relays
2. **Set your private key**:
```bash
export SCRIPTORIUM_OBSIDIAN_KEY="nsec1..."
```
1. Open Settings → Scriptorium Nostr
3. **Configure relays**:
2. Click "Fetch" to get your relay list from Nostr relays
- Open Obsidian Settings → Scriptorium Nostr
3. Relays are automatically fetched from default relays
- Click "Fetch" to get your relay list
## Usage
## Usage
### Creating Events
### Creating Events
1. Open a Markdown or AsciiDoc file
1. Open a Markdown or AsciiDoc file
2. Run: `Create Nostr Events`
2. Run command: **Create Nostr Events**
3. Events are created, signed, and saved to `{filename}_events.jsonl`
3. A reminder modal will prompt you to update metadata
4. Update metadata in the file (see Metadata section below)
5. Click "OK" in the modal
6. Events are created, signed, and saved to `{filename}_events.jsonl`
All predefined metadata fields are shown in frontmatter/attributes with placeholder descriptions. Remove or update placeholders you don't need. Placeholder values are automatically skipped when creating events.
### Common Fields
- `kind` - Event kind (required)
- `title` - Document title (required for all except kind 1)
- `author` - Author name
- `summary` - Brief description
- `topics` - Comma-separated topics (available for all event kinds)
3. Install it to your Obsidian vault's plugin folder
4. Install and enable the obsidian-asciidoc plugin (required for .adoc files)
5. Start Obsidian with console logging enabled
Note: The obsidian-asciidoc plugin is required for this plugin to work properly
with .adoc files. It will be installed and enabled automatically.
On first run, you must provide the vault path. The path will be saved
to .scriptorium-vault-path for future use.
If the saved path becomes invalid (vault moved/deleted), you'll be
prompted to provide a new path.
The obsidian-asciidoc plugin is recommended for editing .adoc files
in Obsidian without crashes. It provides proper syntax highlighting
and editing support.
NOTES:
NOTES:
- The vault path is the folder containing the .obsidian directory
• Vault path is saved after first run
- The .obsidian folder may be hidden in your file manager (enable"Show hidden files")
• obsidian-asciidoc is installed automatically
- Plugin logs will appear in this terminal
• Plugin logs appear in this terminal
- Press Ctrl+C to stop Obsidian
• Press Ctrl+C to stop Obsidian
EOF
EOF
exit0
exit0
}
}
@ -185,22 +157,13 @@ NODE_SCRIPT
echo"Generated new Nostr key:"
echo"Generated new Nostr key:"
echo" Public key (npub): $npub"
echo" Public key (npub): $npub"
echo""
echo""
echo"To use this key, set it as an environment variable:"
echo"To use this key, add to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo""
echo" export SCRIPTORIUM_OBSIDIAN_KEY=\"$nsec\""
echo""
echo""
echo"Add this line to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make it permanent:"
echo" export SCRIPTORIUM_OBSIDIAN_KEY=\"$nsec\""
echo" export SCRIPTORIUM_OBSIDIAN_KEY=\"$nsec\""
echo""
echo""
echo"Then launch Obsidian from that terminal (or restart your shell) to use the key, by typing 'obsidian' or './start-obsidian.sh'."
echo"Then restart your shell or run: source ~/.bashrc"
echo""
echo""
echo"Note: The private key is hidden from the GUI for security. Only the public key (npub) is shown."
echo"⚠️ Keep your private key secure! Do not share it with anyone."
echo"To view the private key, you can use the following command:"
echo""
echo" echo $nsec"
echo""
echo"This will show the private key in clear text."
echo"Remember: The private key is only visible in the terminal and will not be available, unless you save it as an environment variable. Do not share it with anyone!"
}
}
# If generating key, handle it separately (no vault path needed)
# If generating key, handle it separately (no vault path needed)
@ -231,9 +194,8 @@ if [ -n "$1" ]; then
# Validate provided path
# Validate provided path
if ! is_valid_vault_path "$VAULT_PATH";then
if ! is_valid_vault_path "$VAULT_PATH";then
echo"Error: The provided path does not appear to be valid: $VAULT_PATH"
echo"Error: Invalid vault path: $VAULT_PATH"
echo"Please provide a valid path to your Obsidian vault"
echo"Please provide a valid path to your Obsidian vault folder"
echo"Note: The .obsidian folder may be hidden in your file manager."
exit1
exit1
fi
fi
@ -252,28 +214,20 @@ else
else
else
echo"Error: Saved vault path is no longer valid: $SAVED_PATH"
echo"Error: Saved vault path is no longer valid: $SAVED_PATH"
echo""
echo""
echo"The vault may have been moved or deleted. Please provide a new vault path:"
echo"Please provide a new vault path:"
echo""
echo"$0 ~/Documents/MyVault"
echo"Usage: $0 <path-to-obsidian-vault>"
echo"Example: $0 ~/Documents/MyVault"
echo""
echo""
echo"Note: The .obsidian folder may be hidden in your file manager."
echo"Run '$0 --help' for more information"
echo"For more information, run: $0 --help"
exit1
exit1
fi
fi
else
else
echo"Error: No vault path provided and no saved path found"
echo"Error: No vault path provided"
echo""
echo""
echo"This appears to be your first run. Please provide the path to your Obsidian vault:"
echo"First run requires a vault path:"
echo"$0 ~/Documents/MyVault"
echo""
echo""
echo"Usage: $0 <path-to-obsidian-vault>"
echo"The path will be saved for future runs."
echo"Example: $0 ~/Documents/MyVault"
echo"Run '$0 --help' for more information"
echo""
echo"The vault path is the folder containing the .obsidian directory."
echo"Note: The .obsidian folder may be hidden in your file manager (enable 'Show hidden files')."
echo"After the first run, the path will be saved and you won't need to provide it again."