terminal-commands

Setup commands to run in the terminal

UziTech

4,481

3

1.5.0

MIT

GitHub

This package consumes the following services:

Actions Status Dependency Status

terminal-commands package

Setup commands to run in the terminal from the command palette, context menu, or key binding.

Note Depends on a terminal package like x-terminal to run!

screenshot

Example

// in ~/.atom/terminal-commands.json
{
  "echo:file": "echo ${file}",
  "echo:files": ["echo test", "echo ${files}"],
  "echo:dir": {
    "commands": "echo ${dir}",
    "key": "alt-d",
    "priority": 0
  },
  "echo:project": {
    "commands": "echo ${project}",
    "key": "alt-p",
    "priority": 100,
    "selector": ".tree-view"
  }
}

image


image

Options

The commands in terminal-commands.json should be formatted as one of the following:

{
  "namespace:action": "command"
}
{
  "namespace:action": ["command 1", "command 2"],
}
{
  "namespace:action": {
    "commands": "commands", // (required) Can be a string or an array of strings
    "key": "alt-k", // (optional) A default key binding
    "priority": 100, // (optional) Key binding priority. Default = 0
    "selector": ".css-selector" // (optional) Selector to limit the key binding and context menu. Default = "atom-workspace"
  }
}

Placeholders

Placeholders can be used so commands can use current command target in the commands. The command target will be the active editor if from the command palette, or selected files if from the tree-view context menu.