Shell Path Copy

by Charles Kelsoe (ckelsoe)
5
4
3
2
1
Score: 56/100

Description

The Shell Path Copy plugin makes it easier to copy file and folder paths in formats that match your target system, whether you're working on Windows, macOS, Linux, or even a mobile device connected to a remote server. It integrates directly into the right-click menu and command palette, offering relative paths, absolute paths, and file:// URLs, all formatted appropriately for the platform. You can configure which options appear, choose how paths are wrapped to handle spaces, and get visual confirmation when a path is copied. This helps avoid manual edits when pasting into terminals, scripts, or AI assistants like Claude Code or Gemini CLI.

Reviews

No reviews yet.

Stats

10
stars
5,604
downloads
0
forks
370
days
2
days
41
days
19
total PRs
0
open PRs
3
closed PRs
16
merged PRs
8
total issues
0
open issues
8
closed issues
82
commits

Latest Version

a month ago

Changelog

Added

  • Custom formats moved onto their own settings pages. Custom formats → Manage formats lists every format split into Enabled and Disabled groups, each row opening that format's page, and the entry row carries a live count such as "9 of 14 enabled". Enabled and disabled rows are marked with a state icon.
  • New Custom formats → Format order page. Drag the rows to set the order enabled formats appear in; that one order drives the right-click menu, the ribbon, and the command palette.
  • The format editor renders the selected icon next to the icon picker, so the control shows the icon itself and not only its name.
  • Discord community link in the settings footer and the README.

Changed

  • Menu placement is now additive. "Group formats under a submenu" and "Group with Obsidian's copy path" are independent: with both on, a format appears in both submenus, and a format set to "Show in root menu" appears at the top level on top of whichever submenu it lands in. Previously, grouping with Obsidian's copy path suppressed both the plugin's own submenu and root placement entirely. If you use Obsidian's copy path grouping and have formats pinned to the root, those formats now also appear at the top level of the menu.
  • "Show in menu" is now "Show in right-click menu" and "Pin to root menu" is now "Show in root menu". Both descriptions name the destination for the layout currently selected, instead of describing a submenu that may not be in use.
  • Minimum Obsidian version raised to 1.13.1, which is where the settings API gained the value display used by the custom-formats entry rows.

Fixed

  • The icon dropdown in the format editor reported "clipboard-copy" for any format whose icon came from Browse all icons, because the curated list had no entry for it. The stored icon is now seeded into the list, so the control always shows the real value.
  • Footer links rendered as "GitHub|Report issues" with the separator spacing collapsed. The footer row is a flex container and dropped the whitespace at each item's edges; spacing is now a layout gap.

VirusTotal scan

README file from

Github

Shell Path Copy for Obsidian

CI Release GitHub Downloads GitHub Stars Obsidian License Latest Release

Copy a file or folder path out of your Obsidian vault. Right-click, pick a format, paste.

What it does

Right-click a file or folder, pick a format, and the result is on your clipboard. The command palette does the same for the note you have open.

It comes with formats for relative and absolute paths, file:// and Obsidian URLs, Markdown and wiki links, filenames, and links that point at a heading or a block. Four are turned on out of the box; the rest take one toggle in settings.

If none of them fit, you can build your own. A format is a template such as <filename> -> <obsidian-url>, and the plugin fills in the tokens when you copy. This is optional. If the built-in formats cover you, you never have to touch a template.

Works on desktop and mobile.

Why this plugin?

Obsidian often sits next to a terminal or an AI assistant like Claude Code or Gemini CLI. You might run Obsidian on Windows with a WSL terminal, or on an iPad connected to a remote Linux server. Either way, you need a path out of your vault and into a shell command, a prompt, or a document, in the format that target expects.

Obsidian's own "Copy file path" command is buried in the command palette and gives one format. Shell Path Copy puts copy actions in the right-click menu and the command palette, and lets each format be what you want.

Installation

  1. Open Obsidian settings.
  2. Go to Community plugins.
  3. Click Browse.
  4. Search for Shell Path Copy.
  5. Click Install, then Enable.

Manual installation

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Create a folder named shell-path-copy in your vault's .obsidian/plugins/ directory.
  3. Copy the three files into it.
  4. Reload Obsidian.
  5. Enable Shell Path Copy in Settings → Community plugins.

BRAT (optional, for pre-release testing)

