Command Runner
Configure and run multiple VS Code commands in sequence with a single command.
Overview
This extension was primarily designed for Business Central AL development workflows, helping AL developers automate common development tasks and code quality operations. However, it's flexible enough to work with any VS Code commands you want to chain together.
Features
Command Runner allows you to:
- Execute multiple VS Code commands in a specific order
- Configure your command sequence through VS Code settings
- Run all commands with a single command: AL: Run Command Set
- Get instant feedback with notifications
- Automatic error handling - stops execution if any command fails
This is useful for automating repetitive workflows like:
- Running AL code quality tools in sequence (fix identifiers, remove unused usings, sort procedures)
- Saving all files, formatting, and running tests
- Closing multiple panels or views
- Chaining multiple build or deployment commands
Usage
- Open VS Code Settings (File > Preferences > Settings or
Ctrl+,)
- Search for "Command Runner"
- Add command IDs to the
commandRunner.commandIds array in the order you want them executed
Example configuration in settings.json (using common AL development commands):
{
"commandRunner.commandIds": [
"azALDevTools.FixProjectIdentifiersCase",
"azALDevTools.RemoveUnusedProjectUsings",
"azALDevTools.RemoveProjectUnusedVariables",
"azALDevTools.SortWorkspaceProcedures",
"azALDevTools.SortWorkspaceVariables"
]
}
Note: The commands shown above are specific to AL development (from the AL Dev Tools extension), but you can configure any VS Code command IDs you want - whether they're AL-related, built-in VS Code commands, or from any other extension.
- Open the Command Palette (
Ctrl+Shift+P or Cmd+Shift+P)
- Run: AL: Run Command Set
The extension will execute all configured commands in order. If any command fails, execution stops and an error message is displayed.
Extension Settings
This extension contributes the following settings:
commandRunner.commandIds: Array of command IDs to execute in sequence
Finding Command IDs
To find command IDs in VS Code:
- Open the Command Palette (
Ctrl+Shift+P)
- Type the command you want to find
- Right-click on the command and select "Copy Command ID" (if available)
- Or check the VS Code documentation for built-in command IDs
Common command IDs:
workbench.action.files.save - Save active file
workbench.action.files.saveAll - Save all files
editor.action.formatDocument - Format document
workbench.action.closeActiveEditor - Close active editor
workbench.action.terminal.clear - Clear terminal
Release Notes
0.0.1
Initial release of Command Runner
- Run multiple commands in sequence
- Configure commands through VS Code settings
- Error handling with notifications
Enjoy!