Giter VIP home page Giter VIP 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 can be found at the Pandorabots Developer Portal for legacy users, or on the Pandorabots account page.

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:

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

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
hostname? (optional) ******
app_id? (required) *********
user_key? (required) ********
botname? (recommended) ********

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

botkey feature for api.pandorabots.com users

v1.3.1 introduces a new public botkey option for talk, atalk, chat, and achat interactions by premium users i.e. users of api.pandorabots.com

This is primarily used for added security in browser-based talk interactions, but is available in pb-cli for testing purposes.

You can add this manually in chatbot.json, or use the init command to be guided through the process:

hostname: api.pandorabots.com,
botkey: ********

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 atalk <input>: send a message to a bot using atalk and print the generated client_name, as well as the response (added in version 1.1.0)

  • pb chat: enter a REPL-style chat mode with a bot (added in version 1.0.3). Also "response-log.tsv" is autogenerated to keep a log of interactions.

  • pb achat: enter a REPL-style chat mode with a bot, starting the session using atalk (added in version 1.1.0)

File management

  • pb download <file> <path>: download a particular file from the server, saving it at the specified path. Path can be absolute or relative to the current directory. Omitting the path will save the file to the current directory.

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

  • pb pull <path>: download all files associated with a bot (unzipped, avoid using this with large bots), saving them to the specified path. Path can be absolute or relative to the current directory. Omitting the path will save bot files to the current directory.

  • pb push <path>: upload all bot files given the path to a directory. Path 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

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

Watchers

James Cloos 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.