ContextMenuManager

Description

Provides a registry for commands that you'd like to appear in the context menu.

An instance of this class is always available as the atom.contextMenu global.

Context Menu CSON Format

'atom-workspace': [{label: 'Help', command: 'application:open-documentation'}]
'atom-text-editor': [{
  label: 'History',
  submenu: [
    {label: 'Undo', command:'core:undo'}
    {label: 'Redo', command:'core:redo'}
  ]
}]

In your package's menu .cson file you need to specify it under a context-menu key:

'context-menu':
  'atom-workspace': [{label: 'Help', command: 'application:open-documentation'}]
  ...

The format for use in ContextMenuManager::add is the same minus the context-menu key. See ContextMenuManager::add for more information.

API documentation