neves00724 downloadsCopy AI-friendly Markdown location indexes as file path plus line number.
LineRef Copier is a local Obsidian plugin for copying precise Markdown note references from the cursor line, a selected phrase on one line, or a selected range across multiple lines.
Its main purpose is to help you interact with AI agents more precisely. Instead of describing "the sentence inside the long paragraph near the middle of this note", you can copy an exact index and paste it into an AI conversation, task, issue, or prompt. This gives the agent a concrete location to inspect or discuss.
LineRef Copier supports three reference levels:
Projects/Research/idea.md:25Projects/Research/idea.md:25:8-42Projects/Research/idea.md:25:8-27:19path/to/file.md:25.Open a Markdown note, then run Copy line reference from the command palette in one of these situations:
Paste the copied reference into your AI agent chat when you want the agent to locate a specific note position.
When Copy notice is enabled, Obsidian shows a notice like:
LineRef Copier: copied Projects/Research/idea.md:25:8-27:19
Cursor line:
filePath:lineNumber
Example:
Projects/Research/idea.md:25
Single-line selection:
filePath:lineNumber:startColumn-endColumn
Example:
Projects/Research/idea.md:25:8-42
Multi-line selection:
filePath:startLine:startColumn-endLine:endColumn
Example:
Projects/Research/idea.md:25:8-27:19
Line and column numbers are 1-based, matching what people usually expect when discussing files. For selections, the copied range points from the first selected character to the selection end position.
Open Settings -> Community plugins -> LineRef Copier.
If absolute paths are unavailable in the current Obsidian environment, the plugin falls back to the relative path and shows a notice.
Install dependencies:
npm install
Build the plugin:
npm run build
Run lint checks:
npm run lint
During local testing, reload the plugin in Obsidian after rebuilding so the latest main.js is loaded.
This repository includes a release workflow at .github/workflows/release.yml.
It runs when you push a Git tag, builds the plugin, then creates a draft GitHub Release and uploads:
main.jsmanifest.jsonstyles.cssRecommended release steps:
manifest.json version and versions.json are updated (for example 1.0.1).v prefix), such as 1.0.1.LineRef Copier works locally. It does not make network requests, collect analytics, upload vault content, or send file paths outside Obsidian.