lazyshell  by not-poma

Zsh completion script using GPT for natural language command generation

created 2 years ago
378 stars

Top 75.1% on SourcePulse

GitHubView on GitHub
Project Summary

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

  • Install: Source lazyshell.zsh after downloading it and setting the OPENAI_API_KEY environment variable in .zshrc.
  • Prerequisites: OpenAI API key, Zsh shell.
  • Setup: Requires downloading a script and modifying .zshrc.

Highlighted Details

  • Natural language to Zsh command generation.
  • In-line command explanation via ALT+E.
  • Uses current command line as context for generation.
  • Customizable key bindings.

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.

Health Check
Last commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.