Elyra
Elyra The coding agent eTerm The terminal that knows where each command ends Huskarl AI colleagues on your own Mac Starf An activity monitor for Apple silicon that never invents a number etrans An SSH and SFTP client for macOS Elyra VM Virtual machines for macOS, Linux and Windows on your Mac Litr A small, native web browser for macOS Notr A notebook for macOS e The native code editor Elyra Grove Native local development environment Askr The real server for Laravel & PHP Elyra Framework Rust + Svelte 5 framework for desktop apps Elyra Conductor Local project conductor Refr Local-first PDF workspace for macOS Elyra Workspace A desktop workspace for coding agents eDock A container runtime for the Mac Elyra SQL Server MySQL-compatible SQL server in Rust Elyra Félagi Agents as teammates on one board Elyra SQL Client Native desktop SQL workbench Elyra SQL Anywhere Replication-ready SQL engine Elyra Sjá SEO & GEO workspace for macOS Elyra DataGrid Server-driven data grid for Laravel
Reference
Ratatosk CLI
Roadmap
RFC 0001: make:resource
RFC 0002: live queries
RFC 0003: MCP server
RFC 0004: MCP resource templates
RFC 0005: a Laravel backend
RFC 0006: Laravel broadcasting
RFC 0007: offline and sync
RFC 0008: Laravel notifications
RFC 0009: Files
RFC 0010: Laravel abilities
RFC 0011: an assistant in the app
RFC 0012: @elyra/ui
RFC 0013: the assistant sees the window
RFC 0014: Elyra Inspector
RFC 0015: presence
RFC 0016: capabilities per window
RFC 0017: record invalidation
RFC 0018: the assistant's answer, streamed
RFC 0019: a window from the tray
RFC 0020: an app that stays in the tray
RFC 0021: a server chosen at sign-in
RFC 0022: signed in to more than one server
RFC 0023: private channels a window listens to
RFC 0024: updates from the backend
RFC 0025: commands and configuration
RFC 0026: the running app, for coding agents
RFC 0027: the assistant's code mode
RFC 0028: the tray's icon, and the app's
RFC 0029: installers
RFC 0030: the app's identity on Windows
RFC 0031: a token per workspace
RFC 0032: the microphone
RFC 0033: diagnostics the user can send
RFC 0034: one screen in several states at once
RFC 0035: point at it, and hand it to the agent
RFC 0036: rata check, the app checked as a whole
RFC 0037: Theme Studio
RFC 0038: edit it in its own app
RFC 0039: a write shown at once in every window
RFC 0040: the two halves agree
RFC 0041: Quick Look
RFC 0042: follow a colleague
RFC 0043: every write seen
RFC 0044: composite keys
RFC 0045: bigint all the way
RFC 0046: pivot columns
RFC 0047: relations on any key
RFC 0048: more providers
RFC 0049: OpenAI web search
RFC 0050: integer-keyed arguments
RFC 0051: citations
RFC 0052: open documents
RFC 0053: exit hooks
RFC 0054: the gui feature
Release notes
Changelog
Elyra
RFC 0052 — Open documents: files the OS hands the app

RFC 0052 — Open documents: files the OS hands the app

Status: implemented (2026-11-24) · Target: 0.54.0 · builds on single-instance & deep-linking, a file the user chose, rata bundle · see Decisions

Summary

A document app has to open its documents the way the OS offers them: double-clicked in Finder or Explorer, dragged onto the Dock icon, chosen in "Open With", or passed on the command line. Elyra registers URL schemes (deep_link), but no file types. The bundle doesn't declare any, so the OS never offers the app, and a file that reaches it anyway isn't handled. On macOS it currently arrives as a raw file:// string on elyra:deep-link.

This RFC adds document types: declared once, registered by rata bundle on each platform, and delivered to the page as ChosenFiles the user chose.

# elyra.toml
[[bundle.documents]]
name = "Kver document"
extensions = ["kver"]
mime = "application/vnd.kver.document+json"
role = "editor"                 # or "viewer"
App::new()
    .opens(["kver"])            // the extensions this app accepts from the OS
    .single_instance()          // so a second double-click reaches this process
    .run()?;
