llm-cmd  by simonw

CLI tool to generate and execute shell commands

created 1 year ago
429 stars

Top 70.2% on sourcepulse

GitHubView on GitHub
Project Summary

This plugin allows users to leverage Large Language Models (LLMs) to generate and execute shell commands. It's designed for developers and power users who want to automate command-line tasks or quickly translate natural language requests into executable shell commands. The primary benefit is increased efficiency and reduced cognitive load for complex or repetitive shell operations.

How It Works

The plugin integrates with the llm CLI tool. When a user provides a natural language prompt (e.g., "undo last git commit"), llm-cmd sends this to the configured default LLM. The LLM is instructed via a system prompt to return only the raw shell command, without any formatting or explanatory text. This raw command is then presented to the user for review and optional editing before execution, with a safety mechanism to cancel via Ctrl+C.

Quick Start & Requirements

  • Install via llm install llm-cmd within your llm environment.
  • Requires llm CLI to be installed and configured with a default model.
  • See LLM CLI documentation for setup.

Highlighted Details

  • Generates and executes shell commands from natural language prompts.
  • Prioritizes safety by displaying commands for review before execution.
  • System prompt strictly enforces raw command output for direct execution.
  • Supports command cancellation via Ctrl+C.

Maintenance & Community

  • Developed by Simon Willison.
  • Further community and maintenance details are not specified in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is undetermined.

Limitations & Caveats

The tool is explicitly marked as potentially dangerous, requiring user confidence in understanding and verifying generated commands. The lack of a specified license raises concerns for commercial adoption.

Health Check
Last commit

2 months ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
2 more.

prompt-engine by microsoft

0.0%
3k
NPM library for LLM prompt engineering
created 3 years ago
updated 2 years ago
Feedback? Help us improve.