BRAT installs pre-release builds before they reach the Community Plugins marketplace. Regular users should install from Community Plugins instead.

  1. Install the BRAT plugin from Community Plugins.
  2. Open BRAT settings and click Add Beta Plugin.
  3. Enter https://github.com/ckelsoe/obsidian-shell-path-copy.
  4. Click Add Plugin.
  5. Enable Shell Path Copy in Settings → Community plugins.

Quick start

You can copy from four places:

  • Right-click a file or folder in the file explorer.
  • Right-click inside an open note. The formats act on that note, and the heading-aware formats link to the heading your cursor is in.
  • Command palette (Ctrl/Cmd+P): type Copy: and pick a format. It acts on the active file.
  • Ribbon (optional): turn on Show in ribbon for a format to add a left-ribbon icon that copies it from the active note in one click. Off by default, so the ribbon stays uncluttered until you opt a format in.

In the right-click menu, the enabled formats sit inside a Copy path as submenu to keep the menu tidy. Pick the format you want and the result lands on your clipboard. In settings you can turn that submenu off, show individual formats at the menu root as well, and fold every format into Obsidian's native Copy path submenu so all path-copy choices (the built-in ones and yours) live in one place. Those options are independent, so a format can appear in more than one of those places at once.

Out of the box four formats are enabled: Relative Linux/macOS path, Relative Windows path, Obsidian URL, and Markdown link. Open the settings to enable the others or add your own.

Built-in formats

These formats are seeded into every vault. Enable, edit, or delete any of them in settings.

Format Template Example result
Relative Linux/macOS path <relative-path-unix> `./folder/file.md`
Relative Windows path <relative-path-windows> `.\folder\file.md`
Absolute path <absolute-path> `C:\Users\you\vault\folder\file.md`
file:// URL <file-url> file:///C:/Users/you/vault/folder/file.md
Obsidian URL <obsidian-url> obsidian://open?vault=MyVault&file=folder%2Ffile
Markdown link <markdown-link> [[file]]
Filename <filename> file
Filename with extension <filename-ext> file.md

Seven more formats ship disabled, ready to enable or copy from:

