Skip to main content

llm-cli-lite

一个轻量的命令行工具,通过自然语言生成终端命令,允许用户查看和修改 JSON 配置文件(如 API 密钥、模型名称等),并通过自然语言查询调用 LLM(如 ollama 或 openai_api)生成命令。

安装

方法一:

pip install llm-cli-lite

方法二:

# 克隆或下载项目仓库:
git clone https://github.com/mr-hanlu/llm-cli-lite.git
cd llm-cli-lite

# (可选)创建并激活虚拟环境:
conda create -n llm-cli-lite python=3.12
conda activate llm-cli-lite

# 安装工具及其依赖:
pip install .

# 这会将 llm-cli 安装为可编辑模式。如果需要开发模式(修改代码无需重新安装)可用:
pip install -e .

将安装的环境添加到系统环境变量,这样可以全局使用:YOU_PATH\llm-cli-lite\Scripts

验证安装:

llm-cli --help

config.json 配置文件保存在路径 ~/.llm-cli-lite/config.json 中

功能特性

显示帮助消息:llm-cli --help

查看配置:使用 llm-cli -l 列出所有配置项。

修改配置:支持设置 API 密钥、模型名称、基础 URL 等,例如 llm-cli --api_key "your-key"。

模型选择:支持 ollama 和 openai_api 模型,通过 -m 参数切换。

自然语言查询:输入自然语言描述(如 llm-cli "列出当前目录文件"),生成相应终端命令。

添加新功能

新命令:在 llm_cli_lite/__main__.py 中添加新的 argparse 命令。

新模型支持:扩展 openai_api_fun.py 或添加新模型接口。

配置字段:在 config.json 中添加新字段并更新命令行参数。

Metadata

Release files for llm-cli-lite 1.0.2

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

Source distribution (sdist)

Source distribution for llm-cli-lite 1.0.2
File Size Uploaded
llm_cli_lite-1.0.2.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-cli-lite 1.0.2
File Interpreter ABI Platform
llm_cli_lite-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / llm_cli_lite-1.0.2.tar.gz

Download URL llm_cli_lite-1.0.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1d25509f20ff275495565290585d97eb604c6d6b6233efb1ac9b98b6b16b47b
BLAKE2b-256 checksum
How to use checksums
b04735c5bcbe2576267afbf5c8a3b6909fd25d8f82713da834a88bbb631c8634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / llm_cli_lite-1.0.2-py3-none-any.whl

Download URL llm_cli_lite-1.0.2-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3361d9239a5e24b03531d4e295f183613dcee2a6b9aa79a9dddfd7b982293dc1
BLAKE2b-256 checksum
How to use checksums
8718a715d294502a74a9f01e6aee96458e5cef3563f7af1e1ec2e99e24a3c04f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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