Skip to main content

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.

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 -m or --model
  • model_name: model identifier sent to the Responses API
  • base_url: provider endpoint, defaulting to https://api.openai.com/v1
  • api_key: provider API key
  • project: optional project or folder ID for providers that need it
  • default: optional default model marker
  • params: optional extra fields passed to responses.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.

Metadata

Release files for yogpt 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yogpt 2.0.0
File Size Uploaded Provenance Actions
yogpt-2.0.0.tar.gz 13.6 kB Without provenance Details for yogpt-2.0.0.tar.gz

Release files / yogpt-2.0.0.tar.gz

Download URL yogpt-2.0.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e3181c527130a7205c2d4561ef27bd4438e591b21e72092820764d52a22d6bbf
BLAKE2b-256 checksum
How to use checksums
0c4fad06ec51966e8fff7182e6fce3c44b1eb1803037848fdda3f106999955fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Security for yogpt 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page