nestor-cli

command module
v0.0.0-...-475c3b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

README

Nestor Power Development Toolkit

The Nestor CLI lets you create, debug and deploy Nestor Bot Powers.

What is a Bot Power?

A Bot Power is functionality that you would like to add to Nestor. Examples of powers include Github and Trello. But what if you wanted to add your own?

Nestor CLI comes to the rescue.

Installation

The Nestor CLI can be downloaded from here. Downloads are available for OS X and Linux. (Windows coming soon).

Unpackage the archive and move the nestor binary to a well-known $PATH (such as /usr/local/bin).

Start creating your own power

To start creating your own power, run nestor new <Power Name>. So if you wanted to call your power "Hello World", run this command:

$ nestor new "Hello World"

Quotes are not needed if the name of your power is a single word.

This will create a NodeJS module with the following contents:

  1. index.js: Contains a sample power implementation
  2. package.json: Where you can add all your dependencies. The nestorbot dependency is added by default.
  3. nestor.json: A manifest file containing details about your power
  4. README.md: Contains the Nestor programming manual

Make Changes to your Power

You can now follow the Nestor Programming Manual to make changes to your power.

nestor.json

The nestor.json file located at the root of your power's directory contains important information that is required by Nestor:

  1. name: The name of your power
  2. permalink: The permalink that will uniquely identify your power. The permalink must not contain any spaces.
  3. Description: A short description of what users can do with this power.

These three fields are mandatory.

In addition if your power requires environment variables that need to be configured (for e.g. authentication tokens or keys), you can set them with the environment_keys fields.

An example of this setting can be found in the Mixpanel power

"environment_keys": {
  "NESTOR_MIXPANEL_API_KEY": {
    "required": true,
    "mode": "user"
  },
  "NESTOR_MIXPANEL_API_SECRET": {
    "required": true,
    "mode": "user"
  }
}

In this example, NESTOR_MIXPANEL_API_KEY and NESTOR_MIXPANEL_API_SECRET are both required (specified by "required":true) by the power to work and need to be set by the user (specified by "mode": "user")

By setting an environment variable to be "required", every time a user tries to use your power, she will be prompted to set this environment variable. This way you don't have to write additional code in your power to check whether your environment variable is set.

If you have an optional environment variable, then set the required field to false.

An example of an environment variable that is not required can be found in the Github power.

Save Your Power

To save your Nestor power, run nestor save inside the directory where you power is created and this will upload the code powering your power (pardon the pun) to Nestor's servers and your power is now ready to be tested.

$ nestor save

Saving your power does not make it available to your Slack team. You will still need to deploy your power (which we will cover later in this README).

Sidenote: Logging In

All of the remaining operations (including this one) require you to be authenticated with Nestor's service so you will be prompted to log in. If you are logging in for the first time, you will need to sign in to the website, go to "My Profile" by clicking on your profile picture on the left bottom side, and setting your password.

Keep note of your email address as that is required to log in.

Test Your Power

The Nestor Toolkit provides you with an interactive shell which will let you test your power before it is deployed. You can enter text commands as they would appear in Slack, and see how your power behaves.

You can keep editing your power, save-ing your changes and keep testing it with the shell until you are happy.

To start the shell, run the following command:

$ nestor shell

To quit the shell, enter the command exit.

Deploy Your Power

Deploying your power means that your power will now be available to your entire team. To deploy your power run the following command:

$ nestor deploy

This will give you a list of versions for your power (every time you save your power, a new version is created) and you can pick the version that you want to deploy.

If you want to deploy just the latest version, run:

$ nestor deploy --latest

Bugs/Feedback

