Magic CLI
Rust command-line tool that suggests shell commands from a description, searches terminal history and tackles tasks through a local or cloud model
- 745 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The unsafe-execution mode runs the model-proposed command in the current shell, and ask may request running other commands
- With a cloud model the task description and shell history fragments go to its provider
- The OpenAI key is stored in a regular settings file, not in the system's secure storage
Install
Manual install
brew install guywaldman/tap/magic-cliOther routes: the script and PowerShell installer from the releases page, and prebuilt binaries.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The unsafe-execution mode runs the model-proposed command in the current shell, and ask may request running other commands
- With a cloud model the task description and shell history fragments go to its provider
- The OpenAI key is stored in a regular settings file, not in the system's secure storage
This is third-party code. Review the repository files before installing.
What it does
Magic CLI is a Rust command-line tool that calls a language model so you consult command help less often. `magic-cli suggest` takes a task description, for example resize an image to 300x300 with ffmpeg, and proposes a ready command with an explanation. It helps with tools with long arguments such as ffmpeg and kubectl, when you roughly know what you need but not the parameter order. Depending on settings, the command is copied to the clipboard or run in the current shell. `magic-cli search` searches shell history by meaning: it builds vector embeddings of commands and returns the best matches. `magic-cli ask` is meant for tasks like setting up the environment as the README describes: the model proposes commands and along the way may ask questions and request running commands to gather context. The author calls both commands experimental. The model is picked in settings: local ollama or cloud OpenAI. Settings live in ~/.config/magic_cli/config.json and are changed with `magic-cli config`. To type requests without quotes, the docs suggest adding short wrapper functions to ~/.bashrc or ~/.zshrc, for example mcs for suggest.
Who it is for. For developers and administrators who spend a lot of time in the terminal and want commands from a description on their own machine, including with a local model that sends nothing outside.
Good fit when
- You need to recall the argument order for ffmpeg, kubectl or another tool with long syntax
- You want to find in your terminal history a command you ran long ago but can't phrase
- You want command hints from a local model through ollama with no cloud key
- You need a small single binary installed with one command or through Homebrew
- A setup task is described in text and the model should propose commands step by step
Not a fit when
- You need a terminal assistant with many model providers, a REPL chat and RAG: AIChat in the catalog covers that
- You need an agent that edits project files and runs big tasks: Magic CLI only proposes commands and writes no code itself
- You work on Windows and need verified support: a PowerShell installer exists, but the author has not tested Windows properly
- Commands must not run without careful human review while the execution mode is on: then set copying to the clipboard
Example request
Run magic-cli suggest with the description resize test_image.png to 300x300 with ffmpeg and show the proposed command without running itLimitations
The project is in early development, version 0.0.6: the author warns of possible breakage on updates and asks to report bugs. MIT license.
The `suggest` command has two modes, `clipboard` and `unsafe-execution`. The project description names execution as the default, while the code default is copying to the clipboard, so check the setting and set it explicitly.
The OpenAI key is stored in the settings file in your home folder; moving it to the system's secure storage is only planned. Embeddings of your command history also live in that folder as plain JSON, and building them with a cloud model costs money, especially for a long history.
The settings list ollama and OpenAI, while Anthropic is mentioned in the feature list but appears in the roadmap as future support. Default models are codestral for ollama and gpt-4o for OpenAI.
How to disable. Delete the binary: `brew uninstall magic-cli` if installed through Homebrew, or the magic-cli file from the folder the installer used. Then delete ~/.config/magic_cli, which holds the settings, the OpenAI key and the history index. Remove the wrapper function lines from ~/.bashrc or ~/.zshrc if you added them.
FAQ
How do I install Magic CLI?
With `brew install guywaldman/tap/magic-cli`, with the release install script (`curl` with the magic-cli-installer.sh address from the releases page) or by downloading a binary for your platform. There is also magic-cli-installer.ps1 for PowerShell.
Which models does Magic CLI support?
In settings you can pick local ollama or cloud OpenAI. The defaults for ollama are the codestral model, the address http://localhost:11434 and nomic-embed-text for embeddings; for OpenAI they are gpt-4o and text-embedding-ada-002.
How is suggest different from ask?
Suggest answers a short description with one command and an explanation. Ask works on a whole task: the model may request context and ask you to run commands along the way. The author calls ask experimental.
How do I search shell history by meaning?
With `magic-cli search` and a description, for example `magic-cli search "zellij attach"`. It matches the query against embeddings of commands from your history and returns the best results.
Where does Magic CLI keep its settings?
In ~/.config/magic_cli/config.json. Change parameters with `magic-cli config` and its subcommands set, get, list, reset and path.
What are the mcs, mcf and mca functions for?
They are wrappers the author suggests adding to ~/.bashrc or ~/.zshrc: they call suggest, search and ask and let you type a request without quotes.
Discussion
No questions or reviews yet.
Related
CLI toolsA Rust CLI that packs a codebase into one prompt with a file tree, templates and token estimates
A Rust binary for agents and the terminal that uses tree-sitter to find a symbol's definition, its calls and file dependencies
A Rust CLI for over 20 LLM providers: command mode, REPL chat, RAG and tool calling from the terminal
Two Rust commands for the terminal: qq answers a quick command-line question, and qa performs a single step with files and commands
A structural code search MCP server for agents: finds the right file by query intent and runs locally
An MCP server and CLI for code research: search and understand your project and all of GitHub with fewer tokens
Comparison with similar tools
Entries that share the main search query, and how they differ.
README in short
The description opens with an early-stage warning and a link to the author's post. It then lists features, four ways to install (script, Homebrew, PowerShell, binaries), a tip on shell wrappers and, by section, three commands with examples and screenshots. Model selection, a settings list with defaults, a roadmap and a security section naming the stored data, the OpenAI key and history embeddings, are covered separately. The repository holds the Rust source, tests and a contributor guide.