LLM4Free CLI Reference

June 18, 2026 ยท View on GitHub

Last updated: 2025-12-20 Source of truth: llm4free/cli.py

The LLM4Free CLI provides a unified interface for multiple search engines. All commands now support an --engine (or -e) option to switch between providers, with DuckDuckGo (ddg) as the default.

๐Ÿงญ Getting Started

# List all available commands
llm4free --help

# Show CLI version
llm4free version

# Run a simple search
llm4free text -k "python programming"

The CLI uses Rich for beautiful, formatted table outputs and informative panels.

๐Ÿ” Core Commands

CommandDescriptionSupported Engines
textGeneral web searchddg, bing, yahoo, brave, mojeek, wikipedia
imagesImage searchddg, bing, yahoo
videosVideo searchddg, yahoo
newsNews searchddg, bing, yahoo
weatherWeather informationddg, yahoo
answersInstant answersddg, yahoo
suggestionsQuery autocompleteddg, bing, yahoo
translateText translationddg, yahoo
mapsPOI / Location searchddg, yahoo
searchShortcut for textUse as a general unified command

Common Options

-k, --keywords      (required) Search query or keywords
-e, --engine        Search engine to use (default: ddg)
-m, --max-results   Maximum number of results to display (default: 10)
-r, --region        Region code (e.g., us, uk, wt-wt)
-s, --safesearch    on / moderate / off (default: moderate)
-t, --timelimit     Time filter (d, w, m, y)

๐ŸŒฆ๏ธ Weather & Info

The weather command provides a current conditions panel and a 5-day forecast.

llm4free weather -l "London" -e yahoo

๐Ÿงช Usage Examples

# Default (DuckDuckGo)
llm4free text -k "fastapi tutorial"

# Using Brave Search
llm4free text -k "fastapi tutorial" -e brave

# Using Wikipedia
llm4free text -k "Quantum Physics" -e wikipedia
# Find images on Bing
llm4free images -k "cyberpunk art" -e bing

# Find news on Yahoo
llm4free news -k "space exploration" -e yahoo

3. Utility Commands

# Translate text via Yahoo
llm4free translate -k "Hola mundo" --to en -e yahoo

# Get suggestions from DuckDuckGo
llm4free suggestions -q "artificial i" -e ddg

๐Ÿ› ๏ธ Advanced Options

Certain commands have specific extras:

  • Maps: --place and --radius are supported for refinement.
  • Translate: --from (optional) and --to (default: en).