One authoritative file. Stable, verifiable references to exact pages, lines, timestamps, and regions—from any app.
Status: Active pre-release (
v0.1.0) · Core: Portable Rust (1.88+) + SQLite · Integrations: Windows and Linuxrpin:link handlers, VS Code, Windows Explorer, Dolphin and SumatraPDF
rpin (Rootpin) is a local-first OS-level asset registry and reference resolver. Keep your manuals, schematics, PLC programs, photos, and videos wherever they already live on disk, and cite them anywhere with compact, durable URIs:
rpin:okuma-svc#page=142 page 142 of a PDF manual
rpin:machine-17-ladder@3f2a1c7#L220-L246 lines 220–246 at an exact Git commit
rpin:repair-2026-10-photos/038.jpg one photo inside a tracked job folder
rpin:training-video#t=125,175 a 50-second interval in a video
rpin:panel-wiring#xywh=120,80,340,210 a cropped pixel region in an image
Paste an rpin: link into a note, README, issue or engineering log. When the host passes a click to Rootpin, it verifies the target, checks policy and opens it in a supported viewer. A saved PDF annotation opens at the mark in SumatraPDF for Rootpin or at its verified page in another supported PDF viewer. Windows app compatibility
- Your files never move or change. Source files are strictly read-only to the reference core. Rootpin stores only metadata, logical root mappings, and SHA-256 fingerprints in a local SQLite database.
- Identity survives moves and renames. Every asset gets an immutable 128-bit Crockford Base32 ID plus optional human-readable aliases. If a file moves inside a storage root,
rpin repairorrpin relinkupdates its path without breaking existing links. - Fail-closed verification. Before opening anything, Rootpin runs
parse → resolve → verify → policy → launch plan → spawn. Silent hash drift, offline drives, unmapped roots, and quarantined files never launch the wrong file or fall back to arbitrary OS handlers. - Not tied to any note app. Plain-text
rpin:URIs work anywhere links or Markdown are stored, and portable JSON manifests let teams share asset identities across machines without copying file bytes or leaking local paths.
Install rpin, the CLI, and rpin-open, the desktop link handler. For a tagged version, check its Assets section for downloads for your platform. Building from source requires Rust 1.88+. GitHub Releases
On x86-64 Arch Linux and CachyOS, if the release includes pacman packages, download rpin and optionally the matching rpin-dolphin package for the Dolphin menu and Qt form. Run sudo pacman -U with the downloaded .pkg.tar.zst file paths. You can also build these packages from the checkout. Arch and CachyOS instructions
For a Cargo install on Linux, run the following from the checkout.
cargo install --locked --path . --root "$HOME/.local"
rpin --versionThis installs both binaries in ~/.local/bin. Add that directory to your PATH if your shell cannot find rpin. Use an install path without spaces for desktop link handling.
Choose a folder that already contains a PDF and substitute your own path and filename. A root is the name Rootpin uses for that folder in its registry.
rpin root add manuals "$HOME/Documents/manuals"
rpin capture "$HOME/Documents/manuals/manual.pdf" --alias manual --page 1 --markdown
rpin open 'rpin:manual#page=1'Use single quotes around the URI in the terminal. Capture prints [manual.pdf](rpin:manual#page=1). Add --copy to copy it to the clipboard with wl-copy on Wayland or xclip or xsel on X11.
Rootpin checks for Zathura, Okular, and Evince in that order. Desktop file managers use your desktop's PDF association. If Okular is installed at /usr/bin/okular, add okular = '/usr/bin/okular' to the settings file to use it for both terminal commands and clicked links.
For a Cargo install, register the desktop link handler with rpin install-protocol. If you installed the Arch package and want to make Rootpin the default, run xdg-mime default rpin-open.desktop x-scheme-handler/rpin. Test the handler with xdg-open.
xdg-open 'rpin:manual#page=1'If the test opens page 1, try clicking the Markdown link in a notes app that supports custom link schemes. A saved PDF annotation link on Linux opens the page containing the mark.
For a Cargo install, run rpin install-context-menu dolphin. With rpin-dolphin installed, the menu is available system-wide. In Dolphin, right-click one local file or folder inside a registered root and choose Rootpin → Copy Reference or Rootpin → Copy Markdown Link. The actions copy a reference to the whole file or folder.
Right-click a folder and choose Rootpin → Track Folder to enter a root name and optional comma-separated tags. The optional Qt form puts both fields in one window with the suggested name selected, so Tab takes you straight to tags. Without the form installed, kdialog asks for the fields in two prompts.
To add the form to a Cargo install, build it from the Rootpin checkout with CMake, a C++ compiler, and the Qt 6 Widgets development files. Install it into the same prefix as the Cargo binaries.
cmake -S gui/qt -B target/qt -DCMAKE_BUILD_TYPE=Release
cmake --build target/qt
cmake --install target/qt --prefix "$HOME/.local"rpin-open discovers rpin-dialog beside its own executable. If you copy a reference to a file outside a registered root, kdialog first asks you to choose a containing folder. Rootpin retries the copy after you confirm the root details. kdialog also shows the changed-file confirmation, which starts on Cancel.
Use rpin uninstall-context-menu dolphin to remove a menu registered by the CLI. Both CLI commands preserve a service menu you have customized by hand. To switch to a different rpin-open path, unregister with the current executable path first. Use pacman to remove a packaged menu.
For a Windows x64 install, choose rpin-windows-x64.msi. For a development build, open a successful CI run and look under Artifacts for the MSI or portable ZIP. CI runs
The MSI installs both executables in %LOCALAPPDATA%\Programs\Rootpin for your account and adds the folder to your user PATH. Link handling and Explorer actions are selected by default. Open a new terminal and run rpin --version. If you previously enabled these integrations with a Cargo or ZIP copy, follow the handoff instructions first. Windows installation and upgrades
For a portable copy, extract rpin-windows-x64.zip into a folder you intend to keep. Run .\rpin.exe --version there and keep rpin-open.exe beside it.
To install from source with Cargo instead, run
cargo install --locked --path .Cargo typically installs both binaries in %USERPROFILE%\.cargo\bin. On Windows, rpin-open also handles Explorer context menus and SumatraPDF shortcuts.
rpin root add manuals D:\manuals --tag referencerpin capture D:\manuals\okuma-svc.pdf --alias okuma-svc --page 142 --markdown --copyOutputs and copies:
[okuma-svc.pdf](rpin:okuma-svc#page=142)# Inspect verified local path, fragment, policy, and metadata as JSON
rpin resolve rpin:okuma-svc#page=142
# Preview the viewer launch plan without spawning anything
rpin open --dry-run rpin:okuma-svc#page=142
# Open page 142 directly in SumatraPDF
rpin open rpin:okuma-svc#page=142With the MSI, select these features in setup. For a Cargo or portable installation, run the following commands using that copy of rpin.
rpin install-protocol
rpin install-context-menuNow clicking [manual](rpin:okuma-svc#page=142) in Windows apps opens directly at page 142 without flashing a console window, and right-clicking files or folders in Windows Explorer exposes Copy Rootpin Reference and Track Folder actions.
Both opaque (rpin:<asset>...) and authority (rpin://<asset>...) forms are accepted and canonicalized to rpin:<asset>.... Full grammar and normalization rules are specified in docs/contracts/reference-syntax.md.
| Component | Syntax | Example | Viewer / Behavior |
|---|---|---|---|
| Asset ID or alias | <id | alias> |
rpin:01ARZ3NDEKTSV4RRFFQ69G5FAV or rpin:okuma-svc |
Immutable ID or alias (retired aliases stay resolvable) |
| Git revision | @<commit> |
rpin:plc-ladder@3f2a1c7#L10-L40 |
Opens committed text in a read-only VS Code Git tab. The Rootpin extension selects the cited lines. |
| Folder member | /<member/path> |
rpin:job-2026-10/038.jpg |
Contained member inside a tracked folder asset |
| PDF page | #page=<N> |
rpin:okuma-svc#page=142 |
Opens SumatraPDF -page 142, or zathura, okular or evince at that page on Linux (validates page count) |
| Saved PDF annotation | #annot=v1.<page>.<fingerprint> |
Copy from the Annotations window | Selects the matching mark in SumatraPDF for Rootpin. Without that viewer, opens the page that holds the mark |
| Line / range | #L<start>[-L<end>] |
rpin:ladder#L220-L246 |
Opens VS Code --goto <path>:<start>:1 (validates bounds) |
| Media time | #t=[npt:]<s>[,<e>] |
rpin:training#t=02:05,02:55 |
Opens mpv at start/end interval (W3C Media Fragments) |
| Image region | #xywh=[pixel:]x,y,w,h |
rpin:wiring#xywh=120,80,340,210 |
EXIF-aware bounds check; opens via RPIN_IMAGE_VIEWER |
Run rpin --help for the full command list or rpin <command> --help for detailed flags and examples. Pass --db <path> before any command to target a non-default SQLite database.
| Command | Purpose |
|---|---|
rpin root add <name> <path> [--tag <tag>]... [--allow-remap] |
Register a folder or add default tags. If you move the folder, use --allow-remap to point its existing references to the new location. |
rpin root list |
List configured storage roots as JSON |
rpin add <path> [options] |
Register a file or folder asset (--alias, --title, --notes, --tag, --sensitivity, --license, --quarantine) |
rpin alias <asset> <alias> |
Assign an immutable alias to an existing asset |
rpin alias retire <alias> |
Permanently retire an alias (never reassigned to another asset) |
rpin meta <asset> [options] |
Set/clear --title, --notes, --tag, --untag on an asset |
rpin list [--root <name>] [--tag <tag>]... [-q <text>] |
List and filter registered assets as JSON |
rpin parse <ref> |
Validate and canonicalize a reference without touching disk |
rpin resolve [--json] [--batch] <ref>... |
Resolve one or more references to verified local paths and metadata |
| Command | Purpose |
|---|---|
rpin capture <path> [options] |
Idempotently register/reuse a standalone file (or --folder-member), attach --page/--lines/--time/--xywh and --pin-git/--rev, output URI/--markdown/--json, and --copy |
rpin history [--limit <1..=500>] [--asset <asset>] |
Inspect durable capture events without polling the OS clipboard |
rpin history copy <event-id> |
Recopy a saved capture event (works even after the source file moves) |
rpin open [--dry-run] <ref> |
Verify, enforce policy, and open in an approved viewer (or reveal in file manager) |
rpin install-protocol / uninstall-protocol |
Register or remove the per-user rpin: link handler (Windows registry or Linux desktop entry) |
rpin install-context-menu / uninstall-context-menu |
Register or remove per-user Windows Explorer actions. Pass dolphin to target Dolphin on Linux |
| Command | Purpose |
|---|---|
rpin of <path> |
Reverse-lookup an on-disk path for its asset ID, aliases, policy, and live verification status |
rpin audit [--json] |
Read-only integrity check distinguishing offline_root, missing_file, and hash_mismatch |
rpin repair [--dry-run] [--text] [<asset>] |
Scan roots for moved files matching recorded size and SHA-256 |
rpin relink <asset> (<path> | --scan) |
Relink a moved or renamed file explicitly or by unique SHA-256 scan |
rpin revalidate [--dry-run] [--json] <asset> |
Preview or accept an authorized in-place content change (e.g. saved PDF annotations) |
rpin policy <asset> [options] |
Tighten --sensitivity, --license, or --quarantine; downgrades/unquarantine require --admin --reason <text> |
| Command | Purpose |
|---|---|
rpin export [--root <name>] [--out <file>] |
Export a metadata-only PortableManifest (schema_version: 1); hashes pending files and refuses to overwrite existing files |
rpin import [--dry-run] [--map-root <from>=<to>] <file> |
Preview or transactionally import a manifest with root remapping, verification reporting, monotonic policy merge, and deterministic conflict refusal |
- VS Code —
editors/vscode-rpin/adds Rootpin: Copy Reference to Selection and Rootpin: Copy Git-Pinned Reference to Selection, with dirty-buffer protection so line numbers always match the saved file on disk. It also opens inlinerpin:links from the Markdown editor. - SumatraPDF — Copy page links with the existing shortcuts, or select a saved mark in the Rootpin-enabled Annotations window to copy and reopen an annotation link.
- mpv — Copy the current audio or video timestamp as an
rpin:link withCtrl+Shift+Cor as Markdown withCtrl+Shift+M. Install the mpv script. - Windows Explorer —
rpin install-context-menuadds file and folder actions. Capturing a file outside registered roots prompts you to pick its storage root folder, logical name, and optional tags before copying the reference. - Markdown Frontmatter — Registering a
.mdfile automatically extractstitleandtagsfrom YAML frontmatter (read-only) unless overridden by CLI flags.
- Read-only source files (
SOURCE_ASSET_PROTECTION): Rootpin never writes, moves, renames, or deletes source assets.rpin export --outuses exclusive creation so an existing file can never be overwritten. - Quarantine enforced everywhere: Quarantined assets are never passed to viewers or previewers—
rpin openonly reveals them in the file manager. Quarantining a tracked directory automatically propagates downward to contained standalone files. - Strict root containment: Traversal segments, symlink escapes, Unicode normalization tricks, and imported manifest paths cannot escape their logical storage root.
- Unambiguous verification states:
rpin resolveandrpin importdistinguish cryptographically verified standalone files (verified) from folder members (folder_member), directories (directory), and unverified/missing targets. - No
unsafeRust: The crate enforces#![forbid(unsafe_code)]viaCargo.toml.
Checked in order:
--db <path>CLI flagRPIN_DBenvironment variabledbin the settings file- Default OS data directory:
- Windows:
%LOCALAPPDATA%\rpin\registry.sqlite3 - Linux / macOS:
$XDG_DATA_HOME/rpin/registry.sqlite3(or~/.local/share/rpin/registry.sqlite3)
- Windows:
Register your first storage folder with rpin root add <name> <folder> to create the registry. If rpin list reports missing_file (22), its message includes the database path it tried to open. An initialized registry with no assets returns [].
A clicked link starts rpin-open from the desktop, which on Linux does not see variables set in a shell startup file. Put the settings that must apply to clicks in a settings file:
- Windows:
%LOCALAPPDATA%\rpin\config.toml - Linux / macOS:
$XDG_CONFIG_HOME/rpin/config.toml(or~/.config/rpin/config.toml)
db = '/home/user/notes/registry.sqlite3'
okular = '/usr/bin/okular'Each key is a variable from the table below without RPIN_, in lower case, and each value is an absolute path. RPIN_OPEN_EXE has no key. An environment variable wins over the file. A misspelt key or a path that does not exist stops the command with a message naming the file. The full rules are in docs/contracts/settings.md.
| Variable | Purpose |
|---|---|
RPIN_DB |
Override default SQLite registry path |
RPIN_SUMATRAPDF |
Explicit path to SumatraPDF.exe |
RPIN_ZATHURA, RPIN_OKULAR, RPIN_EVINCE |
Explicit path to that PDF viewer. A configured viewer is used ahead of any found automatically |
RPIN_VSCODE |
Explicit path to VS Code (Code.exe / code) |
RPIN_MPV |
Explicit path to mpv for #t= video/audio fragments |
RPIN_IMAGE_VIEWER |
Explicit viewer executable for #xywh= image regions |
RPIN_FILE_MANAGER |
Override file manager executable used for reveal actions |
RPIN_OPEN_EXE |
Explicit rpin-open path for install-protocol / install-context-menu |
| Code | Meaning | Code | Meaning |
|---|---|---|---|
0 |
Success | 22 |
missing_file |
2 |
CLI usage error | 23 |
ambiguous_relocation |
10 |
invalid_reference |
24 |
ambiguous_asset |
11 |
unsupported_fragment |
30 |
handler_unavailable |
20 |
unknown_asset |
31 |
policy_denied |
21 |
unmapped_root |
40 |
storage_error |
# Build debug binaries
cargo build
# Run formatting, strict clippy lints, and the full test suite
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test.cargo/config.toml points RPIN_CONFIG at an empty file, so cargo test and cargo run ignore your own settings file. Run a built binary directly to use it.
Register the debug binary directly so rebuilds take effect without reinstalling:
.\target\debug\rpin.exe install-protocol
.\target\debug\rpin.exe install-context-menuExact executable ownership is enforced by design: install-* and uninstall-* refuse to overwrite or remove a registration pointing to a different rpin-open.exe. Before switching between debug and installed binaries, unregister using the currently registered binary first.
Follow the extension quick start to capture a line reference in a VS Code development window on Linux or Windows.
Over SMB, the Linux desktop handler opened the linked PDF page. On a second Windows PC, the Explorer copy action produced the original file link, and opening it selected the PDF on the share. Remaining manual checks include note-app clicks and recovery after a live SMB disconnect. Fragment preview ownership is open. A read-only, root-scoped MCP adapter is planned. Product roadmap · Two-PC test
docs/architecture.md— Implemented module map, state authority boundaries, and verification commands.docs/invariants.md— System invariants and load-bearing rationale.docs/contracts/— Behavioral contracts (reference-syntax.md,resolve-json.md).docs/adr/— Architectural Decision Records.docs/plan/— Product vision, roadmap, and PDF annotation design note.