Format Template Example result
Example: name and Obsidian URL <filename> -> <obsidian-url> file -> obsidian://open?vault=MyVault&file=folder%2Ffile
Example: line reference <filename-ext>#L<line-number> file.md#L42
Example: name and line number <filename-ext> Line <line-number> file.md Line 42
Obsidian URL (to heading) <obsidian-url-heading> obsidian://open?vault=MyVault&file=folder%2Ffile%23Notes
Wiki link (to heading) <wikilink-heading> [[file#Notes]]
Obsidian URL (to block) <obsidian-url-block> obsidian://open?vault=MyVault&file=folder%2Ffile%23%5Ea1b2c3
Wiki link (to block) <wikilink-block> [[file#^a1b2c3]]

The "to heading" and "to block" formats link to the heading or block your cursor is in when a note is open, and to the file otherwise. They are the way to get an Obsidian link that jumps to a section. Block links need a ^id marker in the note; if the block has none, the plugin creates one (see Block links below). Absolute path and file:// URL are desktop-only; on mobile they produce nothing.

Custom formats

A custom format is a token template. Build one in settings:

  1. Open Settings → Community plugins → Shell Path Copy → Options.
  2. Open Custom formats → Manage formats. Click + to add a format, or click any existing format to open its own page.
  3. Set the fields:
    • Enabled: turn the format on or off everywhere (menu, command palette, ribbon).
    • Name: shown in the menu, command palette, and ribbon.
    • Icon: the icon shown next to the format in the menu, command palette, and ribbon. The icon itself is displayed beside the picker. Choose a common one from the dropdown, or click Browse all icons to search the full set of Obsidian icons.
    • Template: the token template. The token palette below the field inserts a token at the cursor. A live preview shows the rendered result, and a Desktop / Mobile row shows where the template works.
    • Wrapping: none, double quotes, single quotes, or backticks, applied around the whole result.
    • Show in right-click menu, Show in command palette, and Show in ribbon: where the format appears. These are independent, so a format can live on the ribbon without appearing in any menu. The ribbon adds a left-rail icon that copies the format in one click; it is off by default.
    • Show in root menu: also show this format at the top level of the right-click menu, on top of the submenu it appears in. Useful for the one or two formats you reach for most.
    • Show on: limit the format to files, folders, or both. Formats that use file-specific tokens (like <obsidian-url>, wiki links, or line/heading tokens) are files-only automatically, since those do not resolve for folders.
  4. Reload Obsidian so the command and ribbon icon register.

Formats are listed under Enabled and Disabled headings, so what is live is readable at a glance. To change the order they appear in, open Custom formats → Format order and drag the rows. That one order drives the right-click menu, the ribbon, and the command palette. To place the ribbon group relative to other ribbon icons, drag it within Obsidian's ribbon. Global options are searchable from Obsidian's settings search.

Tokens

A token is a name in angle brackets. Unknown tokens are left as typed. Escape a literal bracket with a backslash (\<).

Token Resolves to Availability
<filename> Name without the final extension All
<filename-ext> Full name with extension All
<extension> Extension without the dot All
<relative-path> Vault-relative path, host OS style All
<relative-path-unix> Vault-relative path, Linux/macOS style All
<relative-path-windows> Vault-relative path, Windows style All
<absolute-path> Full filesystem path Desktop only
<file-url> file:// URL Desktop only
<obsidian-url> obsidian://open deep link All
<vault-name> Vault name, raw All
<vault-name-encoded> Vault name, URL-encoded All
<markdown-link> Markdown link in the configured format All
<wikilink> Wiki-style link All
<date> Current date, YYYY-MM-DD All
<time> Current time, HH:mm All
<line-number> Active editor cursor line Editor only
<line-start> First line of the editor selection Editor only
<line-end> Last line of the editor selection Editor only
<line-range> Selected line range like 42-58, or a single line when nothing is selected Editor only
<heading> Heading the cursor sits under Editor only
<obsidian-url-heading> Obsidian URL to the cursor heading, or the file when there is none All
<wikilink-heading> Wiki link to the cursor heading, or the file when there is none All
<block-id> Block id at the cursor, created if needed Editor only
<obsidian-url-block> Obsidian URL to the cursor block, or the file when there is none All
<wikilink-block> Wiki link to the cursor block, or the file when there is none All
<nl> A literal newline All

"Desktop only" tokens are blank on mobile. "Editor only" tokens fill in only when the file you copy is the file open in the editor. The settings preview flags both cases as you build a template.

The full token reference, with worked examples and fallback behavior, is in token-usage.md.

The block tokens (<block-id>, <obsidian-url-block>, <wikilink-block>) link to a specific block, the paragraph or list item your cursor is in.

A block link needs a ^id marker in the note. Obsidian works this way for all block links. If the block at your cursor does not already have one, Shell Path Copy generates a short id and writes it into the note, exactly as Obsidian does when you create a block link yourself. This is the one case where the plugin modifies a note; every other format is read-only.

Block links support paragraphs and list items. If you copy a block format with no note open, or with the cursor on a heading, table, code block, or other multi-line construct, the block link falls back to a plain file link and nothing is written.

Settings

Open Settings → Community plugins → Shell Path Copy → Options.

Global options:

  • Show notifications: show a notice when something is copied.
  • Markdown link format: wiki-style ([[filename]]) or standard Markdown ([filename](path)). Used by the <markdown-link> token.
  • Notify when a token could not be resolved: show a notice when a desktop-only or editor-only token is left blank.
  • Group formats under a submenu: show every format inside the plugin's own Copy path as right-click submenu (on by default).
  • Group with Obsidian's copy path: show every format inside Obsidian's native Copy path submenu, alongside the built-in entries like as Obsidian URL and from vault folder (off by default).

The two grouping options are independent, and menu placement is additive:

Group under a submenu Group with Obsidian's copy path Where formats appear
on off Inside Copy path as
off on Inside Obsidian's Copy path
on on Inside both submenus
off off At the top level of the right-click menu

A format set to Show in root menu also appears at the top level, on top of whichever submenu it lands in.

The Custom formats section holds two pages:

  • Manage formats: every format, split into Enabled and Disabled groups, with the enabled count on the row. Open a format to edit it, add one with +, or remove one by selecting its row and pressing Delete.
  • Format order: drag to set the order enabled formats appear in. One order drives the right-click menu, the ribbon, and the command palette.

Everything else is per format, on that format's own page.

Using a custom file explorer

Shell Path Copy's right-click items appear in Obsidian's native file explorer. If you use a plugin that replaces the file explorer, such as Notebook Navigator, those menu items will not show there. Every format is still available through the command palette (Ctrl/Cmd+P), which works on the active file regardless of which explorer you use.

Example workflows

Remote terminal. You are viewing My-Project-Plan.md in Obsidian on an iPad, connected to a Linux server over SSH. Right-click the file, choose Relative Linux/macOS path, and paste `/My-Project-Plan.md` straight into your terminal session.

AI assistant line reference. Enable the Line reference example format. With a note open at the line you care about, run it to copy My-Project-Plan.md#L42, ready to drop into a prompt for Claude Code or Gemini CLI.

Cross-app links. Use the Obsidian URL format to create links that open a note directly in Obsidian from a task manager, a wiki, or an automation tool.

Community

Questions, ideas, and general discussion happen on Discord. For anything that needs tracking, a GitHub issue is still the better home.

Contributing

Bug reports and feature requests are welcome via GitHub Issues. For local build, test, and pull request guidelines, see CONTRIBUTING.md.

Privacy

Shell Path Copy collects no data, stores nothing outside your own vault, and contains no network code. It reads a path you select and places it on your clipboard. The one exception is the block link formats: when you use one, the plugin may add a ^id marker to a note so the block can be linked to, exactly as Obsidian does for its own block links. See PRIVACY.md for the full privacy policy and liability disclaimer, and SECURITY.md for the security policy.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments

  • Thanks to @craziedde for feature requests and feedback that shaped the plugin.
  • Inspired by the need for better file path handling when working with AI coding assistants.
  • Built for Obsidian using the Obsidian API.
  • Thanks to the Obsidian developers and community.

Support

If you find this plugin helpful, consider:

  • Starring the repository on GitHub.
  • Reporting bugs or suggesting features via GitHub Issues.
  • Joining the Discord to share how you use it.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Metadata Menu
4 years ago by mdelobelle
For data management enthusiasts : type and manage the metadata of your notes.
Claude Sidebar
a month ago by derek-larson14
Run Claude Code, Codex, and other agent CLIs in Obsidian
Show Current File Path
6 years ago by Ravi Mashru
Obsidian plugin to show the file path of the current file in the status bar
Pixel Perfect Image
2 years ago by Johan Sanneblad
Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.
DOCX Exporter
9 months ago by Kanshurichard
An Obsidian plug-in, aiming to help users easily export note content into DOCX format.
Sync Vault CE
a year ago by Camus Qiu
Professional cloud sync & VFS for Obsidian. Features zero-space VFS, 4K streaming, MCP AI engine, and P2P collaboration. Supports Baidu/Aliyun/Quark/WebDAV/S3.
External File Embed and Link
2 years ago by oylbin
Embed and link local files outside your obsidian vault with relative paths for cross-device and multi-platform compatibility.
Hyperlink Remover
a year ago by Daniel Agafonov
Easily remove hyperlinks and wikilinks from selected text or the entire note.
File Explorer Reload
4 months ago by mnaoumov
Obsidian Plugin that reloads the file explorer files list
Copy Path
a year ago by shumadrid
An Obsidian plugin that adds context menu actions for copying the full and vault relative path of a file/folder.
Root Folder Context Menu
3 years ago by mnaoumov
Obsidian Plugin that enables context menu for vault root folder
Context Command Hider
2 years ago by Mara-Li
This plugin allows you to hide every command from the Obsidian's right-click context menu.
Open in Cursor
a year ago by awaken233
An Obsidian plugin to open files in Cursor IDE or other VSCode-based editors (VSCode, Kiro, etc.) with automatic cursor position jumping. 一个可以在 Cursor IDE 或其他类 VSCode 编辑器中打开文件并自动跳转光标位置的 Obsidian 插件。
Enhanced Image
2 years ago by situ2001
Enhance the experience of image in Obsidian, seamlessly.
Floating Notes
a month ago by haotiencheng
Floating popout window for instant note capture in Obsidian, inspired by Raycast Notes.
Tab File Path
a year ago by John Burnett
HTTP Link Maker
a year ago by Kenneth Christensen
Create HTTP links for Obsidian notes that work on all your devices
Double-Click Image Opener
6 months ago by atman
An Obsidian plugin to open images in your default system viewer with a double-click.
Copy Local Graph Paths
a year ago by Amy Z
copy-local-graph-paths is a simple Obsidian plugin that copies the paths of notes linked to your current page.