OpenCSI

copied

Background

copied

OpenCSI stands for Open Command Set Interface. Similar to how OpenAPI decribes an API, OpenCSI describes a set of commands.

An OpenCSI description is YAML format file that describes a set of commands, the parameters they take and (usually) the location for the source code for each command.

You can install an OpenCSI-described command set into a Slack app in Commander using the csm_install command.

A full explanation of the specification is not available here yet but an example OpenCSI description for a command set is shown below.

This command set:

Can be described in OpenCSI with:

OpenCSI: 1.0
info:
  description: This is the description of the Command Set
  version: 1.0.0
  title: My Command Set
  termsOfService: 'http://nimbella.com/demo/terms'
  contact: demo@nimbella.com
  license:
     name: Apache 2.0
     url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
sourceBasePath: https://cdn.jsdelivr.net/gh/ericswildens/shepard@latest/src
commands:
  host_add:
     sourcePath: /host_add.js
     description: Adds a host
     parameters:
        - name: hostname
        - name: ip_address
          optional: true
     options:
        - name: ttl
          value: seconds
        - name: just_a_flag
  host_delete:
     sourcePath: /host_delete.js
     description: Deletes a host
     parameters:
        - name: hostname
  host_list:
     sourcePath: /host_list.js
     description: Lists hosts
     parameters:
        - name: match