magic-cli  by guywaldman

CLI tool for LLM-powered command-line assistance

created 1 year ago
746 stars

Top 47.5% on sourcepulse

GitHubView on GitHub
Project Summary

Magic CLI is a command-line utility designed to enhance terminal efficiency by leveraging Large Language Models (LLMs). It assists users in discovering, generating, and executing shell commands, acting as an AI pair programmer for the command line. The tool is targeted at developers and power users who frequently interact with the terminal and can benefit from intelligent command suggestions and history search.

How It Works

Magic CLI integrates with LLMs to provide its core functionalities. It supports both local LLM providers like Ollama and cloud-based services such as OpenAI. The tool can suggest commands based on natural language prompts, search through shell history semantically, and even attempt to execute multi-step tasks by generating and potentially running sequences of commands. This approach aims to reduce the cognitive load of remembering complex command syntax and arguments.

Quick Start & Requirements

  • Installation: Via shell script (curl ... | sh) or Homebrew (brew install guywaldman/tap/magic-cli). PowerShell installation is also supported.
  • Prerequisites: An LLM provider (Ollama or OpenAI with API key) must be configured.
  • Configuration: Stored in ~/.config/magic_cli/config.json.
  • Docs: https://github.com/guywaldman/magic-cli

Highlighted Details

  • Supports local (Ollama) and remote (OpenAI) LLM providers.
  • Features command suggestion, semantic history search, and task-based command generation.
  • Offers configurable modes for command suggestion, including clipboard copy and direct execution.
  • Provides helper functions for easier prompt formatting in .bashrc or .zshrc.

Maintenance & Community

The project is in early development, with a caution for breaking changes and bugs. Contributions are welcomed via pull requests linked to issues.

Licensing & Compatibility

The repository does not explicitly state a license in the README.

Limitations & Caveats

The project is in early development, with potential for breaking changes and bugs. Windows support is noted as untested, though PowerShell installation is available. Sensitive data like OpenAI API keys are stored in plain text configuration files, with plans for more secure storage. The local embedding index is stored naively as JSON, with future plans for SQLite.

Health Check
Last commit

1 year ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.