← 开源

Use LLM to generate and execute commands in your shell

ApplicationsProductivityPython
增长势头
+-124 小时新增 Star-0.2%
478
Star
40
Fork
+-1
本周
2
贡献者
创建于 2024-03-26 · 更新于 2026-12-04 · 今日第 28533 名
主要开发者
README

llm-cmd

Use LLM to generate and execute commands in your shell

For background on this project see llm cmd undo last git commit—a new plugin for LLM

Installation

Install this plugin in the same environment as LLM.

llm install llm-cmd

Usage

This command could be very dangerous. Do not use this unless you are confident you understand what it does and are sure you could spot if it is likely to do something dangerous.

Run llm cmd like this:

llm cmd undo last git commit

It will use your default model to generate the corresponding shell command.

This will then be displayed in your terminal ready for you to edit it, or hit <enter> to execute the prompt.

If the command doesnt't look right, hit Ctrl+C to cancel.

The system prompt

This is the prompt used by this tool:

Return only the command to be executed as a raw string, no string delimiters wrapping it, no yapping, no markdown, no fenced code blocks, what you return will be passed to subprocess.check_output() directly.

For example, if the user asks: undo last git commit

You return only: git reset --soft HEAD~1

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-cmd
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

To run the tests:

pytest
排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载