import { documents } from "@elyra/runtime";

for (const file of await documents.initial()) openTab(file);   // opened at launch
documents.onOpen((files) => files.forEach(openTab));           // opened while running

// A ChosenFile, as from a dialog: pass it to a command as it is.
await commands.readDocument({ file });
  • One declaration, three platforms: rata bundle writes macOS's CFBundleDocumentTypes and an exported type, a .desktop MimeType and a shared-mime-info XML in the .deb, and the NSIS installer's ProgID.
  • Granted like a dialog's file: what the OS opens is something the user chose, so it arrives as a ChosenFile the page can pass to a command, and a command can't be made to read a path the user didn't open.
  • Launch and while running alike: files at launch wait until the page asks for them; later ones arrive on an event. On Windows and Linux, the second process forwards them through single-instance.

Motivation

  • Dogfood. Porting kver (a Tauri document editor) found this as the first missing piece. Its .kver files open from Finder through Tauri's fileAssociations and RunEvent::Opened.
  • Every document app needs it: an editor, a viewer, a tool for one file format. The URL scheme deep_link covers links, not files.
  • What exists today is a leak, not a feature. On macOS, Event::Opened forwards every URL, files included, to elyra:deep-link as a string. The path is not granted and not filtered by type, and the frontend has to tell a file from a link itself.

Current state (0.53)

  • App::deep_link(scheme) reads a launch URL from argv (deeplink::url_in_args). It registers the scheme at startup on Windows (HKCU) and Linux (.desktop + xdg-mime). On macOS rata bundle writes CFBundleURLTypes.
  • App::single_instance(): a second process hands one payload of at most 8 KB to the first and exits. The payload is the deep-link URL from argv, or "".
  • shell/webview.rs, macOS only: Event::Opened { urls } emits each URL on elyra:deep-link.
  • ChosenFile { id, path, name, kind } with FileChoice::{Open, Save, Folder}, granted for the run. It decodes in a command only from a grant's id.
  • rata bundle: the .app's Info.plist, a .deb with a .desktop entry (Exec=<bin> %u), an AppImage, and an NSIS installer with the scheme in HKCU.

Design

Declaring document types

[[bundle.documents]] in elyra.toml, any number of them:

key
name required shown by the OS ("Kind: Kver document")
extensions required without the dot, lowercase
mime optional Linux's type and macOS's UTTypeTagSpecification; default application/x-<app>-<first extension>
role editor (default) or viewer macOS's CFBundleTypeRole; Linux and Windows have no equivalent
icon optional a document icon; without it, the OS's generic one
uti optional macOS's type identifier; default <identifier>.<first extension>
owned true (default) the app defines the type (exported); false for a type another app or the system defines (md, txt), imported and only offered as "Open With"

App::opens([...]) lists the extensions the running app accepts. The bundle gets the OS to offer the app, and the app decides what it takes, so a file with another extension (via "Open With…" → Other) is turned away. rata check reports a declared extension the app doesn't open, and one it opens that no document type declares.

Registration (rata bundle)

  • macOS: the Info.plist gets CFBundleDocumentTypes, one entry per type with CFBundleTypeName, CFBundleTypeRole, LSItemContentTypes [<uti>] and LSHandlerRank (Owner when owned, Alternate otherwise). Owned types also go in UTExportedTypeDeclarations (conforming to public.data, plus public.content, with the extensions and MIME type); the others go in UTImportedTypeDeclarations. An icon is converted to .icns like the app's own.
  • Linux (.deb): the .desktop entry gets MimeType=<mime>;…, and Exec takes %F (files) when there are document types, alongside the %u a deep link needs. Owned types get /usr/share/mime/packages/<identifier>.xml (shared-mime-info: the glob, comment and icon). postinst runs update-mime-database and update-desktop-database. AppImage can't register types without something like appimaged, and the docs say so.
  • Windows (NSIS): per type a ProgID <identifier>.<ext> with its name, icon and shell\open\command "<exe>" "%1", and .<ext> → OpenWithProgids. Owned types also become the default; the others are only offered. All of it goes under HKCU, like the scheme, and the uninstaller removes it. SHChangeNotify runs after both.

