Skip to main content

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

Project description

llm_cli

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

安装

方法一(待实现):

pip install llm-cli

方法二:

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

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

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

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

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

验证安装:

llm-cli --help

功能特性

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

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

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

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

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

添加新功能

新命令:在 llm_cli/__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-0.1.0.tar.gz (3.2 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-0.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_cli_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f46ac9efb6f358f263fa85ae804302ffe4a70ea84b31b60e84ab59c70b77e1a9
MD5 3c234ec84821fd44ad5369d00be40abe
BLAKE2b-256 1968de410c5da32e777b70ae48dc9b32568429b8734480c23af76248d3d17650

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_cli_lite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2739ec32166fa01657407680f4d4a5599df4e51673bc64040a7a5c75ae2f719e
MD5 2140a62b5ecdbd733202f346c2ffdcff
BLAKE2b-256 688fd7134c3457728dcef456bbf09d56c8467b7d1dc037a26083d756d0825905

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