Skip to main content

Translate natural language commands into Linux bash commands.

Project description

๐Ÿง Lzy โ€“ Natural Language to Bash CLI

Lzy is a command-line tool that uses AI to translate natural language into Linux bash commands, explains what the command does, and lets you choose whether to run, edit, or abort the execution.


โœจ Features

  • ๐Ÿ” Translates natural language into valid Bash commands.
  • ๐Ÿ“˜ Explains each command in natural language.
  • ๐Ÿ› ๏ธ Lets you review or edit the command before execution.
  • ๐Ÿ” Works with multiple AI providers.
  • ๐ŸŽจ Fancy terminal output with rich.

๐ŸŽฅ Demo

Watch the demo

Click the image above or watch on YouTube.


๐Ÿš€ Installation

pip install lzy

๐Ÿ”ง Environment Variables

Lzy uses environment variables to configure the AI provider and its corresponding API key.

Required

Variable Description
CLI_PROVIDER Which provider to use: gemini, openai, together,...
*_API_KEY The API key for the chosen provider (see below)

Supported Providers

CLI_PROVIDER Required Variable
gemini GEMINI_API_KEY
openai OPENAI_API_KEY
together TOGETHER_API_KEY
nvidia NVIDIA_API_KEY
anthropic ANTHROPIC_API_KEY
groq GROQ_API_KEY
mistral MISTRAL_API_KEY

Optional

Variable Description
.env file You can use a .env file to load variables automatically (via python-dotenv)

Example .env file:

CLI_PROVIDER=gemini
GEMINI_API_KEY=your_google_api_key_here

๐Ÿงช Usage

lzy "find all PDF files in the current directory"

Youโ€™ll get a result like this:

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Command                             โ”ƒ Description                                  โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ find . -name '*.pdf'                โ”‚ Searches for all PDF files in the current    โ”‚
โ”‚                                     โ”‚ directory and its subdirectories.            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Then you're prompted to choose:

  • y: run the command
  • e: edit it first
  • n: cancel

๐Ÿงฉ Dev Tip

You can also run directly via Python for debugging:

python lzy/cli.py "delete all .DS_Store files in this folder"

๐Ÿ“œ License

MIT License

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

lzycli-1.0.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lzycli-1.0.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file lzycli-1.0.0.tar.gz.

File metadata

  • Download URL: lzycli-1.0.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for lzycli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 425f77ae82bd449a1edf070e250174fa56945a06c459650a86e0c18f611d072b
MD5 409f91c3bf2829ce5f3ee60e4623d7bb
BLAKE2b-256 9fa7898961f65932f72869852cb1f5bd0b874dd0bd8f0977f9d403937ccedeb0

See more details on using hashes here.

File details

Details for the file lzycli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lzycli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for lzycli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 185fc9d30b45426998515f4e22880804e6cd54d2e8cbcb4761d007dd3b7218ba
MD5 99c44b8820fdef09a8e7faf7101bd86f
BLAKE2b-256 fe6321a5308874a8872ed6a8b1f198af9b1375688fb0abc3cd45cd35251685a6

See more details on using hashes here.

Supported by

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