A CLI tool for prompting an LLM
Project description
cli_lm
Switch context less by using a really cheap LLM at the command line.
Installation
# Install from source
git clone https://github.com/davenpi/cli_lm.git
cd cli_lm
pip install -e .
# Install from PyPI
pip install cli-lm
Quick Start
The first run will prompt for your
Open AI API key.
Just paste the key in. Or create the key directly in ~/.cli_lm/.env with
echo "OPENAI_API_KEY=your_new_key" > ~/.cli_lm/.env
Note you'll have to pay Open AI to get an API key and start using their models.
For now this package sets gpt-4o-mini as the model of choice. It costs 0.15¢/0.60¢
per 1 million input/output tokens. 1 token ~ 1 word.
# Directly ask a question
clm "How do I amend a commit in git?"
# Interactive mode (input in python interpreter)
clm
> How do I list the processes listening on a given port?
Chat is assumed to be multiturn (i.e., you'll always be asked for your next prompt).
Just hit Ctrl+c or Ctrl+d to exit.
Configuration
The package looks for your Open AI API key in ~/.cli_lm/.env.
To quickly update your API key run:
echo "OPENAI_API_KEY=your_new_key" > ~/.cli_lm/.env
It works on a Mac, but it hasn't been tested on another system.
Ongoing Improvements
- Multi turn chat capability
- Improved multiline input
- Would be nice to arrow backward on input
- System prompting for really concise, helpful answers
- Make set up easier
- Add token/cost accounting
- Make it faster (imports can be slow)
- Add color
License
MIT
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 cli_lm-0.1.6.tar.gz.
File metadata
- Download URL: cli_lm-0.1.6.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1130a829d9dd3ad1604626c221b7a18ecce190ed6000f98b32a2af79e8a8c66
|
|
| MD5 |
5e9f2e3b6563a1512a4f70eb5a25bca5
|
|
| BLAKE2b-256 |
e45268a1de90dc2ee8b7a3d5c1d600f52f3c641d16be9b9cca71f939044c4d9d
|
File details
Details for the file cli_lm-0.1.6-py3-none-any.whl.
File metadata
- Download URL: cli_lm-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b871f5e30e4eb2abe27732b75af794e4c5349fc08524fbb61154b71cf58d0a91
|
|
| MD5 |
3a1ed38441de9598bff79e330b409538
|
|
| BLAKE2b-256 |
ab0924b02a98c69aa5b8a7aba70da7252cb3097bce5ebadf52bd178f2d493a00
|