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, including local Ollama models.
  • ๐Ÿง™ First-run interactive setup wizard โ€” no env vars required.
  • ๐ŸŽจ Fancy terminal output with rich.

๐ŸŽฅ Demo

Watch the demo

Click the image above or watch on YouTube.


๐Ÿš€ Installation

pip install lzycli

๐Ÿ”ง Configuration

The first time you run lzy, an interactive wizard will guide you through:

  1. Choosing an AI provider.
  2. Entering your API key (typed characters are masked with * for shoulder-surfing safety).
  3. For Ollama, picking the host (default http://localhost:11434) and selecting one of the locally installed models โ€” no API key needed.

Your selection is saved to ~/.lzy/config.json (chmod 600 on Unix) and used on every subsequent run.

To reconfigure at any time:

lzy --setup

Example ~/.lzy/config.json

For a cloud provider (API key based):

{
  "provider": "openai",
  "api_key": "sk-your-api-key-here"
}

For Ollama (local, no API key):

{
  "provider": "ollama",
  "host": "http://localhost:11434",
  "model": "llama3.2"
}

Supported Providers

Provider Type
openai API key
anthropic API key
gemini API key
groq API key
mistral API key
together API key
nvidia API key
ollama local (no API key)

Ollama: make sure ollama serve is running and you have pulled at least one model (e.g. ollama pull llama3.2) before running the setup.


๐Ÿงช Usage

lzy find all PDF files in the current directory

If no provider is configured yet, the setup wizard runs automatically.

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

๐Ÿ“ฆ Publishing

This repository is configured to publish distributions through GitHub Actions using PyPI Trusted Publishing.

One-time setup

  1. Create the GitHub environments testpypi and pypi in the repository settings.
  2. Require manual approval for the pypi environment.
  3. In TestPyPI, add a trusted publisher with:
  • Owner: ricardoborges
  • Repository: lzy-cli
  • Workflow file: publish-to-pypi.yml
  • Environment: testpypi
  • Project name: lzycli
  1. In PyPI, add the same trusted publisher, but use environment pypi.

Release flow

  • Package versions now come from Git tags via setuptools-scm.
  • Create and push the release tag you want to publish, such as v1.0.1.
  • Pushes to main publish the current build to TestPyPI.
  • Tags matching v* publish the tagged build to PyPI.

If this repository does not yet have a Git tag for the already published 1.0.0 release, create one on the matching commit before relying on automatic versioning. Otherwise, setuptools-scm will derive a development version from repository history instead.

Example release:

git tag v1.0.1
git push origin main --tags

๐Ÿ“œ 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.2.1.tar.gz (70.3 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.2.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lzycli-1.2.1.tar.gz
  • Upload date:
  • Size: 70.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lzycli-1.2.1.tar.gz
Algorithm Hash digest
SHA256 603df4f9031ec51382b46f9adc4835279f6abcb7aab52c918829e68961d03dc6
MD5 bbc915708ee92681d5ee72144888eea2
BLAKE2b-256 f7212da427c8aaa0131d96db329e1e74b721573da62a4311d999bbb7fdf5b8eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for lzycli-1.2.1.tar.gz:

Publisher: publish-to-pypi.yml on ricardoborges/lzy-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: lzycli-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lzycli-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac1ff7c3024a25a710f883b0910f1e279acfe5a74d1878ce35894f0579e81cc
MD5 eaa95d6dd8d03c30715b12083fa1d378
BLAKE2b-256 d687df0327d1af73d873cef00b803f98ebb5cb3a5c37311526fafaf41077ae19

See more details on using hashes here.

Provenance

The following attestation bundles were made for lzycli-1.2.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on ricardoborges/lzy-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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