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

Please allow asking for commands for a different shell, e.g. cmd.exe/bash on Windows #186

Closed
Boscop opened this issue Apr 16, 2023 · 2 comments · Fixed by #183
Closed

Please allow asking for commands for a different shell, e.g. cmd.exe/bash on Windows #186

Boscop opened this issue Apr 16, 2023 · 2 comments · Fixed by #183

Comments

@Boscop
Copy link

Boscop commented Apr 16, 2023

I'm on Win10 where I have powershell, cmd.exe and bash (sh.exe from Git) available (in addition to bash/zsh/nushell in WSL2).
It's fine if ShellGPT assumes powershell by default, but sometimes I want to generate a command for cmd.exe or sh.exe, also sometimes I want to generate a command for running on another linux machine (like my synology NAS or raspberry PI or WSL2 or in virtualbox or on another host where sgpt is not installed).
It would be really nice if ShellGPT would allow custom prompt presets, so that I can make a preset for each OS/SHELL combination and then pass the preset by name with --preset name/-p name.

For now it would also be sufficient if the user could override the inferred OS/SHELL via CLI args, so the given values will be inserted in the shell prompt template. E.g. in PowerShell, I could call sgpt --shell bash "list extensions of all files" (in that case, it could still use the inferred value for OS, because it's not overridden with --os).
Could you please add this feature? :)

@Boscop Boscop changed the title Please allow asking for a different shell Please allow asking for commands for a different shell, e.g. cmd.exe/bash on Windows Apr 16, 2023
@TheR1D TheR1D linked a pull request Apr 16, 2023 that will close this issue
9 tasks
@xsoc
Copy link

xsoc commented Apr 16, 2023

@TheR1D won't it just use whatever shell it was called from?

@TheR1D
Copy link
Owner

TheR1D commented Apr 16, 2023

Yes, ShellGPT detects the environment in which it is being executed. In Windows cmd.exe, it provides CMD commands, while in PowerShell, it delivers PowerShell commands accordingly. However, I believe the requested use case involves using sgpt on a Windows machine while generating commands for different operating systems or shells. This can be easily done using coming System Roles feature.

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

Successfully merging a pull request may close this issue.

4 participants
@Boscop @TheR1D @xsoc and others