App::opens registers nothing at runtime. File types belong to an install, unlike the scheme that deep_link registers at startup today (open question 4).

Delivery

A file is accepted when it exists, is a regular file, and has an extension the app opens. Then it is granted as a ChosenFile and handed over.

  • macOS: Event::Opened { urls }: each file:// URL is a candidate. Other URLs keep going to elyra:deep-link as before, and files stop going there.
  • Windows and Linux at launch: argv. Each argument that isn't a flag or the deep link and names an accepted file is a candidate.
  • While running (Windows, Linux): the second process forwards its candidates through single-instance. The payload becomes a small JSON object, { "url": …, "files": […] }, still capped at 8 KB. A plain string from an older build is still read as the URL. The primary checks every forwarded path again before granting it.
  • Before the page is ready (all three): accepted files queue up until documents.initial() takes them. After that, each batch goes out on elyra:open-documents to every window, and the app decides which window opens it.

The grant

What the OS hands over is something the user chose, so it is granted the way a dialog's file is. Its kind is FileChoice::Document, new in this RFC: opened from the OS, to read and to save back to (open question 1).

Frontend and Rust API

documents.initial(): Promise<ChosenFile[]>        // the launch files; each is handed out once
documents.onOpen(cb: (files: ChosenFile[]) => void): () => void
App::opens(extensions)                            // what the app accepts
App::on_open(|ctx: &Ctx, files: Vec<ChosenFile>| { … })   // optional: Rust sees them first

With on_open, Rust handles each batch (to show a window per document, or to record recents) and the page still gets it.

