npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pb-cli

v1.4.0

Published

Pandorabots API command line interface

Downloads

6

Readme

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.