Command line
Run any Oxys DB Studio command from a terminal or a script with oxysdb-cli: list commands, run one, stream a batch, answer confirmations, serve MCP.
oxysdb-cli is Oxys DB Studio without a window. It runs the same commands as the desktop
application, by id, with JSON parameters, and prints JSON. Use it in shell scripts, in CI jobs, or
from any program that can start a process.
It uses the same settings, saved connections, saved tasks and credential store as the desktop application for your user account, so a connection you saved in the app can be used by id here.
The five modes
| Mode | Usage | What it does |
|---|---|---|
| commands | oxysdb-cli commands | Lists every command as JSON: id, label, menu_path, shortcut, params (a description of the parameters and the result) and requires (backend capabilities) |
| run | oxysdb-cli run <id> [params] | Runs one command in a fresh session and prints its result. params is a JSON value (default null) |
| batch | oxysdb-cli batch | Reads one command per line on standard input and prints one JSON result per line, all in the same session |
| mcp | oxysdb-cli mcp [--port <n>] [--allow-connection <id or name>]... | Runs the local MCP server without the window, until stopped |
| replay | oxysdb-cli replay <report.zip> --connection <id or name> [--dry-run] [--allow-destructive] [--prefix <p>] | Runs a bug report’s command journal again against a test connection, in scratch databases (see Reporting problems) |
Find a command
The application’s menu items, toolbar buttons and dialog actions run these commands. Each entry’s params
text says which fields it takes and what it returns. For example, connection.list takes
{ filter? } and returns your saved connections with their ids.
Run one command
The result is printed as indented JSON on standard output. On an error, the message goes to standard error and the exit status is 1.
Each run starts a new session, so nothing stays open between two calls: a command that needs an
open connection fails in run mode. Use batch for that.
Run a sequence of commands
batch keeps one session for every line, so you can connect, then browse, query or run tasks:
Each line of input is {"id": …, "params": …}; each line of output is one of:
| Reply | Meaning |
|---|---|
{"ok": …} | The command succeeded; the value is its result |
{"error": "…"} | It failed; the text says why |
{"error": "…", "inputRequired": {"kind", "connection", "prompt"}} | It needs something from you, typically a password that is not saved. Send the command again with it (for connection.connect: "passwords": {"<id>": "…"}) |
{"error": "…", "confirmationRequired": {"prompt", "typed", "confirmLabel", "harmless", "hold"}} | A destructive command asks first (see below) |
{"error": "…", "unreachable": {"server", "message", "stale"}} | The team server cannot be reached; stale holds the last good answer of a read, if there is one |
Blank lines are ignored. A line that is not a command gets an error reply and the batch goes on. The batch ends at the end of the input, with exit status 0.
Answer a confirmation
Destructive commands (drop, clear, delete, overwrite on import, sync, running a task…) never run on
the first call. They reply with confirmationRequired:
prompt: the question, its first line being the title (for example Drop Collection);typed: a name you must type back, ornull;confirmLabel: the confirming button’s text in the application, ornullfor OK;harmless:truewhen nothing can be lost by confirming;hold: an identifier to send back, ornull.
Show the prompt to whoever decides, then send the same command again with "confirm": true in
its params, plus "typed": "<name>" when typed is not null (and "hold" when it was given). In
this example the first reply asked for the collection name to be typed:
A wrong typed name asks again. Read-only connections refuse writes whatever the answer.
Run saved tasks from a script
task.run opens the connections the task needs (asking for a missing password through
inputRequired), asks the Run Task question, then runs. Add "async": true to get a job back
instead of waiting for the result.
Serve MCP without the window
Prints the server’s status (including the URL, the access token and ready-made client configurations) on standard output, then serves until you stop it. Keep the token secret. See Local MCP server for AI agents.
| Option | Default | Meaning |
|---|---|---|
--port <n> | The port saved in Preferences, else 27117 | Port on 127.0.0.1, 1 to 65535. The saved preference is not changed |
--allow-connection <id or name> | none | A saved connection agents may open. Repeat for several. Without it, agents cannot open any connection in a headless session |
Replay a bug report
Reads journal.json from a report saved with Help › Report a Problem… and prints, as JSON, each
command with what it would do (run, or skip and why). Without --dry-run it connects and runs
them, and says how each ended. The journal’s tokens become new names: db#1 the scratch database
oxys_replay_db_1, coll#1 the collection coll_1, tab#1 the tab the replay itself opened.
| Option | Default | Meaning |
|---|---|---|
--connection <id or name> | required | A saved test connection. One marked production (red) is refused |
--dry-run | off | List the plan; connect to nothing, change nothing |
--allow-destructive | off | Also run drop, delete, clear, rename and import commands, and confirm the questions they ask. Without it they are skipped, and nothing is ever confirmed |
--prefix <p> | oxys_replay_ | The scratch databases’ name prefix (letters, digits and _) |
Only database commands are replayed (never preferences, saved connections, Team Sharing or tasks); a command whose parameters were redacted (a file path, a URI, a text) is skipped and says so.
Tips
- Pipe
commandsthrough a JSON tool to search it:oxysdb-cli commands | jq '.[] | select(.id | startswith("task."))'. - In scripts, check
confirmationRequiredexplicitly; never add"confirm": trueblindly to every call. - A crash of the CLI is written to
global_exception.login the logs folder, with a backtrace.
Troubleshooting
| Symptom | What to do |
|---|---|
params are not valid JSON | Quote the JSON for your shell: single quotes around it in bash and zsh. |
| A command says the connection is not open | You used run. Use batch and connect first. |
inputRequired with kind password | The connection’s password is not saved. Send it in passwords, or save it in the application. |
| The usage text is printed | The mode or its arguments are wrong; run takes an id and at most one JSON argument. |
--port must be a whole number from 1 to 65535 | Fix the port value. |