A JSON-encoded data structure used to describe the behavior and UI of a Slapdash command.
A command should return a JSON that tells what the Command Bar should show or do. The JSON needs to conform to a certain format, which can be described with the TypeScript definition below.
interfaceCommandResponse {/** * Optional. * A side effect of the Command when it's run. */ action?:Action;/** * Optional. * The View the Command Bar should display * (List, Form etc.). */ view?:View;/** * Optional. * A way to configure the command before it can * be used. For example, to collect an API key. */ config?:Config;/** * Optional. * A way to customize how Command Bar tokens * that are visualized. */ tokens?:Token[];/** * Optional. * The placeholder text in the Command Bar's input. */ inputPlaceholder?:string;}
Quick Examples
The simplest way to experiment with commands is to copy one of the examples below to a file with *.js extension and then create a Local Command in the Slapdash desktop app.
The command shows a form and allows the user to enter some data. When the form is submitted, the command is run again, and the entered data is passed as JSON to its STDIN.
Emitting config property allows the command to request some private configuration data from the user when it is first executed. Later, the configuration is passed back to the command via process environment variables.