Magic CLI
Magic CLI is an innovative command line utility designed to enhance the efficiency of your command line usage. Drawing inspiration from notable projects such as Amazon Q and GitHub Copilot for CLI, Magic CLI leverages Language Learning Models (LLMs) for a smoother command line experience.
Key Features
-
Command Suggestion: Magic CLI can suggest commands based on a given prompt. Suppose you're working with tools like
ffmpeg
orkubectl
and you can't quite recall the necessary command arguments or their sequence, Magic CLI can come to your rescue. -
Task Generation Assistance: You can ask Magic CLI to generate command lines to accomplish specific tasks. It provides step-by-step command suggestions to help you achieve your goal, even guiding you through additional prompts if more context is needed.
-
Semantic Search: This feature allows you to search through your shell history semantically, enabling you to locate previous commands effectively and efficiently.
-
LLM Support: Magic CLI supports both local and remote LLM providers, such as Ollama and OpenAI. These models handle the execution, orchestration, and alignment of command line tasks.
Installation Options
Magic CLI offers various ways to install the utility based on your preferred environment:
- Shell Script: Use a simple shell script command to install Magic CLI.
- Homebrew: For macOS users, installation via Homebrew is available.
- PowerShell: Windows users can execute a PowerShell command for installation.
- Binaries: Pre-compiled binaries for different platforms are also available on the releases page.
Usage Tips
To make the most out of Magic CLI, users can add helpful functions to their .bashrc
or .zshrc
files. This simplifies the command structure and removes the need for quotes, ensuring a smoother prompt formatting process.
For example:
function mcs {
model_prompt="$*"
magic-cli suggest "$model_prompt"
}
This function allows you to easily pass a prompt to Magic CLI to get command suggestions.
Configuration
Magic CLI stores its configuration in a JSON file located in the user home directory. Users can configure various options such as their preferred LLM provider, API keys, models for embedding and generating responses, and how suggested commands should be handled.
Roadmap
Magic CLI is in early development, with plans to expand Windows support, include more LLM providers like Anthropic, and improve local data storage efficiency. Enhanced testing is also on the roadmap to ensure a robust user experience.
Security
Security is a top priority for Magic CLI. Currently, it handles sensitive data such as the OpenAI API key, which is stored securely in the user’s home directory. There are plans to further strengthen security measures by utilizing the system's secure key storage in the future.
Contribution
Magic CLI welcomes contributions from the community. Potential contributors are encouraged to make proposals through issues to ensure alignment with the project's needs and context. For more detailed guidelines on contributing and security, refer to the project's CONTRIBUTING.md
and SECURITY.md
.
Magic CLI is poised to transform the way users interact with the command line, offering a sophisticated yet user-friendly toolset designed to simplify and enhance command line interactions.