Chat2DB CLI Overview
Chat2DB CLI is the command-line entry point for Chat2DB. The binary name is chat2db. It is designed for terminal users, scripts, automation jobs, and AI Agent workflows that need to operate Chat2DB Pro / Local without manually opening the GUI for every task.
This documentation is written for the Chat2DB CLI 0.1.25 command surface. Command syntax is based on chat2db --help, chat2db version --json, and per-command --help output.
What to Read First
| Goal | Page |
|---|---|
| Install the CLI, check status, install shell completion | Install and Status |
| List datasources, test connections, create datasources, run SQL | Datasources and SQL |
| Expose Chat2DB MCP tools to AI Agents, install Chat2DB-CLI-Skill | MCP and Agent Integration |
| Update, uninstall, inspect install logs, recover failed local state | Update and Recovery |
Supported Scope
Chat2DB CLI currently supports the Chat2DB Pro / Local desktop apps on macOS and Windows. Desktop app installation, lifecycle, runtime, datasource, SQL, and MCP commands require a local Chat2DB desktop app.
The CLI covers:
- installing, starting, stopping, and restarting Chat2DB Pro / Local
- checking App, CLI runtime, and MCP state
- starting a local headless runtime for datasource and SQL commands
- listing datasources, testing connections, and creating, updating, or deleting datasources
- listing databases, schemas, tables, and table schemas
- running SQL queries with paged results
- enabling, disabling, restarting, listing, and calling the Chat2DB desktop MCP endpoint
- installing or updating Chat2DB-CLI-Skill for Codex / Claude Code
- updating or uninstalling the CLI binary
- installing zsh, bash, or fish shell completion
Edition
Most commands accept --edition pro or --edition local.
| Edition | Meaning | Default |
|---|---|---|
pro | Chat2DB Pro | Default for most commands |
local | Chat2DB Local | Use explicitly when operating Local |
all | Check or operate both editions | Supported only by selected lifecycle/status commands |
Start with:
chat2db version --json
chat2db status --jsonstatus reports App, CLI runtime, and MCP state for Pro / Local, and includes the next recommended action.
Command Impact Levels
| Level | Examples | Meaning |
|---|---|---|
| Read-only | version, status, db datasources | Reads local or runtime state |
| Local state mutation | runtime start, runtime stop, completions --install | Starts/stops runtime or changes shell configuration |
| App lifecycle mutation | install, start, stop, restart, uninstall | Installs, opens, quits, restarts, or removes the desktop app |
| Datasource mutation | datasource-create, datasource-update, datasource-delete | Changes saved Chat2DB datasources |
| External system risk | sql query | Impact depends on the SQL you run |
| Credential-sensitive | mcp config, commands with --password | May include tokens, headers, passwords, or connection details |
Never paste real passwords, MCP tokens, Authorization headers, credential-bearing JDBC URLs, or production administrator accounts into docs, tickets, or chat logs.
Common Entry Points
chat2db --help
chat2db install --help
chat2db db --help
chat2db sql --help
chat2db mcp --helpIf this documentation differs from your local --help output, treat chat2db --help as the source of truth and update the CLI documentation.