← 开源
guywaldman

magic-cli

Command line utility to make you a magician in the terminal

ApplicationsCodingRust
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
745
Star
19
Fork
+0
本周
2
贡献者
创建于 2024-06-24 · 更新于 2026-10-06 · 今日第 14287 名
主要开发者
guywaldmanyuankunzhang

guywaldman/magic-cli 排名第 14,287,有 745 个星标。

同类别比较

guywaldman/magic-cli 排名第 14,287,此处有 8 个同类条目;math-ai-org/mathcode 排名第 14,290。

同类别比较
名称排名指标
DoubangoTelecom/ultimateALPR-SDK14,270
语言:
C++
星标数:
746
分叉数:
182
简介:
World's fastest ANPR / ALPR implementation for CPUs, GPUs, VPUs and NPUs using deep learning (Tensorflow, Tensorflow lite, TensorRT, OpenVX, OpenVINO). Multi-Charset (Latin, Korean, Chinese) & Multi-OS (Jetson, Android, Raspberry Pi, Linux, Windows) & Multi-Arch (ARM, x86).
CryptoDmitry/Ghost-Agent14,279
语言:
Shell
星标数:
745
分叉数:
59
Seanium/FeedMe14,281
语言:
TypeScript
星标数:
745
分叉数:
167
简介:
😋 AI-powered, Lightweight RSS Reader. Supports: GitHub Pages | Vercel | Alibaba Cloud ESA Pages | Docker
anantdgoel/ProjectFib14,282
语言:
Python
星标数:
745
分叉数:
180
简介:
Chrome extension to flag fake news on Facebook. Built at HackPrinceton '16
math-ai-org/mathcode14,290
语言:
Shell
星标数:
745
分叉数:
68
简介:
MathCode: A Frontier Mathematical Coding Agent
thu-vu92/knowledge-graph-llms14,293
语言:
Jupyter Notebook
星标数:
745
分叉数:
224
简介:
In this project, I explored how to extract knowledge graphs from text using LLMs, such as OpenAI GPT4o.
bethesirius/ChosunTruck14,307
语言:
Python
星标数:
743
分叉数:
96
简介:
Euro Truck Simulator 2 autonomous driving solution
diStyApps/seait14,339
语言:
Python
星标数:
740
分叉数:
52
简介:
SEAIT is a user-friendly application that simplifies the installation process of AI-related projects
关键参数与规格
关键参数与规格
参数值
语言Rust
类别Applications
子类别Coding
星标数745
分叉数19
贡献者2
创建日期2024-06-24
更新日期2026-10-06
1 天星标数0
7 天星标数0
排名14,287
上次排名14,143
排名变化-144
7 天星标排名14,392
上次 7 天星标排名14,404
7 天星标排名变化12
总星标排名14,159
上次总星标排名14,130
总星标排名变化-29
README 摘录

Magic CLI Magic CLI is a command line utility which uses LLMs to help you use the command line more efficiently, inspired by projects such as Amazon Q (prev. Fig terminal) and GitHub Copilot for CLI. relies on the orch library for LLM interactions (execution, orchestration, model alignment, etc. CAUTION] This project is still in early development. Expect breaking changes and bugs, and please report any issues you encounter. NOTE] For more options on how to install Magic CLI, see

the releases page for the version you wish to install. Shell Homebrew PowerShell Binaries See the releases page for binaries for your platform. Usage Tip Add functions to your or to make formatting the prompts in the terminal easier (not requiring quotes). For example: Suggest a command Supply a prompt to get a suggestion for the command to run. This is useful in scenarios where you know approximately what you want (and perhaps even the tool) but don't remember the

exact arguments or their order. This is especially useful with CLI tools like or . Search across your command history (experimental) Search a command across your shell history, and get a list of the top results. IMPORTANT] Word to the wise: If you're using a non-local LLM, be wary about the cost of the embeddings, especially for long shell histories. Ask to generate a command (experimental) Supply a prompt with a task you want the model to perform, and watch

