Note: This project is currently under active development. Documentation is incomplete and things may not work as expected. 🤯


Register globally executable commands that trigger an action on invocation.

commands.registerCommand(id, handle[, thisArg, label])

Registers a globally executable command.

  • arguments
    • id string
    • handle Function
    • thisArg any(optional)
    • label string(optional)
  • returns IKeyBindingRegister
  • Usage

Registering a command.

quark.commands.registerCommand('', () => {
    console.log('I ran');

//logs `I ran` to console.

Adding a KeyBinding to the command.

const register = quark.commands.registerCommand('', () => {
    console.log('I ran');
//Now pressing the key combination "ctrl+i" will invoke the command.

Passing arguments to the command.

quark.commands.registerCommand('', (label) => {

quark.commands.executeCommand('', 'I ran');
//logs `I ran` to console.

Adding command to the commands palette.

The example below shows how to add a command to the commands palette. The only thing you need to do differently is to provide the label argument to the commands.registerCommand function.

quark.commands.registerCommand('', () => {
    console.log('I ran');
}, null, 'My Awesome Command');

Now the command should be available in the commands palette like so.


commands.executeCommand(id, [...args])

Executes a registered command.

  • arguments
    • id string
    • ...args any
  • returns void


Returns a registered command with the provided id.

  • arguments
    • id string
  • returns ICommand | undefined
  • Usage
//e.g. Getting a command and then disposing it.
const command = quark.commands.getCommand('');
//unregisters the command


Returns an array of all the registered commands.

//e.g. filtering all commands registered in commands palette.
const commands = quark.commands.getAllCommands().map((command) => {
    if(command.label) {
        return command;
Last Updated: 8/15/2019, 11:59:02 AM
MIT Licensed | Copyright © 2019-present Nishkal Kashyap