A command-line tool that uses AI to help you generate and execute ImageMagick and FFmpeg commands using natural language instructions. This is an example CLI application with agentic workflow.
- Natural language interface for image and video processing
- Supports both ImageMagick and FFmpeg commands
- Command queue management (add, list, execute)
- Smart command combination and optimization
- Clear, user-friendly output with execution status
- Ensure you have Python 3.8+ installed
- Install required dependencies:
pip install -r requirements.txt- Make sure ImageMagick and FFmpeg are installed on your system:
- For macOS:
brew install imagemagick ffmpeg - For Linux:
apt-get install imagemagick ffmpeg - For Windows: Download from respective websites
- For macOS:
Run the tool:
python medit.pyAvailable commands:
- Type your instructions in natural language
- Use
listto show current command queue - Use
runto execute commands - Type
exitto quit
Welcome to medit!
Enter your instructions in natural language. Type 'exit' to quit.
Commands: 'list' to show commands, 'run' to execute them, 'exit' to quit.
> take snow.jpeg and make it into a pencil sketch named sketch.jpg
Added ImageMagick command: magick snow.jpeg -colorspace Gray -sketch 0x20+1.0+0.0 sketch.jpg
> convert sketch.jpg to sketch.png
Added ImageMagick command: magick sketch.jpg sketch.png
> change the width of sketch.png to 800px
Added ImageMagick command: magick sketch.png -resize 800x sketch_resized.png
> run it
Combining commands...
Current commands:
1. magick snow.jpeg -colorspace Gray -sketch 0x20+1.0+0.0 sketch.jpg
2. magick sketch.jpg sketch.png
3. magick sketch.png -resize 800x sketch_resized.png
Combined commands:
1. magick snow.jpeg -colorspace Gray -sketch 0x20+1.0+0.0 -resize 800x sketch_resized.png
Executing commands...
Executing: magick snow.jpeg -colorspace Gray -sketch 0x20+1.0+0.0 -resize 800x sketch_resized.png
✓
All commands executed successfully
>- Format conversion
- Resize images
- Adjust brightness/contrast
- Apply filters and effects
- Crop and rotate
- And more...
- Video format conversion
- Extract frames from video
- Combine frames into video
- Adjust video properties
- And more...
The application uses multiple AI agents to process and execute commands:
- Routing Agent: Analyzes instructions and routes to appropriate agents
- ImageMagick Agent: Generates ImageMagick commands
- FFmpeg Agent: Generates FFmpeg commands
- Combining Agent: Optimizes and sequences commands
- Executing Agent: Safely executes commands with status feedback