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.
Metadata
Release files for qork 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qork-0.1.0.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qork-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / qork-0.1.0.tar.gz
| Download URL | qork-0.1.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c498097a9ef571fc0a84d39682edfc0c050c9eb21c7f4908eb0def1d71387a70
|
|
BLAKE2b-256 checksum How to use checksums |
9ca5b4bd303fa295da0e9ba139892b404f0c375adb5ea2ea179e2b397ebd625a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / qork-0.1.0-py3-none-any.whl
| Download URL | qork-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
135ba81ae9f1f328f5e92f12b08c80d8d8be711e1b414cacfc549dcf636c1552
|
|
BLAKE2b-256 checksum How to use checksums |
b30b09d65fb1bae0196bcdcab9979f7e8f8d6439b0c8f08805cf951399396ba7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|