Skip to main content

🐧 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

Metadata

Release files for lzycli 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lzycli 1.2.1
File Size Uploaded Provenance Actions
lzycli-1.2.1.tar.gz 70.3 kB With provenance Details for lzycli-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lzycli 1.2.1
File Interpreter ABI Platform Actions
lzycli-1.2.1-py3-none-any.whl Python 3 none any Details for lzycli-1.2.1-py3-none-any.whl

Total release size: 80.1 kB

Release files / lzycli-1.2.1.tar.gz

Download URL lzycli-1.2.1.tar.gz
Size 70.3 kB
Tags Source
SHA-256 checksum
How to use checksums
603df4f9031ec51382b46f9adc4835279f6abcb7aab52c918829e68961d03dc6
BLAKE2b-256 checksum
How to use checksums
f7212da427c8aaa0131d96db329e1e74b721573da62a4311d999bbb7fdf5b8eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Release files / lzycli-1.2.1-py3-none-any.whl

Download URL lzycli-1.2.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ac1ff7c3024a25a710f883b0910f1e279acfe5a74d1878ce35894f0579e81cc
BLAKE2b-256 checksum
How to use checksums
d687df0327d1af73d873cef00b803f98ebb5cb3a5c37311526fafaf41077ae19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

Security for lzycli 1.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lzycli-1.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 11, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page