it try to suggest a command to run to achieve the goal. It may prompt you along the way to run commands if it needs more context. Use different LLMs Magic CLI supports two LLM providers: : Ollama is a local LLM provider. The command expects Ollama to be installed and running on your local machine. You configure an API token, and Magic CLI uses it with the OpenAI APIs. Configuration Magic CLI stores configurations in . Use (to see the options

, use ) to set the configuration options: The currently suppprted configuration options are: : The LLM to use for generating responses. Supported values: "ollama", "openai" : The base URL of the Ollama API (default: " : The model to use for generating embeddings (default: "nomic-embed-text:latest") : The model to use for generating responses (default: "codestral:latest") (secret): The API key for the OpenAI API : The model to use for generating embeddings (default: "text-embedding-ada-002") : The model to use for generating responses

(default: "gpt-4o") : Whether to add the suggested command to the shell history (default: false) : The mode to use for suggesting commands. Supported values: "clipboard" (copying command to clipboard), "unsafe-execution" (executing in the current shell session) (default: "unsafe-execution") Note: is named as such to make it clear that the CLI executes the command in the current shell session. Please be extremely careful when using this mode - Magic CLI is not responsible for the execution of commands suggested. Roadmap

[ ] Windows support (PowerShell is supported, but Windows has not been tested properly) [ ] Support for more LLM providers (e. In terms

常见问题

记录了多少星标和分叉?

guywaldman/magic-cli 有 745 个星标和 19 个分叉。

仓库排名是多少?

guywaldman/magic-cli 排名第 14,287。

记录的语言和类别是什么?

guywaldman/magic-cli 有 745 个星标,语言为 Rust,类别为 Applications。

哪个仓库排名最接近?

guywaldman/magic-cli 与 math-ai-org/mathcode 比较,后者排名第 14,290,有 745 个星标。

README

Magic CLI

Magic CLI is a command line utility which uses LLMs to help you use the command line more efficiently, inspired by projects such as Amazon Q (prev. Fig terminal) and GitHub Copilot for CLI.

magic-cli relies on the orch library for LLM interactions (execution, orchestration, model alignment, etc.).

Read the announcement blog post.

[!CAUTION]

This project is still in early development.
Expect breaking changes and bugs, and please report any issues you encounter.
Thank you!


Features

  • Suggest a command (see section)
  • Ask to generate a command to perform a task (see section)
  • Semantic search of commands across your shell history
  • Use a local or remote LLM (see section)

Installation

[!NOTE]

For more options on how to install Magic CLI, see the releases page for the version you wish to install.

Shell

curl -LsSf https://github.com/guywaldman/magic-cli/releases/download/0.0.6/magic-cli-installer.sh | sh

Homebrew

brew install guywaldman/tap/magic-cli

PowerShell

powershell -c "irm https://github.com/guywaldman/magic-cli/releases/download/0.0.6/magic-cli-installer.ps1 | iex"

Binaries

See the releases page for binaries for your platform.

Usage Tip

Add functions to your ~/.bashrc or ~/.zshrc to make formatting the prompts in the terminal easier (not requiring quotes).

For example:

function mcs {
  model_prompt="$*"
  magic-cli suggest "$model_prompt"
}

function mcf {
  model_prompt="$*"
  magic-cli search "$model_prompt"
}

function mca {
  model_prompt="$*"
  magic-cli ask "$model_prompt"
}

Suggest a command

Supply a prompt to get a suggestion for the command to run.
This is useful in scenarios where you know approximately what you want (and perhaps even the tool) but don't remember the exact arguments or their order.
This is especially useful with CLI tools like ffmpeg or kubectl.

magic-cli suggest "Resize test_image.png to 300x300 with ffmpeg"
Usage: magic-cli suggest 

Arguments:
    The prompt to suggest a command for (e.g., "Resize image to 300x300 with ffmpeg")

Search across your command history (experimental)

Search a command across your shell history, and get a list of the top results.

magic-cli search "zellij attach"
Usage: magic-cli search [OPTIONS] 

Arguments:
    The prompt to search for

[!IMPORTANT]

Word to the wise: If you're using a non-local LLM, be wary about the cost of the embeddings, especially for long shell histories.

Ask to generate a command (experimental)

Supply a prompt with a task you want the model to perform, and watch it try to suggest a command to run to achieve the goal. It may prompt you along the way to run commands if it needs more context.

magic-cli ask "Set up the dev environment as described in the README"
Usage: magic-cli ask 

Arguments:
    The prompt to ask for (e.g., "Set up the development environment")

Use different LLMs

Magic CLI supports two LLM providers:

  • ollama: Ollama is a local LLM provider. The command expects Ollama to be installed and running on your local machine.
  • openai: OpenAI is a cloud LLM provider. You configure an API token, and Magic CLI uses it with the OpenAI APIs.

Configuration

Magic CLI stores configurations in ~/.config/magic_cli/config.json.

Use magic-cli config (to see the options, use magic-cli config --help) to set the configuration options:

Usage: magic-cli config 

Commands:
  set    Set a value
  get    Get a value
  list   List the configurations
  reset  Reset the configurations to the default values
  path   Get the path to the configuration file

The currently suppprted configuration options are:

  • llm: The LLM to use for generating responses. Supported values: "ollama", "openai"
  • ollama.base_url: The base URL of the Ollama API (default: "http://localhost:11434")
  • ollama.embedding_model: The model to use for generating embeddings (default: "nomic-embed-text:latest")
  • ollama.model: The model to use for generating responses (default: "codestral:latest")
  • openai.api_key (secret): The API key for the OpenAI API
  • openai.embedding_model: The model to use for generating embeddings (default: "text-embedding-ada-002")
  • openai.model: The model to use for generating responses (default: "gpt-4o")
  • suggest.add_to_history: Whether to add the suggested command to the shell history (default: false)
  • suggest.mode: The mode to use for suggesting commands. Supported values: "clipboard" (copying command to clipboard), "unsafe-execution" (executing in the current shell session) (default: "unsafe-execution")

    Note: unsafe-execution is named as such to make it clear that the CLI executes the command in the current shell session. Please be extremely careful when using this mode - Magic CLI is not responsible for the execution of commands suggested.

Roadmap

  • [ ] Windows support (PowerShell is supported, but Windows has not been tested properly)

  • [ ] Support for more LLM providers (e.g., Anthropic)

  • [ ] Improve local embedding index (currently stored naively as a JSON, looked into SQLLite with vector extensions)

  • [ ] More test coverage


Security

Security is taken seriously and all vulnerabilities will be handled with utmost care and priority.

In terms of data stored, the sensitive data that is currently handled by Magic CLI is:

  • OpenAI API key, which is stored in the configuration within the user home directory (~/.config/magic_cli).

    There are plans to store this token in the system's secure key storage, but this is not yet implemented.

  • Embeddings of the shell history for the magic-cli search command, which are stored in the configuration within the user home directory (~/.config/magic_cli) and are generated using the LLM provider of choice.

Please see SECURITY.md for more information, and instructions on how to report potential vulnerabilities.

Contributing

Contributions are welcome!

Please see CONTRIBUTING.md for more information.

My only request is that pull requests follow an issue, such that we avoid situations of your hard work not being accepted due to a lack of context or necessity.

排名相邻
同类项目