URI Commands

by kzhovn
5
4
3
2
1
Score: 55/100

Description

Category: 3rd Party Integrations

The URI Commands plugin enables users to add custom URI-based commands to the Obsidian command palette, enhancing integration with Obsidian's URI scheme and other system-supported URI schemes. It allows for dynamic placeholders such as file name, path, content, and metadata, which are automatically URL-encoded for seamless use. This flexibility supports a wide range of use cases, from opening vaults or specific notes in Obsidian to integrating with external programs and services like email, Spotify, or HackMD. Users can customize URIs to perform tasks like appending text to a daily note, opening external websites, or interacting with metadata fields. The plugin is compatible with other tools like Advanced URI and Hotkey Helper for extended functionality.

Reviews

No reviews yet.

Stats

44
stars
7,210
downloads
0
forks
1,672
days
467
days
467
days
2
total PRs
0
open PRs
0
closed PRs
2
merged PRs
9
total issues
3
open issues
6
closed issues
0
commits

Latest Version

a year ago

Changelog

It was not working; now it is.

Thank you @vorpalvorpal for the very helpful bug report (#9) and @mcburton for identifying the issue, which I have acted on a totally reasonable two years later.

README file from

Github

Overview

This plugin allows you to add custom URI commands to the command palette. Can be used with the Obsidian URI scheme, as well as any other URI scheme your computer supports.

Placeholders

You can use the placeholders below in your URI. All of these are URL-encoded for you unless you turn off URL-encoding, so you don't need to worry about your text having any unescaped illegal or reserved characters.

All commands with placeholders are hidden when there is no active file.

Placeholder Description
{{fileName}} Just the base name of the file, without the filepath or file extension.
{{filePath}} Path, relative to the vault, to the current file. E.g. FolderName/filename.md
{{fileText}} Entire contents of the file, including frontmatter. Available only in markdown files.
{{selection}} Your current selection. If nothing is selected, placeholder is replaced by the empty string.
{{line}} Current line.
{{vaultName}} Name of the current vault.
{{meta:FIELD_NAME}} The value of the metadata field corresponding to FIELD_NAME. Note that if there are multiple values in one field (as a comma-separated list or [array]), the values in the field will be inserted in the URI as a comma-separated list. Requires MetaEdit.

Examples

Obsidian

  • Open the vault work vault: obsidian://open?vault=work%20vault
  • Open the note hotkey reference in the vault my vault: obsidian://open?vault=my%20vault&file=hotkey%20reference
  • Append your selection to today's daily note (requires Advanced URI plugin): obsidian://advanced-uri?vault=&daily=true&data={{selection}}&mode=append
  • Open this plugin's settings page (requires Hotkey Helper plugin): obsidian://goto-plugin?id=uri-commands&show=config

Other programs

  • Open an email draft of your current note in your mail client: mailto:[email protected]?subject={{fileName}}&body={{fileText}}
  • Email your current note to Roam: mailto:[email protected]?subject={{fileName}}&body={{fileText}}
  • Open a spotify album: spotify:album:4niKC11eq7dRXiDVWsTdEy
  • Open a new HackMD collaborative markdown pad: https://hackmd.io/new
    • Note that for websites, you must start your URI with https:// or http://, not www.
  • Open the wikipedia page for the contents of the YAML field "topic": https://en.wikipedia.org/wiki/{{meta:topic}}
  • Look up your selection in your Calibre library: calibre://search/_?q={{selection}}
  • Open the url in the "external-link" metadata field: {{meta:external-link}}
    • Note that for this to work, URL encoding must be turned off
  • Advanced URI: enables URIs for daily note, appending text to a file, jump to heading, search and replace, and more
  • Hotkey Helper: enables Obsidian URIs for plugin READMEs, settings, and hotkey configurations

Help

For more information on URIs in Obsidian, see the Obsidian documentation. An incomplete list of other URI schemes can be found here.

Thanks

Parts of this code, especially the icon picker, borrow heavily from phibr0's plugins, including Obsidian Macros and Customizable Sidebar.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Actions URI
4 years ago by Carlo Zottmann
A plugin for Obsidian (https://obsidian.md) that adds additional `x-callback-url` endpoints to the app for common actions — it's a clean, super-charged addition to Obsidian URI.
Advanced URI
5 years ago by Vinzent
Advanced modes for Obsidian URI
Automation
2 years ago by Benature
Buttons
5 years ago by Sam Morrison
Buttons in Obsidian
Chorded Hotkeys
3 years ago by Trey Connor Meyers
Type multiple letters at the same time to trigger text insertion, template insertion, or command execution.
Code Blocks commands
8 months ago by dragonish
Provide commands to insert code blocks with markup, and support triggering commands with backticks.
Command Block List
2 years ago by Ryota Ushio
Hide unwanted commands from the command palette in Obsidian.
Command Tracker
2 years ago by namikaze-40p
An Obsidian plugin that tracks the number of times the command is used.
Commander
4 years ago by Johnny✨ and phibr0
Commander - Obsidian Plugin | Add Commands to every part of Obsidian's user interface
Commando
3 years ago by qaptoR
Obsidian Plugin for automatically repeating commands with loop iterations
File path to URI
5 years ago by Michal Bureš
Convert file path to uri for easier use of links to local files outside of Obsidian
Line Commands
2 years ago by charliecm
Adds commands to quickly select, copy, cut, and paste lines under the selection or cursor.
Open Plugin Settings
3 years ago by Mara-Li
Create a command that open the settings tabs of a registered plugin (because I was bored to open the parameters).
Shell commands
5 years ago by Jarkko Linnanvirta
Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
URI Converter
a year ago by wenlzhang
An Obsidian plugin to convert Obsidian URIs to Obsidian internal links.