Atom:// protocol handler


I’d like to be able to have atom open urls like atom:///Users/me/myfile.txt.

From this PR it looks like there might be support for this, but currently when I try that I get an error like the following:

ReferenceError: atom is not defined
    at Function.module.exports.Package.isBundledPackagePath (/Applications/
    at Function.module.exports.Package.loadMetadata (/Applications/
    at PackageManager.module.exports.PackageManager.getAvailablePackageMetadata (/Applications/
    at AtomApplication.module.exports.AtomApplication.openUrl (/Applications/
    at EventEmitter.<anonymous> (/Applications/
    at EventEmitter.emit (events.js:110:17)

Is this a bug? Unsupported? Am I doing something wrong?


You can just use file:// URLs for this. file:///Users/me/myfile.txt should work fine.


I should clarify that I’m wanting to open files in atom from the browser, so file:// isn’t going to work.


Ah, in that case it is not possible. The atom:// protocol only handles files in ~/.atom so that packages can find their resources no matter where they’re installed. It’s also only really for resources referenced in HTML/CSS.

It looks like protocols don’t work when actually opening files in Atom, they get mangled. e.g. opening atom://test in your home directory results in Atom thinking you want a file named ~/atom:/test.

I assume you’re looking for something like sublime text’s subl://open URLs - you should open an issue for it as I’m sure many people would find it useful.


I ran into a problem with protocol handling recently. My web-browser handles http and https protocols. I use these protocols when opening a web page from my command-toolbar (being used for favorite urls). However I can’t use this from a command line like atom because atom chokes when it doesn’t have a folder. It should just open it like normal with the plain atom and an untitled tab and of course my web page.

Maybe I’ll submit an issue on atom/atom.

Edit: See


Opened a feature request here:


Here’s the issue tracking this very, very missed feature!


Sorry to bump an old thread, but since this is still an open issue I want to steer anyone landing here to another thread about the topic: URL Helper à la "atom://"

As discussed in that other thread, I have an app which handles atm:// protocol requests (atom:// is already taken by Atom itself) and can be found here: atom-handler. I hope that can help some others until Atom can open files by atom:// URL (or some other means).


Note that there’s also a Linux based uurl handler here: