Skip to content

Commit

Permalink
pypi release 0.0.9 [Fix: Windows install, github not set-up, and imor…
Browse files Browse the repository at this point in the history
…ove examples] (#14)

Fixes:
- 🪟 Windows installs were running into decoding issues. Now decoding
scheme is explicitly stated. Fixes #8 #11
- ✅ Removed the assert that checked for user_id. If a user_id is not
found, it assign a per session unique_id. Fixes #3

Improvements:
- 💼 Brief welcome message. 
- 🚀 Better examples that demonstrate the power of gorilla
- 🦍 Logo in README
  • Loading branch information
ShishirPatil authored Jul 18, 2023
1 parent 290cd62 commit fc5b095
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Gorilla CLI

Gorilla CLI revolutionizes your command-line interactions with a user-centric tool that understands natural language commands. Simply state your objective, and Gorilla CLI will generate potential commands for execution. No more need to recall intricate command-line arguments!
<img src="https://github.com/ShishirPatil/gorilla/blob/gh-pages/assets/img/logo.png" width=50% height=50%>

Gorilla CLI powers your command-line interactions with a user-centric tool. Simply state your objective, and Gorilla CLI will generate potential commands for execution. Gorilla today supports ~1500 APIs, including Kubernetes, AWS, GCP, Azure, GitHub, Conda, Curl, Sed, and many more. No more recalling intricate CLI arguments! 🦍

Developed by UC Berkeley as a research prototype, Gorilla-CLI prioritizes user control and confidentiality:
- Commands are executed solely with your explicit approval.
Expand All @@ -16,27 +18,27 @@ pip install gorilla-cli

## Usage

Activate Gorilla CLI with a straightforward `gorilla` followed by your command in plain English.
Activate Gorilla CLI with `gorilla` followed by your task in plain English.

For instance, to list all files in the current directory, type:
For instance, to generate a file with 100 random characters, type:

```bash
$ gorilla I want to list all files in the current directory
$ gorilla generate 100 random characters into a file called test.txt
```

or if you prefer, you can use quotes to avoid issues with string parsing:

```bash
$ gorilla "I want to list all files in the current directory"
$ gorilla "generate 100 random characters into a file called test.txt"
```

Gorilla CLI will then generate potential commands. Simply use the arrow keys to navigate through the options, then press enter to execute the chosen command.
Gorilla CLI will then generate candidate commands. Use the arrow keys to navigate through the options, then press enter to execute the chosen command.

```
```bash
🦍 Welcome to Gorilla. Use arrows to select
» ls
ls -l
ls -al
» cat /dev/urandom | env LC_ALL=C tr -dc 'a-zA-Z0-9' | head -c 100 > test.txt
echo $(head /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | dd bs=100 count=1) > test.txt
dd if=/dev/urandom bs=1 count=100 of=test.txt
```

Some more examples
Expand All @@ -48,7 +50,7 @@ $ gorilla list all my GCP instances
gcloud compute instances list --format="table(name, zone, machineType, status)"
```
```bash
$ get the image ids of all pods running in all namespaces in kubernetes
$ gorilla get the image ids of all pods running in all namespaces in kubernetes
» kubectl get pods --all-namespaces -o jsonpath="{..imageID}"
kubectl get pods --all --namespaces
kubectl get pod -A -o jsonpath='{range .items[*]}{"\n"}{.metadata.name}{"\t"}{.spec.containers[].image}{"\n"}{end}'
Expand Down
13 changes: 8 additions & 5 deletions go_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
from halo import Halo
import go_questionary

__version__ = "0.0.8" # current version
__version__ = "0.0.9" # current version
SERVER_URL = "http://34.135.112.197:8000"
UPDATE_CHECK_FILE = os.path.expanduser("~/.gorilla-cli-last-update-check")
USERID_FILE = os.path.expanduser("~/.gorilla-cli-userid")
ISSUE_URL = f"https://github.com/gorilla-llm/gorilla-cli/issues/new"
WELCOME_TEXT = """🦍 Welcome to Gorilla-CLI! Enhance your Command Line with the power of LLMs!
Simply use `gorilla <your desired operation>` and Gorilla will do the rest. For instance:
gorilla what is the path of my current directory
gorilla generate 100 random characters into a file called test.txt
gorilla get the image ids of all pods running in all namespaces in kubernetes
gorilla list all my GCP instances
Created as a research prototype by UC Berkeley, Gorilla-CLI ensures user control and privacy:
A research prototype from UC Berkeley, Gorilla-CLI ensures user control and privacy:
- Commands are executed only with explicit user approval.
- While queries and error (stderr) logs are used to refine our model, we NEVER gather output (stdout) data.
Visit us at github.com/gorilla-llm/gorilla-cli and start talking to your CLI!"""
Visit github.com/gorilla-llm/gorilla-cli for examples and to learn more!"""


def check_for_updates():
Expand Down Expand Up @@ -73,7 +74,9 @@ def get_user_id():
try:
with open(USERID_FILE, "r") as f:
user_id = str(f.read())
assert user_id != ""
# If file found and user_id is blank. User hasn't setup github
if user_id == "":
user_id = str(uuid.uuid4())
return user_id
except FileNotFoundError:
try:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

setup(
name="gorilla-cli",
version="0.0.8",
version="0.0.9",
url="https://github.com/gorilla-llm/gorilla-cli",
author="Shishir Patil, Tianjun Zhang",
author_email="[email protected], [email protected]",
description="LLMs for CLI",
long_description=open("README.md").read(),
long_description=open("README.md", "r", encoding="utf-8").read(),
long_description_content_type="text/markdown",
py_modules=["go_cli"],
packages=find_packages(include=["*", "go_questionary.*"]),
Expand Down

0 comments on commit fc5b095

Please sign in to comment.