Zsh completion script using GPT for natural language command generation
Top 75.1% on SourcePulse
LazyShell is a Zsh completion script that leverages GPT to translate natural language requests into shell commands, and to explain existing commands. It targets Zsh users seeking to streamline command-line operations by reducing the need to memorize complex arguments, offering an AI-powered assistant directly within their terminal.
How It Works
LazyShell integrates with the Zsh shell via a sourced script. When invoked with ALT+G
, it sends the current command line buffer (if any) and a natural language prompt to the OpenAI API. The API's response, a generated shell command, is then inserted into the Zsh prompt. For command explanations, ALT+E
sends the current command to the API for a natural language description. This approach offers a convenient, context-aware method for command generation and understanding without leaving the terminal.
Quick Start & Requirements
lazyshell.zsh
after downloading it and setting the OPENAI_API_KEY
environment variable in .zshrc
..zshrc
.Highlighted Details
ALT+E
.Maintenance & Community
The project is maintained by not-poma. Contributions are welcomed, particularly for Zsh completion scripts. A TODO list indicates planned features and improvements.
Licensing & Compatibility
The script is provided without an explicit license in the README. Compatibility is limited to Zsh.
Limitations & Caveats
LazyShell is in alpha stage and may contain bugs. macOS users might need to reconfigure hotkeys if the OS intercepts them. Support for shells other than Zsh is planned but not yet implemented.
2 years ago
Inactive