A simple CLI for interacting with OpenAI models.
Project description
qork
A simple, beautiful CLI for asking LLMs questions from your terminal. Fast defaults, clean output, and optional conversational threading.
Highlights
- Backend: OpenAI Responses API
- Optional streaming output (
--stream) - Optional global thread mode (
--thread) that stores a singleprevious_response_id - Plaintext or pretty Rich output
Install
pip install qork
Prerequisites
- Environment:
OPENAI_API_KEYmust be set - Models: you can pass
-m/--modelat call time; otherwise defaults apply (see below)
Quick start
- Default (Responses API, non-streaming):
qork "Say hello in one short sentence."
- Responses API with explicit model:
qork -m gpt-5-mini "Give me a five-word poem."
- Presets:
qork --profile nano "Explain this in one sentence."
qork --profile high "Think carefully and give the best answer."
- Streaming:
qork --stream "List 3 colors."
- Plaintext output (easier to copy/paste):
qork -pt "Plain output please."
- Debug info (tokens/cost where available):
qork -d "How many seconds in a day?"
Backends and defaults
- Responses API (only backend)
- Non‑streaming by default; use
--streamto enable streaming - Default model if not specified:
QORK_MODELorgpt-5-mini
- Non‑streaming by default; use
Thread mode (simple and explicit)
qork can optionally reuse a single global previous_response_id to continue one thread across invocations.
- Enable with
-t/--thread - State file lives at:
~/.qork/history/session.id - This is global and will clobber across shells (intentionally simple)
- To reset: delete
~/.qork/history/session.id
CLI flags
-m, --modelSet model name--profilePreset:nano|mini|large|high(high setsreasoning.effort=high)--stream/--no-streamStream output tokens-t, --threadContinue a single global thread (storesprevious_response_id)-pt, --plaintextPlain stdout (no rich panels/markdown)-d, --debugShow token usage/cost when available
Python API
Call from notebooks and scripts using the same behavior as the CLI.
from qork.ask import ask
# Responses API (non-streaming)
text = ask("One short sentence.", stream=False, plaintext=True, return_text=True)
# Responses API (streaming)
text = ask("Print three facts.", stream=True, plaintext=True, return_text=True)
Parameters you’ll likely use:
prompt: str(required)model: Optional[str]stream: boolplaintext: bool(stdout formatting)debug: bool(token/cost info)previous_response_id: Optional[str](continue a thread)return_text: bool(return text value in addition to printing)
Examples
- Continue a single global thread:
qork -t "Start a thread in one sentence."
qork -t "Continue in one sentence."
Tests (end‑to‑end)
These tests hit live APIs (no mocks). Set your key first.
export OPENAI_API_KEY=sk-...
pytest -q tests/test_e2e_cli.py::test_cli_responses_session_persistence
pytest -q tests/test_e2e_cli.py::test_cli_plaintext_non_stream
pytest -q tests/test_e2e_cli.py::test_cli_plaintext_stream
pytest -q tests/test_e2e_python_api.py
You can select a model for tests with QORK_E2E_MODEL or rely on defaults.
Troubleshooting
- “API key not set”: ensure
OPENAI_API_KEYis exported in your shell - No thread carry‑over: ensure you used
-t/--thread; check~/.qork/history/session.id(delete it to reset) - Streaming: use
--streamif you prefer incremental output
Designed for fast, accurate answers from the terminal with minimal ceremony.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qork-0.1.0.tar.gz.
File metadata
- Download URL: qork-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c498097a9ef571fc0a84d39682edfc0c050c9eb21c7f4908eb0def1d71387a70
|
|
| MD5 |
4a5ebf173e95c50cfb23e32c712af753
|
|
| BLAKE2b-256 |
9ca5b4bd303fa295da0e9ba139892b404f0c375adb5ea2ea179e2b397ebd625a
|
File details
Details for the file qork-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qork-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
135ba81ae9f1f328f5e92f12b08c80d8d8be711e1b414cacfc549dcf636c1552
|
|
| MD5 |
244034d025a2ef6b1432966ffed64664
|
|
| BLAKE2b-256 |
b30b09d65fb1bae0196bcdcab9979f7e8f8d6439b0c8f08805cf951399396ba7
|