Skip to content

segelmark/command-anything

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Command Anything

Command Anything lets you create command-line commands using plain English. Instead of remembering complex syntax or flags, just describe what you want to do, and let AI figure out the details.

Why Use Command Anything?

  • Focus on intent: Tell it what you want to accomplish, not how to do it
  • Natural language: No need to memorize command syntax or man pages
  • Learn as you go: See the actual commands that match your intentions
  • Safe execution: Preview commands before running them

Quick Start

  1. Clone the repo in your preferred location

  2. Install dependencies

pip install -r requirements.txt
  1. Make the script executable:
chmod +x command-anything
  1. Set up an alias for easy access. Add this line to your shell config file:

For Bash (~/.bashrc or ~/.bash_profile):

alias llm="path/to/command-anything"

For Zsh (~/.zshrc):

alias llm="path/to/command-anything"

After adding the alias:

source ~/.bashrc  # or ~/.zshrc if using Zsh

Now you can use llm from anywhere!

How to Use

Basic usage:

llm "your request in plain english"

Options:

  • -m MODEL: Choose a different AI model (default: gpt-4o)
  • -l LANGUAGE: Specify output language (default: python)
  • -p PARAMETERS: Add extra context or parameters

For each command:

  1. Describe what you want to do
  2. Review the explanation and generated command
  3. Confirm if you want to run it

Tips for Best Results

  • Be specific about what you want to accomplish
  • Include relevant details like file types, locations, or conditions
  • Review commands before executing, especially for system-changing operations
  • Use parameters to provide additional context when needed

Safety Notes

  • Always review generated commands before execution
  • The tool will show you what it plans to do and ask for confirmation
  • For system-changing operations, consider running with --dry-run first (just add this to your request)

Examples

Find large files in your system:

llm "find files larger than 1GB in my home directory"

Manage processes:

llm "kill all processes using more than 2GB of RAM"

File operations:

llm "rename all jpg files in current folder to include today's date"

System maintenance:

llm "clean up old docker images and containers"

Complex tasks:

llm "find all Python files modified in the last week and count their lines of code"

Requirements

  • Python 3.x
  • OpenAI API key (set in your environment)
  • Required Python packages: openai, pydantic

Installation Troubleshooting

If you get a "command not found" error:

  1. Make sure the script is executable (chmod +x command-anything)
  2. Verify your alias is set up correctly:
which llm
  1. Check if the OpenAI API key is set:
echo $OPENAI_API_KEY

About

Create command-line commands using plain English

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages