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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_plz-0.1.1.tar.gz.
File metadata
- Download URL: ai_plz-0.1.1.tar.gz
- Upload date:
- Size: 21.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
409b134b9bb6e5b580c975ecbeb63b624cca27dab6c2873dabb26a92080c9b2c
|
|
| MD5 |
52117e54fda7c03447f6b511184b7083
|
|
| BLAKE2b-256 |
5a1a126dd2bcac2a7c9326828171a8430bd827180bcf91cd47ca4c490d3aef08
|
File details
Details for the file ai_plz-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ai_plz-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a663ae8bac6318511edd08a1ea9adfde49a3494d085695f2b93abe95612231d
|
|
| MD5 |
a8b8417e69a9b6e021a0a978d00cc7e8
|
|
| BLAKE2b-256 |
4b44635e24f7f104139a33b1720c97cbc7e61f5b3128db5e8d3ed779179f1588
|