Skip to main content

ShellGenius

ShellGenius turns task descriptions into shell commands.

ShellGenius demo

Installation

Install with uv (recommended):

uv tool install shellgenius

Or with pip:

python3 -m pip install shellgenius

OpenAI API key

ShellGenius requires an OpenAI API key. Get one from OpenAI's API key page, then store it with:

shellgenius key set

This writes the key to ~/.config/lmt/key.env. To edit it later:

shellgenius key edit

ShellGenius checks OPENAI_API_KEY first, then ~/.config/lmt/key.env.

On Windows, shellgenius key set also works. If you prefer an environment variable:

setx OPENAI_API_KEY your_key

Usage

Describe what you want in plain English:

shellgenius "show the ten largest directories in this repo"
shellgenius "find every .log file changed in the last hour"
shellgenius "rename all .jpeg files in the current dir to .jpg"

In an interactive terminal, ShellGenius shows the response with formatting and asks before execution. In non-interactive output, it prints the generated command:

cmd=$(shellgenius "print the current git branch name")
printf '%s\n' "$cmd"
shellgenius --cmd "show all files changed since origin/main"

Use --raw for plain-text output and --rich to force Rich rendering in a terminal.

Use --cmd when you want only the executable command, even in a TTY.

Options

Flag Effect
-m, --model Model to use (default: gpt-5.4-mini). Run shellgenius models to list options.
--no-stream Disable live Rich streaming.
-r, --raw Print the full response as plain text.
-R, --rich Force Rich formatting in a TTY; fall back to plain text otherwise.
--cmd Print only the command, even in a TTY.
--tokens Print prompt token count and estimated cost, then exit.

Shell Completion

Enable Click's generated completion for flags and explicit subcommand paths:

Bash

eval "$(_SHELLGENIUS_COMPLETE=bash_source shellgenius)"

Zsh

eval "$(_SHELLGENIUS_COMPLETE=zsh_source shellgenius)"

Checked-in scripts

Checked-in completion scripts are also available in completion/_complete_shellgenius.bash and completion/_complete_shellgenius.zsh.

Model Selection

List supported models and their short aliases:

shellgenius models

Use an alias with -m:

shellgenius -m 4.1 "list the ten largest files"
shellgenius -m 5.4-mini "find all TODO comments"

Customizing Colors

ShellGenius reads color settings from ~/.config/lmt/config.json. If the file is missing or unreadable, Rich's built-in defaults are used.

Shared keys

These lmterminal compatibility keys apply across tools:

  • code_block_theme — any Pygments style name, plus the built-in alabaster theme.
  • inline_code_theme — any Rich style string, such as "#325cc0 on #f0f0f0".

ShellGenius-only overrides

Add a shellgenius block to change ShellGenius without affecting other tools:

  • theme — ShellGenius's own preset. Built-in values: default, alabaster. Any Pygments theme name also works for fenced code blocks.
  • styles — override individual Rich semantic styles (markdown.h1, markdown.code, markdown.code_block). markdown.code overrides the top-level inline_code_theme for ShellGenius only; markdown.code_block controls the command-block background in TTY output.

Example:

{
  "code_block_theme": "alabaster",
  "inline_code_theme": "#325cc0 on #f0f0f0",
  "shellgenius": {
    "theme": "alabaster",
    "styles": {
      "markdown.code_block": "on #f0f0f0",
      "markdown.h1": "bold #325cc0"
    }
  }
}

Invalid styles entries are ignored individually, so one bad override does not discard the rest. The built-in alabaster preset keeps the upstream #f8f8f8 syntax background; for a darker command block, add {"markdown.code_block": "on #f0f0f0"} under styles.

These settings affect Rich output only; --raw and --cmd output is unchanged.

License

ShellGenius is released under the Apache 2.0 License.

https://github.com/sderev/shellgenius

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shellgenius-0.2.2.tar.gz (405.8 kB view details)

Uploaded Source

Built Distribution

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

shellgenius-0.2.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file shellgenius-0.2.2.tar.gz.

File metadata

  • Download URL: shellgenius-0.2.2.tar.gz
  • Upload date:
  • Size: 405.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shellgenius-0.2.2.tar.gz
Algorithm Hash digest
SHA256 621f70d7bd1abda60395202ca7d9f1198af693df2fb9ff5061a57ce470044490
MD5 baf4c7501f3793c80783f2c43c31550b
BLAKE2b-256 994d6405553977db2b2f516f21cbc7154685540203abfaa5cace36f313175b99

See more details on using hashes here.

File details

Details for the file shellgenius-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: shellgenius-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for shellgenius-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc26404b6b40701261d90ada5d335c74c791a395eaafafbc4644edb97a8f27a
MD5 7a02fbff6ff30dcc562757e6a335cdc6
BLAKE2b-256 2cc526e318c4a2fa77a85d7d9366e3845ab81259ac04672c2c9b07458f619101

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