Skip to content

sxhxliang/llm-env-cli

Repository files navigation

llm-cli

A command-line tool for managing LLM (Large Language Model) provider configurations.

Features

  • Store API keys and base URLs for multiple LLM providers
  • Interactive commands for adding, updating, and removing providers
  • Validation of provider configurations
  • Environment variable setup for easy integration with other tools
  • Copy environment variables to clipboard

Installation

npm install -g llm-cli

Usage

List Providers

llm-cli list
# or
llm-cli ls

Add a Provider

llm-cli add

Update a Provider

llm-cli update <provider-name>

Remove a Provider

llm-cli remove <provider-name>
# or
llm-cli rm <provider-name>

Check Provider Validity

llm-cli check [provider-name]

Auto-remove Invalid Providers

llm-cli autoremove

Set Environment Variables

llm-cli set-env

Copy Environment Variables to Clipboard

llm-cli copy-env <provider-name>

Configuration

Configurations are stored in ~/.llm-cli/config.json in the following format:

{
  "Providers": [
    {
      "name": "openrouter",
      "api_base_url": "https://openrouter.ai/api/v1",
      "api_key": "sk-or-v1-xxx-example-key-xxx",
      "models": [
        "google/gemini-flash-1.5",
        "anthropic/claude-3.5-sonnet"
      ],
      "transformer": {
        "use": ["openrouter"]
      }
    }
  ]
}

Supported Providers

The tool works with any OpenAI-compatible API, including:

  • OpenAI
  • Azure OpenAI
  • OpenRouter
  • DeepSeek
  • Gemini
  • Ollama
  • And many more

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors