Slapdash Platform
GitHub
  • Ahoy, world!
  • Command Bar 101
    • How it Works
    • Core Terminology
    • Commands
    • Local Commands
    • Cloud Commands
    • Build Your First Command
    • Publish Command
    • Hooks
  • Command Tutorials
    • Toggle Dark Mode
    • Emoji Paster
    • Copy Special Character
    • Send Slack Message
  • Reference
    • Command Response
    • Action
    • View
    • List View
    • Masonry View
    • Form View
    • Tokens
    • Icon
    • Config
Powered by GitBook
On this page
  • Local vs. Cloud Commands
  • How Commands are Run
  1. Command Bar 101

Commands

PreviousCore TerminologyNextLocal Commands

Last updated 3 years ago

The easiest way to think about commands is as functions. As a function, it can accept arguments as input and can return some output.

Command(Input) -> Output

Like a function, a command doesn't have to return anything. Imagine a command to put your computer to sleep: there is no output that's needed. However, most commands have an output, which tells Slapdash what to do or show in the Command Bar. This output is a JSON-serialized data structure that conforms to the .

You can use it to tell Slapdash to to the clipboard, in a browser, to someone, or present an .

Local vs. Cloud Commands

There are two types of commands: , which are scripts that run on your computer, and , which are commands that are hosted on the web.

They are mostly the same, but they do offer some trade-offs:

Local Commands
Cloud Commands

Script on your computer

Accessible by URL

Can do whatever your computer can

No direct access to your computer

Not shareable with team

Shareable with team

Great for development

Great for production deployment

Works offline

Unlimited compute

When developing a new command, Local Commands are the fastest and simplest way to get things going.

How Commands are Run

Local Commands are just scripts that are run on your computer. Slapdash uses stdin to send arguments to the command and interprets the stdout, expecting it to be a JSON . Cloud Commands are run by making a request to an HTTPS endpoint. Slapdash passes arguments to the command using RESTful conventions. Slapdash interprets the HTTPS response, expecting it to be a JSON Command Response.

Command Response Specification
show a form
interactive list view
Local Commands
Cloud Commands
Command Response
copy something
open a URL