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-lite

方法二:

# 克隆或下载项目仓库:
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.1.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.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llm_cli_lite-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2f40a3ff4346e684cd33fe8afbfb1cb33085a77de4312066e8d894d922f18439
MD5 532b05ef2cbd72a188323cb7ecad330c
BLAKE2b-256 7e86a0452007ca9a28cac8cbdc94802bd50effdeac6ecdfd028b8d695a0bc8da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llm_cli_lite-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.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-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0988a03595809d675692797eb60b8826c25ec0ad65074c4d68d6d972541ea9cb
MD5 402a03b7868964d0f3c80c63981dd156
BLAKE2b-256 176b6e5f8fa6df29bc3e2da31b57d9c0f6a5cc0b80a3bea9af01b95a1609e198

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