Testing

  • Offline (unit): generating Info.plist, .desktop, shared-mime XML and NSIS, each with no, one, and several types, owned and not; argv parsing (flags, the deep link, paths with spaces, other extensions, folders, missing files); the single-instance payload both ways, including an old plain string; the queue before initial() and the event after it; and the grant's kind.
  • CI on Linux: the .deb installed in the bundle job, then xdg-mime query filetype x.<ext> gives the MIME type and xdg-mime query default <mime> gives the app's .desktop. The example app started with a file argument, and the page reads it from documents.initial().
  • CI on Windows: after the silent install, the ProgID and OpenWithProgids are in HKCU. Start-Process x.<ext> reaches the running app.
  • CI on macOS: lsregister -f on the built .app, then open x.<ext>. The page gets it from onOpen (the app is running) and from initial() (it isn't). If LaunchServices proves flaky on the runner, this part stays checked by hand, and the docs say so.

Implementation plan

  1. [[bundle.documents]] in ratatosk/src/config.rs; the plist, .desktop, mime XML, postinst and NSIS output; rata check.
  2. App::opens and App::on_open, FileChoice::Document, argv candidates, the JSON single-instance payload, macOS Opened split into files and URLs, the queue and elyra:open-documents.
  3. documents in @elyra/runtime, codegen's types, and the example app opening a .elyranote.
  4. Tests, CI steps, docs (docs/documents.md, configuration, single-instance, system), CHANGELOG, roadmap.

Open questions

Answered in Decisions.

  1. The grant's kind. A new FileChoice::Document (read and save back), or Open like a dropped file? Recommendation: Document. An editor saves back to the file it opened, and with Open the app would have to ask a save dialog for a path the user already chose, or ignore kind. Adding a variant to FileChoice breaks an exhaustive match, so it's called out under Upgrading (or FileChoice becomes #[non_exhaustive] in the same release).
  2. Does opens repeat the bundle? The extensions could come from elyra.toml at build time instead. Recommendation: keep App::opens. The runtime doesn't read elyra.toml today, and a test or cargo run should behave like the install. rata check keeps the two in step.
  3. Which window gets a file? Every window gets the event, or only the focused one? Recommendation: every window, and the app decides (a document app usually has one window that opens tabs, or on_open opens a window). One window choosing for all makes "a window per document" harder.
  4. Register at runtime too, as deep_link does on Windows and Linux, for cargo run and an AppImage? Recommendation: no. An app run from target/ that claims file types leaves registrations behind that point at a build folder. File types belong to the install. The AppImage limit goes in the docs.
  5. The macOS file URLs on elyra:deep-link today. Stop sending files there at once, or keep them for a release? Recommendation: stop. They were never documented as files, and they arrive ungranted. An app that relied on it gets the change under Upgrading, and its files come from documents instead.

Not in this RFC

  • "Open Recent" in the Dock and File menus (NSDocumentController), and Windows jump lists. kver keeps its own recents.
  • The menu itself (check items, enabled state): that's RFC 0053.
  • Quick Look and thumbnail extensions for the app's own types.
  • Saving as a type (a save dialog filtered by the declared types) beyond today's dialog.save({ filters }).
  • .dmg, found by the same port: its own change to rata bundle.

Alternatives considered

  • Keep using deep_link with a file scheme: no type registration, an ungranted path, and no argv handling on Windows or Linux.
  • Rust-only delivery (on_open, no frontend API): every app would write the same command and event to reach the page.
  • Plain paths to the frontend instead of ChosenFile: simpler, but a page could then pass any path to a command, which ChosenFile exists to prevent.

As built

As designed, with these specifics:

  • Exec=<bin> %U in the .desktop entry when there are document types, not %u plus %F: the spec allows one field code per Exec, and %U hands over files (as paths or file:// URLs) and a deep link's URL alike. Without document types it stays %u. The app reads both forms from argv.
  • ratatosk/src/documents.rs resolves [[bundle.documents]] (unknown keys are an error; an extension with a dot, upper case or declared twice is refused up front) and writes each platform's text: the plist keys, the .desktop MimeType, the shared-mime-info XML, the .deb's postinst and postrm, and the NSIS lines.
    • A type the app doesn't own and names no uti for is matched by CFBundleTypeExtensions on macOS, so no identifier is made up for md.
    • The uninstaller removes an extension's default only while it still names the app's ProgID.
    • Document icons: Resources/doc-<ext>.icns on macOS, a 256 px PNG under hicolor/…/mimetypes/<mime>.png on Linux, and doc-<ext>.ico beside the .exe on Windows.
  • framework/src/documents.rs: Documents is bound in the container when the app opens anything. The router serves /__documents/initial, and the event loop feeds it from argv at start, from Event::Opened's file:// URLs (other URLs still go to elyra:deep-link), and from a second launch's payload. Argv is read on every platform, so a terminal on macOS works too. Accepted files are canonical, with Windows' \\?\ prefix taken off for a drive path.
  • The single-instance payload stays the URL alone unless the launch has documents: then {"url", "files"}. elyra:second-instance gets the URL only.
  • A read-only window can't call /__documents/initial: it hands the launch's files out once, so Quick Look could otherwise take the main window's.
  • FileChoice::readable() and writable(): Backend::download_to and a transcription use them, so a document is saved to and read like save and open files.
  • rata check: document-not-opened (an error) and document-not-registered (a warning), from opens in the app's ELYRA_CHECK shape. An app on an older Elyra says nothing, and nothing is found.
  • Tests: rata's generated text for each platform; argv parsing, the queue and the event, the payload both ways, accepts; the runtime's documents; the route closed to read-only windows. CI: the bundle job checks the .app's plist, the installed .deb's desktop entry and MIME package (and globs2 where update-mime-database ran), and the Windows installer's ProgID, default app and "Open With" entry, all gone after uninstalling. The running-app walk-throughs on macOS, Linux and Windows start the example with a .elyranote on its command line and find the note on the page.
  • Checked by hand on macOS: a debug .app registered with lsregister, then open on a .elyranote at launch (initial()) and while running (onOpen), and a second launch's file forwarded through single-instance. Double-clicking in Explorer and the file manager on Linux hasn't been tried; their command-line path is what CI drives.

Decisions

  1. FileChoice::Document: opened from the OS, to read and save back. It's called out under Upgrading (an exhaustive match needs the arm).
  2. App::opens stays, and rata check keeps it in step with [[bundle.documents]].
  3. Every window gets elyra:open-documents, and the app decides.
  4. No runtime registration: file types belong to the install, and the AppImage limit is documented.
  5. Files stop going to elyra:deep-link on macOS at once, under Upgrading.