DoForMe
A CLI tool that converts natural language into CLI commands using AI. No more remembering complex command syntax!
Features
- 🤖 Supports multiple LLM providers (OpenAI, Anthropic/Claude, Groq, OpenRouter)
- 🔍 Automatically checks if required tools are installed
- ⚡ Fast and easy to use
- 🔐 Secure API key management
- ✅ Confirmation before executing commands
- 🎯 Dry-run mode to preview commands
Installation
From PyPI
pip install doforme
From source
git clone https://github.com/yourusername/doforme.git
cd doforme
pip install -e .
No external dependencies required! DoForMe uses Python's built-in libraries to communicate with all LLM provider APIs.
Usage
Basic Usage
Simply describe what you want to do in natural language:
doforme "downsize with ffmpeg to max 1024 on each side"
This will:
- Query the AI to generate the appropriate command
- Show you the command
- Ask for confirmation
- Execute it (if you confirm)
More Examples
# File operations
doforme "find all python files in this directory"
doforme "compress this folder into a zip file"
doforme "count lines of code in all js files"
# Media processing
doforme "convert all png images to jpg"
doforme "extract audio from video.mp4"
doforme "create a gif from images"
# System operations
doforme "show disk usage"
doforme "find the largest files in current directory"
doforme "check my internet speed"
# Git operations
doforme "show git log for the last 5 commits"
doforme "undo last commit but keep changes"
Options
Dry Run Mode
Preview the command without executing:
doforme --dry-run "delete all log files"
Auto-Execute Mode
Skip confirmation (use with caution!):
doforme --yes "show current date"
doforme -y "list files"
Setup
1. Get an API Key
Choose your preferred LLM provider and get an API key:
- OpenAI: OpenAI Platform
- Anthropic (Claude): Anthropic Console
- Groq: Groq Console
- OpenRouter: OpenRouter
2. Configure the API Key
You have three options:
Option A: Environment Variable (Recommended)
# For OpenAI
export OPENAI_API_KEY=your_key_here
# For Anthropic/Claude
export ANTHROPIC_API_KEY=your_key_here
# For Groq
export GROQ_API_KEY=your_key_here
# For OpenRouter
export OPENROUTER_API_KEY=your_key_here
Add this to your ~/.bashrc or ~/.zshrc to make it permanent.
Option B: Interactive Setup
Just run doforme without an API key and it will prompt you to:
- Select your LLM provider
- Enter your API key
doforme "list files"
Option C: Using DoForMe itself
doforme "set the api key to sk-..."
# This will prompt you to select a provider
How It Works
- Input: You provide a natural language description
- AI Processing: DoForMe sends your request to your chosen LLM provider's API
- Command Generation: The AI generates the appropriate CLI command
- Validation: Checks if required tools are installed
- Confirmation: Shows you the command and asks for confirmation
- Execution: Runs the command in your shell
Safety Features
- ✅ Shows you the command before execution
- ✅ Checks if required tools exist on your system
- ✅ Secure API key storage (600 permissions)
- ✅ Confirmation prompts (can be disabled with
-y) - ✅ Dry-run mode for testing
Error Handling
If a required tool is not installed, DoForMe will tell you:
$ doforme "convert video with ffmpeg"
🤔 Thinking about: convert video with ffmpeg
📋 Command: ffmpeg -i input.mp4 output.avi
❌ Error: Required tool 'ffmpeg' is not installed on your system.
Please install it and try again.
Configuration
API key and provider selection are stored in ~/.config/doforme/config.json with secure permissions (600).
To change your API key:
doforme "set the api key to sk-new-key-here"
# This will prompt you to select a provider
Or manually edit ~/.config/doforme/config.json:
{
"api_key": "your-api-key-here",
"provider": "openai"
}
Valid provider values: openai, anthropic, groq, openrouter
Requirements
- Python 3.8 or higher
- API key from one of the supported providers (OpenAI, Anthropic, Groq, or OpenRouter)
- Internet connection (for API calls)
- No external dependencies required!
Privacy & Security
- Your prompts are sent to your chosen LLM provider's API
- API keys are stored locally with restricted permissions (600)
- Commands are shown before execution
- No telemetry or tracking by DoForMe
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details
Troubleshooting
"No API key found"
Make sure you've either:
- Set the appropriate environment variable for your provider (
OPENAI_API_KEY,ANTHROPIC_API_KEY,GROQ_API_KEY, orOPENROUTER_API_KEY) - Run the interactive setup when prompted
"Required tool not installed"
Install the missing tool using your package manager:
# Ubuntu/Debian
sudo apt install <tool-name>
# macOS
brew install <tool-name>
# Fedora
sudo dnf install <tool-name>
Command doesn't work as expected
Use --dry-run to see the generated command and adjust your prompt for better results.
Acknowledgments
- Supports multiple LLM providers: OpenAI, Anthropic, Groq, and OpenRouter
- Inspired by the need to simplify CLI usage
Support
For issues and questions, please open an issue on GitHub.
Metadata
Release files for doforme 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| doforme-0.1.3.tar.gz | 11.4 kB | Without provenance | Details for doforme-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| doforme-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for doforme-0.1.3-py3-none-any.whl |
Total release size: 21.6 kB
Release files / doforme-0.1.3.tar.gz
| Download URL | doforme-0.1.3.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13502e933de89f055e41a823a5f62e32a47fe0d64d68637ce272fcae1420f676
|
|
BLAKE2b-256 checksum How to use checksums |
8794d97f1ab563ddd8232e740199788e742e3d3e765219d4ba916211df069bb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / doforme-0.1.3-py3-none-any.whl
| Download URL | doforme-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
459ea08134b529d20fe09ce3e6b79035e9f3eeeb61214cadb57da910d25db72e
|
|
BLAKE2b-256 checksum How to use checksums |
92d341439eedc884eda06901a82c76e858ef987bd49e955a8f31582a015a1b9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for doforme 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.