Command-line interface for GPT-like LLMs
Project description
yogpt: Command-Line GPT Utility
yogpt is a small command-line utility for simple LLM calls from the shell.
It uses the OpenAI-compatible Responses API, so the same command can work with
OpenAI, Yandex AI Studio, or another provider that follows the same API shape.
pip install yogpt
After installation:
yogpt Hello, how are you today?
Common usage
Ask a question directly:
yogpt What is the 10th digit of Pi?
Pipe stdin into the model:
echo What is the 10th digit of Pi? | yogpt -
If yogpt sees piped stdin and no explicit query, it reads stdin automatically:
cat notes.txt | yogpt -p summarize
Read input from a file with @filename:
yogpt @program.py
Start an interactive chat:
yogpt
Continue chatting after an initial prompt:
yogpt -s "You are a software expert. Read this Python program and answer follow-up questions." -c @program.py
Select a configured model:
yogpt -m qwen Explain why sky is blue
Set temperature:
yogpt -t 0.2 Write a short commit message for this change
Templates
Use an inline template. The {} placeholder is replaced with the input:
cat program.py | yogpt -p "Please explain what the following Python code does:{}"
Use a named template from .yogpt.config.json:
cat english.txt | yogpt -p translate -1 German -
Templates can use {param_1}, {param_2}, and {param_3}, supplied by -1,
-2, and -3.
You can also load a template from a file:
yogpt -p @prompt.txt @input.txt
System messages
Use a system message directly:
yogpt -s "You are a concise technical assistant." Explain DNS
Use a named system message from the config:
yogpt -s expert @proposal.md
Use a system message from a file:
yogpt -s @system.txt @input.txt
Images
Attach one or more image files with --image:
yogpt --image screenshot.png "Describe what is wrong in this UI"
yogpt --image before.png --image after.png "Compare these two images"
Images are sent as Responses API input_image items using base64 data URLs.
Web search
Enable the Responses API web search tool:
yogpt --web "What changed in Python recently?"
Control search context size:
yogpt --web --web-detail low "Give a short current answer"
yogpt --web --web-detail hi "Give a detailed current answer with context"
--web-detail med is the default and maps to the API value medium.
Code Interpreter
Enable Code Interpreter with --code:
yogpt --code "Create a CSV with the numbers 1 to 10 and their squares"
If the model creates files, yogpt downloads them into the current directory.
Use --output-dir to choose another location:
yogpt --code --output-dir outputs "Create a line chart as a PNG"
Generated files are discovered from Code Interpreter output and file citation
annotations. yogpt first uses the OpenAI client container file APIs and then
falls back to the regular Files API when needed.
Streaming
By default, yogpt waits for the full response and prints it at once. Use
--stream to display text as it is generated:
yogpt --stream "Write a short story about a command-line tool"
Configuration
Configuration is read from ~/.yogpt.config.json. For tests or temporary
setups, set YOGPT_CONFIG to another JSON file path.
A minimal model entry looks like this:
{
"name": "gpt",
"model_name": "gpt-5.5",
"base_url": "https://api.openai.com/v1",
"api_key": "%OPENAI_API_KEY%",
"default": true,
"params": {
"reasoning": { "effort": "none" }
}
}
Fields:
name: short model name used with-mor--modelmodel_name: model identifier sent to the Responses APIbase_url: provider endpoint, defaulting tohttps://api.openai.com/v1api_key: provider API keyproject: optional project or folder ID for providers that need itdefault: optional default model markerparams: optional extra fields passed toresponses.create
Environment variables can be used anywhere in the config with %NAME% syntax.
For example, Yandex AI Studio model names usually include the folder ID:
{
"name": "qwen",
"model_name": "gpt://%folder_id%/qwen3.5-35b-a3b-fp8",
"base_url": "https://ai.api.cloud.yandex.net/v1",
"api_key": "%api_key%",
"project": "%folder_id%"
}
See sample_config.json for a fuller starting point with OpenAI and Yandex AI
Studio models, templates, and system messages.
Config sections
Models
The models array defines available command-line model aliases:
"models": [
{
"name": "gpt",
"model_name": "gpt-5.5",
"base_url": "https://api.openai.com/v1",
"api_key": "%OPENAI_API_KEY%",
"default": true
}
]
Templates
The templates array defines reusable prompt templates:
{
"name": "translate",
"template": "Please, translate the text in triple backquotes below into the following language: {param_1}. Here is the text:\n```{}```"
}
If a template name is not found and the value has no spaces or {} placeholder,
yogpt prints a warning and treats it as a literal template.
System messages
The system_messages array defines reusable model instructions:
{
"name": "expert",
"message": "You are a careful technical expert. Give precise, practical answers and call out assumptions."
}
If a system message name is not found and the value has no spaces, yogpt
prints a warning and treats it as a literal system message.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file yogpt-2.0.0.tar.gz.
File metadata
- Download URL: yogpt-2.0.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3181c527130a7205c2d4561ef27bd4438e591b21e72092820764d52a22d6bbf
|
|
| MD5 |
ec81002871f1217d65d6cd6cacc4fbe8
|
|
| BLAKE2b-256 |
0c4fad06ec51966e8fff7182e6fce3c44b1eb1803037848fdda3f106999955fb
|