Skip to content
Docs
Chat2DB CLI
CLI Overview

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

GoalPage
Install the CLI, check status, install shell completionInstall and Status
List datasources, test connections, create datasources, run SQLDatasources and SQL
Expose Chat2DB MCP tools to AI Agents, install Chat2DB-CLI-SkillMCP and Agent Integration
Update, uninstall, inspect install logs, recover failed local stateUpdate 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.

EditionMeaningDefault
proChat2DB ProDefault for most commands
localChat2DB LocalUse explicitly when operating Local
allCheck or operate both editionsSupported only by selected lifecycle/status commands

Start with:

chat2db version --json
chat2db status --json

status reports App, CLI runtime, and MCP state for Pro / Local, and includes the next recommended action.

Command Impact Levels

LevelExamplesMeaning
Read-onlyversion, status, db datasourcesReads local or runtime state
Local state mutationruntime start, runtime stop, completions --installStarts/stops runtime or changes shell configuration
App lifecycle mutationinstall, start, stop, restart, uninstallInstalls, opens, quits, restarts, or removes the desktop app
Datasource mutationdatasource-create, datasource-update, datasource-deleteChanges saved Chat2DB datasources
External system risksql queryImpact depends on the SQL you run
Credential-sensitivemcp config, commands with --passwordMay 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 --help

If this documentation differs from your local --help output, treat chat2db --help as the source of truth and update the CLI documentation.