Skip to main content

lmbash

Generate bash commands from natural-language requests using an LLM provider. lmbash always shows the generated command first and only runs it after explicit confirmation.

Installation

pipx install lmbash

Or install with pip:

python3 -m pip install lmbash

Requirements

  • Python 3.9 or newer
  • An LLM provider endpoint and model

Providers

lmbash supports these provider protocols:

  • openai-compatible: OpenAI, OpenRouter, LM Studio, Ollama, and compatible chat completions servers.
  • claude-compatible: Anthropic Claude and compatible Messages API servers.

Common base URLs:

  • OpenAI: https://api.openai.com/v1
  • OpenRouter: https://openrouter.ai/api/v1
  • LM Studio: http://localhost:1234/v1
  • Ollama: http://localhost:11434/v1
  • Anthropic: https://api.anthropic.com

Configuration

Run the setup wizard:

lmbash config

Show the saved configuration:

lmbash config --show

Reset the saved configuration:

lmbash config --reset

Configuration is stored at:

~/.config/lmbash/config.json

API keys are stored locally in that file. The config file is written with 0600 permissions where supported, and lmbash config --show masks API keys.

You can override saved configuration with environment variables:

export LMBASH_PROVIDER="openai-compatible"
export LMBASH_BASE_URL="https://openrouter.ai/api/v1"
export LMBASH_API_KEY="your-api-key"
export LMBASH_MODEL="your/model-name"
export LMBASH_PROXY_URL="socks5h://127.0.0.1:7890"

The setup wizard can also save an optional proxy URL. Supported proxy schemes:

  • http://...
  • https://...
  • socks5://...
  • socks5h://...

For SOCKS proxies, socks5h://127.0.0.1:7890 is usually the best choice because DNS resolution also goes through the proxy.

Usage

Pass the request as arguments:

lmbash list files sorted by size

If no config exists, lmbash starts the setup wizard before generating a command.

Or run it without arguments and enter the request interactively:

lmbash

lmbash prints the generated command and asks what to do:

Generated command:
ls -lhS
Action? [y] execute, [e] edit, [N] cancel

Choose:

  • y or yes to execute
  • e or edit to ask for a revised command
  • Enter, n, or anything else to cancel

Override the provider API URL:

lmbash --base-url http://localhost:1234/v1 show current directory

Override the model:

lmbash --model your/model-name show current directory

Safety

lmbash generates shell commands with an LLM. Review every command before executing it. Do not run commands you do not understand, especially commands that delete files, change permissions, install software, or send data over the network.

Development

Run tests:

python3 -m unittest -v

Build distributions:

python3 -m build

Metadata

Release files for lmbash 0.1.0

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

Source distribution (sdist)

Source distribution for lmbash 0.1.0
File Size Uploaded Provenance
lmbash-0.1.0.tar.gz 16.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 26.2 kB

Release files / lmbash-0.1.0.tar.gz

Download URL lmbash-0.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f109b4063dabd014642afa9ef834fcd1108d9c09955c4957a1425282d55224d
BLAKE2b-256 checksum
How to use checksums
dff7f5e8954511660f325bed8934e30dc5e8040256e674698f864c66c4394fa6
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 30, 2026.

Transparency log

Release files / lmbash-0.1.0-py3-none-any.whl

Download URL lmbash-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b9c8410bc06d338a1ae13518c698dcba5775f5f0cee829469aa8123471d8d09
BLAKE2b-256 checksum
How to use checksums
f51167c57f869db2387080a3d3942cec6933b466d34bfd0fc1ed5373af06129a
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 30, 2026.

Transparency log

Security for lmbash 0.1.0

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lmbash-0.1.0.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 30, 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

0.1.0 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