Skip to main content

Ask GPT to run a command

Project description

llmdo

llmdo is a Python application that leverages Large Language Models (LLMs) to translate English requests into shell commands. It provides a convenient way to interact with your system using natural language.

Features

  • Translates English requests into corresponding shell commands
  • Supports multiple LLMs for command generation
  • Customizable configuration file
  • Verbose mode for debugging
  • YOLO mode for running commands without confirmation

Installation

pip install llmdo

Usage

llmdo uses OpenAI, Claude, and local LLM APIs to generate shell commands based on the user's requests. For OpenAI and Claude, you will need to have an API key to use this tool.

To use llmdo, run the following command followed by your request:

llmdo [options] <request>

Options

  • -h, --help: Show the help message and exit.
  • -c CONFIG, --config CONFIG: Specify the path to the configuration file. Default is ~/.config/llmdo/llmdo.json.
  • -l, --list-models: List the available LLMs.
  • -m MODEL, --model MODEL: Specify which LLM to use for command generation.
  • -v, --verbose: Print verbose debug information.
  • -y, --yolo: Run the generated command without confirmation.

Examples

  1. Translate a request to a shell command:
llmdo "list all files in the current directory"
  1. Use a specific LLM for command generation:
llmdo -m gpt-3.5-turbo "find all Python files in the project"
  1. Run the generated command without confirmation:
llmdo -y "delete all temporary files"

Configuration

The configuration file for llmdo is located at ~/.config/llmdo/llmdo.json by default. You can specify a different path using the -c or --config option.

The configuration file allows you to customize the behavior of llmdo, such as specifying the default LLM, setting API keys, and defining custom aliases.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

This project is licensed under the GPLv3.

Disclaimer

llmdo is an experimental tool that relies on LLMs for generating shell commands. While it can be helpful, it's important to review and understand the generated commands before executing them, especially when using the YOLO mode. The developers are not responsible for any damages or unintended consequences resulting from the use of this tool.

This project is not affiliated with OpenAI, Claude, or my employer in any way. It is an independent project created for educational and research purposes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmdo-0.2.1.tar.gz (22.7 kB view details)

Uploaded Source

File details

Details for the file llmdo-0.2.1.tar.gz.

File metadata

  • Download URL: llmdo-0.2.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.9

File hashes

Hashes for llmdo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6614b9690e3e3b66c513e4e914cb14916f545f9ec9a11ea113ebcacb0048a7ea
MD5 afc8694361560d3f9184cfa33c26d02c
BLAKE2b-256 982c4022be64e60e746775a5d89eb6f77f1e46b44b89ebed586b6734ee1092d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page