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

@brainstack/nlsh

v1.0.2

Published

Node.js Natural Language Shell Terminal

Downloads

4

Readme

@brainstack/nlsh

@brainstack/nlsh is a Node.js natural language shell terminal powered by AI. It allows users to interact with their terminal using natural language, where their intentions are understood, commands are identified, and the best unattended solutions are suggested and executed upon approval, based on predefined levels of trust.

Features

  • Understands user intentions through natural language processing.
  • Identifies appropriate commands based on user queries.
  • Suggests the most unattended solutions for executing commands.
  • Executes commands upon user approval, considering different levels of trust.
  • Provides feedback gathering for executed commands.

Getting Started

To get started with @brainstack/nlsh, follow these steps:

  1. Install the package using npm or yarn:

    npm install @brainstack/nlsh

    or

    yarn add @brainstack/nlsh
  2. Import the Nlsh class into your project:

    import { Nlsh } from '@brainstack/nlsh';
  3. Initialize an instance of Nlsh with appropriate input and output sources:

    const nlsh = new Nlsh(inputSource, output);
  4. Start the terminal:

    nlsh.start();

How to Use

  1. Launch the @brainstack/nlsh terminal.
  2. Input your intentions or query using natural language.
  3. @brainstack/nlsh will parse your intentions, identify commands, and suggest solutions.
  4. Review the suggested commands and provide approval if required.
  5. Commands will be executed based on the level of trust and user approval.
  6. Provide feedback when prompted for executed commands.

Examples

Example 1: Find Process Listening on Port 44253

nitr0gen@WINDOWS:~/public/Packages/@brainstack/nlsh$ nlsh
Welcome to the AI Natural Language Shell (AINLSH)
Level of trust: AUTONOMOUS

What do you want to do?
> show me process including pid listening on port 44253
Level of trust AUTONOMOUS, automatic approval, no feedback

COMMAND    PID     USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
node       687 nitr0gen   20u  IPv4   17789      0t0  TCP localhost:44253 (LISTEN)
node       687 nitr0gen   32u  IPv4 3974165      0t0  TCP localhost:44253->localhost:53864 (ESTABLISHED)
node      1183 nitr0gen   25u  IPv4 3967852      0t0  TCP localhost:44253->localhost:53856 (ESTABLISHED)
node    726277 nitr0gen   19u  IPv4 3969877      0t0  TCP localhost:53856->localhost:44253 (ESTABLISHED)
node    726287 nitr0gen   19u  IPv4 3970764      0t0  TCP localhost:53864->localhost:44253 (ESTABLISHED)
What do you want to do?
> 

Example 2: Displaying Docker Running Container

What do you want to do?
> show my docker container running
Level of trust AUTONOMOUS, automatic approval, no feedback

CONTAINER ID   IMAGE                                             COMMAND                  CREATED        STATUS                  PORTS                                                                  NAMES
754333d06990   public.ecr.aws/supabase/studio:20240101-8e4a094   "docker-entrypoint.s…"   19 hours ago   Up 19 hours (healthy)   0.0.0.0:54323->3000/tcp, :::54323->3000/tcp                            supabase_studio_simple-project
288fabe6ffed   public.ecr.aws/supabase/postgres-meta:v0.75.0     "docker-entrypoint.s…"   19 hours ago   Up 19 hours (healthy)   8080/tcp                                                               supabase_pg_meta_simple-project
b95de1360d8e   public.ecr.aws/supabase/edge-runtime:v1.33.5      "sh -c 'mkdir -p /ho…"   19 hours ago   Up 19 hours             8081/tcp                                                               supabase_edge_runtime_simple-project
29b1a4cea159   public.ecr.aws/supabase/imgproxy:v3.8.0           "imgproxy"               19 hours ago   Up 19 hours (healthy)   8080/tcp                                                               storage_imgproxy_simple-project
6ed93d79ca69   public.ecr.aws/supabase/storage-api:v0.48.2       "docker-entrypoint.s…"   19 hours ago   Up 19 hours (healthy)   5000/tcp                                                               supabase_storage_simple-project
c339208840cc   public.ecr.aws/supabase/postgrest:v12.0.2         "/bin/postgrest"         19 hours ago   Up 19 hours             3000/tcp                                                               supabase_rest_simple-project
7ead959723fe   public.ecr.aws/supabase/realtime:v2.25.50         "/usr/bin/tini -s -g…"   19 hours ago   Up 19 hours (healthy)   4000/tcp                                                               realtime-dev.supabase_realtime_simple-project
2706fe1a8dc5   public.ecr.aws/supabase/inbucket:3.0.3            "/start-inbucket.sh …"   19 hours ago   Up 19 hours (healthy)   1100/tcp, 2500/tcp, 0.0.0.0:54324->9000/tcp, :::54324->9000/tcp        supabase_inbucket_simple-project
4a8db32e0466   public.ecr.aws/supabase/gotrue:v2.143.0           "auth"                   19 hours ago   Up 19 hours (healthy)   9999/tcp                                                               supabase_auth_simple-project
0160565b729b   public.ecr.aws/supabase/kong:2.8.1                "sh -c 'cat <<'EOF' …"   19 hours ago   Up 19 hours (healthy)   8001/tcp, 8443-8444/tcp, 0.0.0.0:54321->8000/tcp, :::54321->8000/tcp   supabase_kong_simple-project
2aaf8a576989   public.ecr.aws/supabase/postgres:15.1.1.18        "sh -c 'cat <<'EOF' …"   19 hours ago   Up 19 hours (healthy)   0.0.0.0:54322->5432/tcp, :::54322->5432/tcp                            supabase_db_simple-project

Example 3: Displaying the Routing Table

> show routing table
Explanations:
Running the command will display the routing table in the WSL2 Ubuntu shell.

Commands to be executed:
netstat -nr

Do you approve the following commands? (y/N): y
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         172.20.208.1    0.0.0.0         UG        0 0          0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0
172.18.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-c2bdd950ace6
172.20.208.0    0.0.0.0         255.255.240.0   U         0 0          0 eth0
Feedback: Did it do what you expected? (y/N): y

Example 4: Getting Hostname

> what is my hostname ?
Explanations:
This command will display your hostname.

Commands to be executed:
hostname

Do you approve the following commands? (y/N): y
WINDOWS
Feedback: Did it do what you expected? (y/N): y

Author

@brainstack/nlsh is maintained by the Brainstack team.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Feel free to contribute and improve @brainstack/nlsh! Happy coding!