Skip to main content

A simple command-line helper powered by LLM.

Project description

ai_plz

A simple command-line helper powered by LLM.

Introduction

ai_plz is a minimalist command-line helper that sends your need to LLM, asks for a shell command, and executes it if permitted. This helper is designed to be a one-time command generator, not a full AI agent. The command-line entrypoint of this package is "plz" (short for "please").

Usage

# Install
$ uv tool install ai_plz  # or: pipx install ai_plz

# Get help
$ plz --help
Usage: plz [OPTIONS] [USER_INPUT]...

  A simple command-line helper powered by LLM.

Options:
  -e, --env FILE            Path to optional env file
  -y, --run / -n, --no-run  Enable/Disable automatic execution
  -p, --prompt [en|zh]      Select prompt
  -z, --zh                  Shortcut for --prompt=zh
  --show-vars               Show environment vars
  --show-prompt             Show prompt
  --debug                   Enable debug logging
  -h, --help                Show this message and exit

# Example (User inputs will be concatenated by spaces)
$ plz Clear conda cache
Clear the conda cache to free up disk space and remove outdated packages.
>>> conda clean --all
Run the above command? [y/n]:

Configuration

Model settings should be provided through environment variables, which can be listed by plz --show-vars. Usually, you need to specify your own LLM provider through AI_PLZ_API_KEY, AI_PLZ_BASE_URL, and AI_PLZ_MODEL.

Variable name Type Description
AI_PLZ_API_KEY SecretStr LLM API key (Required)
AI_PLZ_BASE_URL str | None Base URL to LLM API
AI_PLZ_MODEL str The LLM model name (Required)
AI_PLZ_MAX_RETRIES int Max retries
AI_PLZ_AUTO_RUN bool | None Automatic execution (None for manual confirmation)

Caveats

When permitted, the command provided by LLM will be executed in a shell subprocess. It is recommended to check the command before execution, so a confirmation is required by default, as shown in the example usage above. You can pass the -y option to skip confirmation and take your own risk. You can also pass -n to skip execution without ask.

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

ai_plz-0.1.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

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

ai_plz-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file ai_plz-0.1.0.tar.gz.

File metadata

  • Download URL: ai_plz-0.1.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.17

File hashes

Hashes for ai_plz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aff89fbf2f692d7740421466ac2bac798c3df4665a97443f693a3cc130d4c3bf
MD5 ab340a21100fbb4b1feeff327a3b67ba
BLAKE2b-256 2d468b2f5e1f3cee14f19b362e3e935b383f3ca84915fbaed62e717824380ccb

See more details on using hashes here.

File details

Details for the file ai_plz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ai_plz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.17

File hashes

Hashes for ai_plz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a944c4ac277322f39b2726396c1102de1e9d51cb45aa153f07fe7aab70fc0a00
MD5 6cac1009dae191f5d7bc550402131192
BLAKE2b-256 79a4a010a89d64c64e3cc1c0b5835410ad22b47ef93c8bd465cf0b61b6fc285c

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