Skip to main content

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

Metadata

Release files for cli-lm 0.1.6

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

Source distribution (sdist)

Source distribution for cli-lm 0.1.6
File Size Uploaded Provenance
cli_lm-0.1.6.tar.gz 5.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cli-lm 0.1.6
File Interpreter ABI Platform
cli_lm-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / cli_lm-0.1.6.tar.gz

Download URL cli_lm-0.1.6.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a1130a829d9dd3ad1604626c221b7a18ecce190ed6000f98b32a2af79e8a8c66
BLAKE2b-256 checksum
How to use checksums
e45268a1de90dc2ee8b7a3d5c1d600f52f3c641d16be9b9cca71f939044c4d9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release files / cli_lm-0.1.6-py3-none-any.whl

Download URL cli_lm-0.1.6-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b871f5e30e4eb2abe27732b75af794e4c5349fc08524fbb61154b71cf58d0a91
BLAKE2b-256 checksum
How to use checksums
ab0924b02a98c69aa5b8a7aba70da7252cb3097bce5ebadf52bd178f2d493a00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Security for cli-lm 0.1.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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