How do you use activationCommands in package.json?


I get the deprecation errors saying to replace activationEvents with activationCommands but that never works for me. Am I supposed to do something other than replace the property name? Where is this documented? Searching in the api docs for activationCommands yields nothing.


It’s on this page in the docs. For me replacing activationEvents with activationCommands just worked.


You might need to do something like this (took me a while to figure it out too):


Ohhh. It is changed from an array to an object.


Those docs are flat out wrong …

activationCommands (Optional): an Array of Strings identifying commands that trigger your packages activation. You can delay the loading of your package until one of these events is triggered


Hmmm… I could swear using an array worked a few days ago…



Now I’m having another problem. When I switch from this …

  "activationEvents": [

… to …

  "activationCommands": {
    "atom-text-editor": "find-selection:find-next",
    "atom-text-editor": "find-selection:find-previous"

find-selection doesn’t ever show in the command-palette. And it won’t activate using find-next because the second property atom-text-editor replaces the first.

I really need the proper docs for this. I’m not going to submit another issue to atom/atom until I can figure out what I’m supposed to be doing.


Hey, you’re right, I didn’t notice that before but I’ve got the same problem with Zen. You’re commands will show up after you’re package has been activated. They’ve improved the lazy loading of packages but it’s a bit too lazy right now. Also this:

It’s a bit of a mess, not sure how it’s going to be fixed or if there is anything package authors can do about it right now.


@leedohm, I can see the status (not good) of the atom/atom issue you posted, but can you tell me how activationCommands is supposed to be entered into package.json? The way I tried is obviously wrong.

Check out the updated documentation

@kgrossjo suggested this (in a private message for some strange reason (grin)) and it worked perfectly.

  "activationCommands": {
    "atom-text-editor": ["find-selection:find-next", "find-selection:find-previous"]


@mark_hahn thanks so much for posting this solution!

I can’t even locate where this should be documented!

The only top hit of ‘atom activationCommands’ that I get is this page:, but it does not have a version for the ‘latest’! I guess this comes back to this issue:, but I am still puzzled where it should redirect if the ‘latest’ version does not exist (or is not known to google, which is equivalent to does not exist).


Just here to say that I also ran into confusion:

mark_hahn’s findings conflict with the documentation found here:

(v0.186.0 was generated from “latest”)


That documentation is not the latest. See the latest documentation at:


Then you have some routing issues, because:

redirects to:

If the page doesn’t exist in the latest documentation, then a 404 should appear


Yes, see the open issue here:


Wow could Atom please redirect old documentation links to the current documentation.

Not a single one of the links to the documentation on this discussion actually brings you to where activationCommands is documented.

For anyone looking for the link here it is.


We did, in the best way that we could by making them redirect to the new documentation landing page. The documentation system was completely redone and this meant that old links couldn’t be redirected in virtually all cases.