Skip to main content

Ollama-like CLI tool for openrouter

Reason this release was yanked:

unsupported

Project description

openrouter-cli

An Ollama-like CLI tool for OpenRouter that provides simple command-line access to various AI models.

Shows a sample command for openrouter-cli.

Features

  • Interactive chat interface with AI models
  • Responses are styled for maximum readability
  • List available OpenRouter models with context sizes and pricing
  • Support for stdin input, useful for scripting
  • Allows for system prompts, temperature, and more.
  • Persistent local history over sessions

Installation

Install via pip:

pip install openrouter-cli

Configuration

Before using the CLI, you'll need to configure your OpenRouter API key:

openrouter-cli configure

Your API key will be stored at ~/.openrouter-cli/.config.

Usage

List Available Models

openrouter-cli models [--raw]

Lists all available models in a human-readable format.

Example output:

...

- mistralai/mistral-medium-3                            @ 128.0K context   (07-05-2025) [ In: $0.400/1M   Out: $2.000/1M  ]
- google/gemini-2.5-pro-preview                         @ 1.0M context     (07-05-2025) [ In: $1.250/1M   Out: $10.000/1M ]
- arcee-ai/caller-large                                 @ 32.0K context    (06-05-2025) [ In: $0.550/1M   Out: $0.850/1M  ]

...

Chat with a Model

openrouter-cli run [model] [--temperature TEMPERATURE] [--seed SEED] [--effort {high,medium,low}] [--system SYSTEM] [--no-thinking-stdout] [--pretty] [--raw]

Starts an interactive chat session with the specified model. Responses are properly styled and formatted for optimal readability in the terminal.

Example interaction:

>>> Write me an python hello world, and explain the code.
Python Hello World Code                                                                                                                                                                                               

print("Hello, World!")                                                                                                                                                                                               

Explanation                                                                                                                                                                                                           

This simple two-line code performs the following:                                                                                                                                                                     

1 print() function: This is a built-in Python function used to display output (text or data) to the console or standard output.                                                                                      
2 "Hello, World!": This is a string literal. Strings in Python are sequences of characters enclosed in single quotes (') or double quotes ("). In this case, the string "Hello, World!" is the data that will be     
displayed.                                                                                                                                                                                                         

When you run this Python code, the print() function takes the string "Hello, World!" as an argument and outputs it to the console, resulting in the display:                                                          

Hello, World!                                                                                                                                                                                                        

This is the basic way to write and run a "Hello, World!" program in Python. It demonstrates the fundamental concept of using the print() function to display output, which is essential for debugging, user           
interaction, and displaying results in Python programs.                                                                                                                                                               
>>>

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

openrouter_cli-0.1.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

openrouter_cli-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openrouter_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for openrouter_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 337fb87c5303790cc696b9b06c2b834fb1f6e2c8639b423cc36be27c90a44c70
MD5 e814dea4d46b293467fee71068035db3
BLAKE2b-256 46d7d053bcbd71221b0e8cdcccf195c0368b29f5e824bc72f7ea9c65cb38f07a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openrouter_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77a8a5b7b26ae93ce469a5653be8084837f83e0fcea9782da402fceafb731495
MD5 dc96b46828bc668b0f6beeff33f6d68d
BLAKE2b-256 b7346dade7508bd2b38e01d3b3773f58b4f110e016cee1f6c725698ed7dc6981

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