To report bugs and make feature requests, please create an issue.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/Bowery/prompt
Package prompt implements a cross platform line-editing prompt.
Package prompt implements a cross platform line-editing prompt.
_workspace/src/github.com/dustin/go-humanize
Package humanize converts boring ugly numbers to human-friendly strings and back.
Package humanize converts boring ugly numbers to human-friendly strings and back.
_workspace/src/github.com/equinox-io/equinox
Package equinox allows applications to remotely update themselves with the equinox.io service.
Package equinox allows applications to remotely update themselves with the equinox.io service.
_workspace/src/github.com/equinox-io/equinox/internal/go-update
Package update provides functionality to implement secure, self-updating Go programs (or other single-file targets).
Package update provides functionality to implement secure, self-updating Go programs (or other single-file targets).
_workspace/src/github.com/equinox-io/equinox/internal/go-update/internal/binarydist
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Extensions to the standard "os" package.
_workspace/src/github.com/equinox-io/equinox/internal/osext
Extensions to the standard "os" package.
Extensions to the standard "os" package.
_workspace/src/github.com/equinox-io/equinox/proto
package proto defines a set of structures used to negotiate an update between an an application (the client) and an Equinox update service.
package proto defines a set of structures used to negotiate an update between an an application (the client) and an Equinox update service.
_workspace/src/github.com/fatih/color
Package color is an ANSI color package to output colorized or SGR defined output to the standard output.
Package color is an ANSI color package to output colorized or SGR defined output to the standard output.
_workspace/src/github.com/hashicorp/hcl
Package hcl decodes HCL into usable Go structures.
Package hcl decodes HCL into usable Go structures.
_workspace/src/github.com/hashicorp/hcl/hcl/ast
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
Package ast declares the types used to represent syntax trees for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/parser
Package parser implements a parser for HCL (HashiCorp Configuration Language)
Package parser implements a parser for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/hashicorp/hcl/hcl/printer
Package printer implements printing of AST nodes to HCL format.
Package printer implements printing of AST nodes to HCL format.
_workspace/src/github.com/hashicorp/hcl/hcl/scanner
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.
_workspace/src/github.com/hashicorp/hcl/hcl/token
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
Package token defines constants representing the lexical tokens for HCL (HashiCorp Configuration Language)
_workspace/src/github.com/kr/pretty
Package pretty provides pretty-printing for Go values.
Package pretty provides pretty-printing for Go values.
_workspace/src/github.com/kr/text
Package text provides rudimentary functions for manipulating text in paragraphs.
Package text provides rudimentary functions for manipulating text in paragraphs.
_workspace/src/github.com/kr/text/colwriter
Package colwriter provides a write filter that formats input lines in multiple columns.
Package colwriter provides a write filter that formats input lines in multiple columns.
_workspace/src/github.com/kr/text/mc
Command mc prints in multiple columns.
Command mc prints in multiple columns.
_workspace/src/github.com/magiconair/properties
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
Package properties provides functions for reading and writing ISO-8859-1 and UTF-8 encoded .properties files and has support for recursive property expansion.
_workspace/src/github.com/mattn/go-isatty
Package isatty implements interface to isatty
Package isatty implements interface to isatty
_workspace/src/github.com/mitchellh/mapstructure
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
_workspace/src/github.com/olekukonko/tablewriter
Create & Generate text based table
Create & Generate text based table
_workspace/src/github.com/peterh/liner
Package liner implements a simple command line editor, inspired by linenoise (https://github.com/antirez/linenoise/).
Package liner implements a simple command line editor, inspired by linenoise (https://github.com/antirez/linenoise/).
_workspace/src/github.com/shiena/ansicolor
Package ansicolor provides color console in Windows as ANSICON.
Package ansicolor provides color console in Windows as ANSICON.
_workspace/src/github.com/shiena/ansicolor/ansicolor
The ansicolor command colors a console text by ANSI escape sequence like wac.
The ansicolor command colors a console text by ANSI escape sequence like wac.
_workspace/src/github.com/spf13/cobra
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
_workspace/src/github.com/spf13/pflag
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/github.com/spf13/viper/remote
Package remote integrates the remote features of Viper.
Package remote integrates the remote features of Viper.
_workspace/src/gopkg.in/fsnotify.v1
Package fsnotify provides a platform-independent interface for file system notifications.
Package fsnotify provides a platform-independent interface for file system notifications.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL