Coder Social home page Coder Social logo

pb-cli's Introduction

Pandorabots CLI

The Pandorabots CLI allows you to manage and interact with your AIaaS applications straight from the command line.

Please read the documentation for further information regarding naming conventions and file types.

Note: You will need both a user_key and app_id, which you can register for at the Pandorabots Developer Portal.

Installation

The CLI is available as a node.js module, via npm.

$ npm install -g pb-cli

You should now be able to run the CLI by typing either pandorabots or pb in the command line.

Configuration

The CLI introduces the concept of the bot configuration file, chatbot.json. This file stores information like your app_id, user_key and botname:

{
  app_id: ********,
  user_key: *******,
  botname: ********,
  hostname: ********
}

Running any of the commands from within a directory containing a chatbot.json file will automatically add your configured parameters to the API call:

$ pb list

You can create this file manually, or, use the init command to be guided through the process:

$ pb init
app_id? (required) *********
user_key? (required) ********
botname? (recommended) ********
hostname? (optional) ******

The hostname field is optional, and will default to aiaas.pandorabots.com.

Run tests

The test directory contains a shell script to test the CLI. You must first run pb init here to create a configuration, then run:

$ ./test.sh

Usage

General

  • pb init: creates a configuration file (overwrites any existing chatbot.json files in the same directory)

  • pb list: list all bots associated with a particular app_id

Bot management

  • pb compile: compiles a bot

  • pb create: creates a new bot on the server

  • pb delete: deletes a bot on the server

  • pb talk <input>: send a message to a bot and print the response

  • pb chat: enter a REPL-stype chat mode with a bot (added in version 1.0.3)

File management

  • pb download <file>: download a particular file from the server

  • pb get: list all files associated with a bot (use --all to download all files as a .zip)

  • pb pull: download all files associated with a bot (unzipped, avoid using this with large bots)

  • pb push <path>: upload all bot files given the path to a directory. Path is can be absolute, or relative to where the chatbot.json file is stored. Omitting the path will push all bot files in the current directory.

  • pb remove <file>: delete a bot file from the server

  • pb upload <file>: upload a bot file

Flags

You can add flags to certain commands to override information stored in chatbot.json.

For example, if I want to talk to a bot that has a different name than the one stored in the configuration file, we can override it by including the --botname <botname> flag:

$ pb talk --botname alice Hello!

You can use the same technique to override other parameters, using flags like --hostname, --app_id, and --user_key.

For a full list of available flags and their applications, access the help information by running pb --help.

pb-cli's People

Contributors

djfdev avatar julien-c avatar lkunze avatar pandorabots-admin avatar yyconn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.