Skip to main content
Open files and connection links in the app with tablepro, or run a command to print database results in your shell. Queries, browsing and exports use the app’s MCP server and its access rules. For Linux, see Command line.

Install

With the app in /Applications, run this line in Terminal:
For a different location, copy the line from Settings > General > Command Line Tool. It links /usr/local/bin/tablepro to the command inside that copy of the app. Enter your administrator password in Terminal when sudo asks. A copy on a read-only volume, including a mounted disk image or an App Translocation location, offers no install line. Move the app to Applications and open it there first.
Command Line Tool page showing the link status and a Terminal commandCommand Line Tool page showing the link status and a Terminal command

Copy the install or removal command from Settings > General > Command Line Tool

App updates also update the command. If you move the app, recreate the link. To remove the link:
Use tablepro --help to list commands, tablepro help query for a command’s options, and tablepro --version for the bundled app’s version.
With no arguments, open the app. Files and links go to the copy the command ships in, or to a copy already running. SQL files (.sql, .psql, .pgsql) open in an editor tab without running. With no connection open, they wait until you connect. SQLite and DuckDB files open a temporary connection. An already open file brings its window forward. Use any connection URL or tablepro link. A matching saved connection is reused; otherwise the session is temporary. See Trusting a link for the consent prompt. tablepro open <target> is the explicit form. Use tablepro open tables or tablepro ./tables for an existing file named like a command. A target must be an existing file or a URL with a scheme; a typo such as tablepro qeury exits 2.

Run a query

Turn on MCP server in Settings > MCP and pair the command before running scripts.
Choose one SQL source: an argument, -f (--file), or piped input. -f - also reads from a terminal until Ctrl+D. Put SQL that starts with a dash after --:
Without a limit or timeout, the MCP defaults apply. A result cut short prints a message on standard error.

Browse a connection

-c is short for --connection. Pass a saved connection’s name or id. If a name matches several connections, use an id from connections. All five commands accept --format. For describe, use --ddl to print the CREATE statement instead; it cannot be combined with --format.

Export

Choose csv, json or sql; --format is required. SQL output contains INSERT statements in the engine’s dialect. Use --database and --schema to select where the tables live. The query row limit also applies to each exported table. --limit overrides it, and standard error names any table cut short. For a full export, use Import & Export in the app. Table names accept letters, digits and underscores, with dots between parts such as public.orders. For other names, quote the name in SQL and use query --format csv or query --format json.

Status and pairing

tablepro status checks the app, MCP server and pairing without starting the app or asking for approval. Add --format json for scripts. It exits 0 when ready, 1 when the app cannot be reached, and 3 when the server is off or the command is not paired. Other commands that need the server start the app if needed. The MCP server must already be enabled in Settings; when it is enabled but fails to start, the command says so and exits 1.
1

Start pairing

Run tablepro pair in Terminal. A query or browse command also starts pairing when no token is stored and standard error is a terminal.
2

Approve in TablePro

The sheet starts at Read Only. Choose Read & Write for scripts that change data. Select the allowed connections and expiry, then click Approve.
3

Return to Terminal

Close the browser confirmation tab. The token is stored in your login Keychain. If a command started pairing, it continues.
An unattended command with no token exits 3. A rejected or expired token is removed and that run exits 3; run tablepro pair again. Pairing again stores a replacement and asks the server to revoke the previous token. If that fails, the command prints a warning; revoke the old token in Settings. When TablePro cannot issue the token after you approve, the browser tab says it could not finish pairing, TablePro shows why, and the command exits 1. Run tablepro pair again once the cause is fixed. tablepro unpair revokes the token and removes its Keychain copy. If the server cannot be reached, only the local copy is removed; revoke the remaining token in Settings > MCP > Tokens. If the server reports that it could not save the revocation, the local token stays for another attempt. These failures exit 1.

Shell completion

Generate the script for your shell. It completes commands, options and format names, but does not look up connection names.
For zsh, add these lines to ~/.zshrc once:
Open a new shell. Generate the script again after an update adds commands or options.

Output formats

Rows go to standard output. Errors, notices and truncation messages go to standard error. For queries, browse commands and status, the default is table when standard output is a terminal and csv otherwise. Set --format in scripts to choose it explicitly. Several result sets become an array of arrays in JSON, consecutive objects in JSONL, or blocks separated by a blank line in the other formats. Repeated column names get numbered JSON keys, such as id and id_2. Query values arrive as text or NULL. Binary values are Base64.

Exit status

Pairing refusal or expiry also exits 3. See Status and pairing for the status and unpair cases.

What a query may do

The command follows the MCP connection access rules:
  • Blocked connections, an AI policy of Never, and connections outside the token’s allowlist are hidden. Naming one exits 2.
  • Writes need both a Read & Write token and Read & Write external access. --read-only still refuses them.
  • Approval in Settings > MCP controls connection approval. Safe Mode also applies to writes.
  • Destructive statements such as DROP, TRUNCATE, ALTER ... DROP and DELETE without WHERE are refused. Run them in the app. Statements that access files or run server-side code are also refused.
Send one statement per query. SQL Server also accepts a script split at GO lines and returns each result set. Executed queries enter the audit log and query history. A database link asks Open External Database Connection? before connecting. Check the host, user and database before approving. For a local connection without a filter, an SSH tunnel, an SSH profile, a SOCKS proxy, a tunnel command, Cloudflare or the Cloud SQL Auth Proxy, Always Allow remembers the database type, host, database, user and URL name. Local hosts include localhost, ::1 and 127.x.x.x. A local socket grant also includes its path. The port is excluded, so a development server may change ports without asking again. A link that opens a saved connection is remembered for that saved connection only. Remote hosts and links through a tunnel or proxy ask every time.
External connection alert showing the target database and approval buttonsExternal connection alert showing the target database and approval buttons

Only local database links offer Always Allow

Remove a grant with Forget, or every grant with Forget All, in Settings > Connections > Trusted Links. A trusted link still asks before applying a filter (query, condition or raw) or running a pre-connect script.