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

@ector/cli

v1.1.0

Published

Interactive command line interface to ECTOR, the learning chatterbot

Downloads

2

Readme

@ector/cli

Interactive command line interface to ECTOR, the learning chatterbot.

Usage

$ npm -g i @ector/cli

$ ector --help
ector [command]

Commandes:
  ector setuser <username>  set username
  ector setbot <botname>    set botname
  ector reply [entry..]     make ECTOR reply
  ector reset               reset ECTOR
  ector learn               learn from standard input
  ector chat                have a chat with ECTOR
  ector use <file>          load another ECTOR file

$ ector reply "Hello ECTOR, how do you do?"
Hello Guy, how do you do?
$ ector setuser François
New username: "François"
$ ector reply "My name is now François."
My name is now ECTOR.
$ ector reply "Glad to meet you, ECTOR."
Glad to meet you François.
$ ector reply "I know that your mind is pretty empty, but let's try to fill it."
My name is pretty empty, but let's try to fill it.
$ ector reply "That's because the @ector/cli package does not contain any prepared JSON file containing a mind."
I know that your mind is pretty empty, but let's try to meet you, François.
$ ector reply "You know that you cn look within your mind, ECTOR?"
I know that you cn look within your mind, François?
$ ector reply "You only need fx to be installed."; fx ector.json .response
You know that you cn look within your mind, François?
You know that you cn look within your mind, François?
$ ector reply "That allows us to hear your response and to read it." | espeak --stdin ; fx ector.json .response
You only need fx to read it.
$ ector reply "You have a sweet voice, ECTOR ;)" | espeak --stdin ; fx ector.json .response
You only need fx to read it.
$ ector reply "Of course, to hear your voice, espeak has to be installed too." | espeak --stdin ; fx ector.json .response
Hello François, how do you cn look within your voice, François ;)
$ reply "You have almost the same voice as Stephen Hawking. At least the voice you can hear in The Big Bang Theory." | espeak --stdin ; fx ector.json .response
Of course, to fill it.

Explanation

Every command of ector saves it state in the ./ector.json file. That allows to copy an entire mind to another file.

At the beginning, ECTOR's mind is empty, you have to fill it. It learns from what you say to him (using ector reply or ector learn).

Commands

To see all implemented commands, use ector --help or ector -h.

To know ector's version, use ector --version or ector -V.

setuser

Set the name of the user, that is used by ECTOR when replying to you (the user).

Default value: Guy.

ector setuser Chuck

setbot

Set the name of the bot (ECTOR), that is used by the bot to name itself.

Default value: ECTOR.

This acronym means Entity Compelled To Reply.

ector setbot Achille

reply

Get a reply from ECTOR.

You have to give an entry (which is integrated into ECTOR's mind), so that ECTOR can reply.

It gives a reply on stdout (standard output), and saves its state into ./ector.json file.

Warning: it's safer to quote the entry using double quotes ".

$ ector reply "How do you do?"
How do you do?

reset

Remove ./ector.json file, resetting all ECTOR's state (its name, your name, what you said, it's remindings of what you last said, ...).

learn

Learn what you give to ECTOR through its standard input (using the redirection or pipe).

$ ector learn < book.txt
Learned.

Or (to learn The Time machine from H.G.Wells):

$ curl https://www.gutenberg.org/files/35/35-0.txt | ector learn
Learned.

chat

Have a chat with ECTOR, avoiding several ector entry commands.

On Linux, use Ctrl-D to quit. It closes the standard input.

$ ector chat
> Hello ECTOR, how do you do?
Hello Guy, how do you do?
> I'm glad to meet you.
I'm glad to make this file searchable.
> I did not expect you to use those words.
I did not expect you to make this file searchable.
>

use

Use another file for ector.json.

Warning: use will remove the current ./ector.json, and replace it with another one.

$ ector use another-ector.json
Loaded new ECTOR

You can also install @ector/samples to use any of its ECTOR files.

npm i @ector/samples
ector use en-bot