Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Gorilla CLI on Windows 11 64-bit #34

Open
zajcomm opened this issue Aug 24, 2023 · 7 comments
Open

Issue with Gorilla CLI on Windows 11 64-bit #34

zajcomm opened this issue Aug 24, 2023 · 7 comments

Comments

@zajcomm
Copy link

zajcomm commented Aug 24, 2023

Environment

  • OS: MS Windows 11 64-bit

Problem Description

When trying to execute the Gorilla command to generate random characters into a file, I encountered an issue with the command not being recognized.

Steps to Reproduce

  1. Start Code: Write this code in the command prompt: [make sure to change the path]
    (myVenv) C:\path\to\your\project\Gorilla>gorilla generate 100 random characters into a file called test.txt
    
  2. Get Options to select from: Get these options:
    🦍  Welcome to Gorilla. Use arrows to select
     » echo "100" | sudo tee -a test.txt
       cat /dev/urandom | tr -dc 'a-z0-9' | head -c 100 > test.txt
       cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 100 | head -n 1 > test.txt
       : #Do nothing
    
  3. Select an Option: When selecting any of the first 3 options, receive the following error message, where xxx can be different for different prompts:
    • Example selection/output 1:
      🦍  echo "100" | sudo tee -a test.txt
      'sudo' is not recognized as an internal or external command,
      operable program or batch file.
      

Below is an example when selecting another option:

  • Example selection/output 2:
    🦍  cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 100 | head -n 1 > test.txt
    'cat' is not recognized as an internal or external command,
    operable program or batch file.
    

Expected Behavior

The command should successfully generate 100 random characters into a file called test.txt.

Actual Behavior

The command prompts are not recognized, resulting in an error message.

Additional Context

This issue seems to be specific to Windows, as the commands mentioned are typical Unix/Linux commands that are not recognized in the Windows environment.


Please let me know if there's anything else I can assist you with!

@ShishirPatil
Copy link
Member

Hey @zajcomm thanks for trying out Gorilla, and the detailed error log - appreciate it.
Yes, your diagnosis is correct re: Unix commands on windows. One way that others have solved this is by prefixing or suffixing "on a windows powershell" or "on WSL" are is appropriate. Let me know if this works?
I have a fix for this, which I will release soon to get this information directly from the CLI!

@MTHALO
Copy link

MTHALO commented Aug 26, 2023

@ShishirPatil I have the same issue How can I solve this by prefixing or suffixing "on a Windows PowerShell" or "on WSL" I googled it and didn't understand it.

@ShishirPatil
Copy link
Member

Hey @MTHALO @zajcomm I just merged #35 which I hope fixes it. Can you try this?

@MTHALO yeah so you can try to ask your prompt along with the prefix. For example,

$gorilla on a windows powershell list all files in my current directory

$gorilla generate 100 random characters into a file called test.txt on windows powershell

Make sure you re-install from source before trying it out!

@Ab0rt3dF3tvs
Copy link

@ShishirPatil Good day! I am also encountering the same issue, through CMD and Powershell.
C:\me\project>gorilla I need your assistance and guidance on how to use you through cli
🦍 sed -n '/GUIDANCE -/,/HOW TO USE/p' README.md | grep -E '*- ' | cut -c 4-
'sed' is not recognized as an internal or external command,
operable program or batch file.----------This is through CMD
PS C:\me\project> $gorilla on a windows powershell list all files in my current directory
At line:1 char:10

  • $gorilla on a windows powershell list all files in my current directo ...
  •      ~~
    

Unexpected token 'on' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

Any information would be completely appreciated

@ShishirPatil
Copy link
Member

Hey @Ab0rt3dF3tvs this is interesting. I was able to re-create the bug - I'm trying to fix it and will push a PR by Monday.
BTW, what you are trying here with

PS C:\me\project> $gorilla on a windows powershell list all files in my current directory

is the correct way I'd recommend ! Thanks for trying it out, and stay tuned!!

@supermario-ai
Copy link

File suffix works for me: "gorilla provide me x and transpile into .ps1". TextBlaze is a Godsend with cli tooling.

Always a please @ShishirPatil Fam! 🙏

@Ab0rt3dF3tvs
Copy link

"@ShishirPatil C:\Users\D>gorilla do you have a help menu?
🦍 Welcome to Gorilla. Use arrows to select
» git help
echo "No, as an AI, I don't have a help menu. However, most command-line too
man sh
: #Do nothing
C:\Users\D>gorilla do you have a help menu?
🦍 git help
'git' is not recognized as an internal or external command,
operable program or batch file."
These are the errors I receive via CMD
"PS C:\Users\D> $gorilla create a dektop folder named glozilla
At line:1 char:10

  • $gorilla create a dektop folder named glozilla
  •      ~~~~~~
    

Unexpected token 'create' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken"
This is the error message I get when trying to run through powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants