Prerequisites
All commands in this topic call the OpenAI API. The OPENAI_API_KEY environment variable
must be set before running any command.
By default all commands use the gpt-5-nano model. Pass --model to override.
Session History
Every llm command automatically persists conversation history — including the system
prompt — to a shared SQLite database at ~/.pbtk/history.db. Each invocation creates a
new session and stores the full message exchange along with token usage counts.
Sessions are identified by an integer ID that is consistent across all commands, making it possible
to inspect history from chat, translate, ocaaar, and
corpospeak in a single unified view.
Use llm history list to see all sessions and
llm history delete to remove one.
chat
Sends a message to the LLM chat completion API and prints the response. Every invocation is recorded as a session in the history database. Ongoing conversations are resumed by passing the session ID returned from a previous call.
When --session-id is omitted a new session is created. When provided, all prior
messages from that session are loaded and prepended to the API request so the model has full
context. The session ID is always written to stderr after the call — capture it
to continue the conversation later.
translate) can be continued with
chat --session-id since all commands share the same history database.
| Option | Required | Default | Description |
|---|---|---|---|
--message | Yes | — | The user message to send |
--session-id | No | — | Session ID to continue a previous conversation |
--model | No | gpt-5-nano | Model to use |
--reasoning-effort | No | — | Reasoning effort level for o-series models: low, medium, high |
translate
Translates a given text into a specified target language using the LLM. The output is the translated text printed to stdout. Each invocation creates a new history session.
| Option | Required | Default | Description |
|---|---|---|---|
--text | Yes | — | The text to translate |
--target-language | Yes | — | Target language (e.g. Spanish, French, Japanese) |
--model | No | gpt-5-nano | Model to use |
ocaaar
OCR as a Pirate. Sends an image file to the LLM vision API, extracts any text found in the image, and returns it rewritten in pirate speak. Each invocation creates a new history session; the image is recorded as a reference path rather than binary data.
| Option | Required | Default | Description |
|---|---|---|---|
--image-path | Yes | — | Path to the image file to process |
--model | No | gpt-5-nano | Model to use (must support vision) |
corpospeak
Rewrites source text in the communication style appropriate for a chosen enterprise audience, optionally learning from example messages to match an individual's idiolect. Input can be a literal string or a file path. Each invocation creates a new history session.
Audiences
Executive language, strategic framing.
Technical, precise, low jargon.
User-focused, outcome-driven.
Value propositions, persuasive tone.
Brand voice, engaging copy.
Process-oriented, practical.
Metrics-focused, precise numbers.
Formal, risk-aware language.
People-centric, inclusive tone.
Empathetic, supportive language.
When --user-messages is provided, the examples are included in the prompt so the
model can infer and mimic the writer's personal style. Each value can be a literal string or
a path to a file containing example text. Multiple values are accepted.
| Option | Required | Default | Description |
|---|---|---|---|
--source | Yes | — | Source text to rewrite (or file path) |
--audience | Yes | — | Target audience slug (see list above) |
--user-messages | No | — | Example messages to learn idiolect from (text or file paths, repeatable) |
--model | No | gpt-5-nano | Model to use |
history list
Prints a tabular summary of all stored sessions in reverse chronological order, showing the session ID, originating command, creation timestamp, and cumulative token usage.
Example output:
ID Command Created (UTC) Tokens (in/out) -------------------------------------------------------------------- 3 corpospeak 2026-05-28 14:30:00 200/90 2 translate 2026-05-28 11:15:00 80/35 1 chat 2026-05-28 09:00:00 350/120
The database file is at ~/.pbtk/history.db. It is created automatically on first use
and shared by all llm commands.
history delete
Deletes a session and all of its stored messages from the history database. This operation is permanent.
| Option | Required | Default | Description |
|---|---|---|---|
--session-id | Yes | — | ID of the session to delete |
Command Reference
| Command | Required options | Optional options | Output |
|---|---|---|---|
llm chat |
--message |
--session-id --model --reasoning-effort |
Assistant reply to stdout; session ID to stderr |
llm translate |
--text --target-language |
--model |
Translated text to stdout |
llm ocaaar |
--image-path |
--model |
Pirate-speak OCR result to stdout |
llm corpospeak |
--source --audience |
--user-messages --model |
Rewritten text to stdout |
llm history list |
— | — | Session table to stdout |
llm history delete |
--session-id |
— | Confirmation message to stdout |