Skip to main content

A lightweight command-line tool that generates terminal commands from natural language

Project description

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 中添加新字段并更新命令行参数。

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

llm_cli_lite-1.0.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

llm_cli_lite-1.0.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_cli_lite-1.0.2.tar.gz.

File metadata

  • Download URL: llm_cli_lite-1.0.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_cli_lite-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f1d25509f20ff275495565290585d97eb604c6d6b6233efb1ac9b98b6b16b47b
MD5 f681b6e29ef54a0dc352c111901f8e5b
BLAKE2b-256 b04735c5bcbe2576267afbf5c8a3b6909fd25d8f82713da834a88bbb631c8634

See more details on using hashes here.

File details

Details for the file llm_cli_lite-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: llm_cli_lite-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for llm_cli_lite-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3361d9239a5e24b03531d4e295f183613dcee2a6b9aa79a9dddfd7b982293dc1
MD5 049298a96b1d9fe15b6531766859d142
BLAKE2b-256 8718a715d294502a74a9f01e6aee96458e5cef3563f7af1e1ec2e99e24a3c04f

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