A SQL client with Codex built in
By Tanin Na Nakorn · Updated
Codex writes good SQL. In a terminal, though, the answer comes back as text: a handful of rows, a summary, a number you have to trust. And to reach your databases, it needs connection strings and a client to shell out to.
Superintendent gives Codex a workspace you share. Your databases are already connected, your CSVs are already imported, and every query it runs opens as a tab on your screen.
Set up
- Download Superintendent and open it.
- Open the agent panel and pick Codex.
-
If the Codex CLI is already installed and signed in,
you're done. If not, Superintendent installs it and walks you through
codex login.
There's no API key to paste. Codex runs under your own account and plan, and the panel shows how much of your session and weekly limits you've used.
Pick the model and effort
The agent panel lists the models your Codex account offers. Pick one, set its reasoning effort (more for a tricky reconciliation, less for a quick lookup), and turn on fast mode for models that support it.
What you can ask
Codex works through the same workspace you do. It can:
- Import a CSV file into the workspace.
- List your saved databases, their tables, and columns.
- Write and run SQL in the workspace or on a database, in that database's dialect.
- Download a database table or query result into the workspace, so it can be joined with other sources.
- Open query and result tabs, sort and filter results, and highlight the rows it's talking about.
So you can hand it whole tasks:
- "Import
refunds.csvand find the refunds that don't match an order in MySQL." - "Which SQL Server table has the invoices? Show me the unpaid ones over 90 days old."
- "Compare this week's Snowflake revenue with the targets in
targets.csv." - "This column has phone numbers in five formats. Write a query that normalizes them."
Safe by default
Codex runs in a read-only sandbox in its own folder, away from your projects, and every query it sends to a database runs read-only. When a task needs to change data, Codex opens a query tab with the SQL, and you read it and press Run yourself.
Check the work
Every query Codex runs shows up as a tab, and every result opens in the grid. Scroll through all of it, sort, filter, and read the SQL it wrote. If something looks wrong, tell it, or fix the query yourself and keep going.
Privacy
Superintendent runs your queries on your computer. Whatever Codex reads (table schemas, query results) goes to OpenAI under your account, as it would in a terminal. Codex sees each database's host, port, and name, but never its password, token, or key. If you don't use the agent, nothing leaves your machine.
Prefer Codex in your terminal?
Connect the Codex CLI you already use to Superintendent through the
built-in MCP server: add a few lines to ~/.codex/config.toml
and Codex can use your workspace from any terminal. Using Claude Code instead? See the
Claude Code SQL client.
Questions
Do I need an OpenAI API key?
No. Superintendent runs the Codex CLI on your computer, signed in with your own account, such as your ChatGPT plan. Usage counts against that account as usual.
What if Codex isn't installed?
Superintendent can install the Codex CLI for you with npm and run codex login, right from the agent panel. You can also log out there.
Can I pick the model and reasoning effort?
Yes. The agent panel lists the models your Codex account offers, with the reasoning efforts each one supports, and a fast mode where the model has one.
Can Codex change my files or my data?
No. Codex runs in a read-only sandbox in its own folder, and its database queries run read-only. To change data, it opens a query tab with the SQL for you to review and run.
What does Codex see?
What it asks for through Superintendent's tools: table names, columns, and the rows its queries return. That goes to OpenAI under your account. It sees each database's host, port, and name, but never its password, token, or key.