Chat2DB Documentation

AI-driven database tool and SQL client, The hottest GUI client, supporting MySQL, Oracle, PostgreSQL, DB2, SQL Server, DB2, SQLite, H2, ClickHouse, and more.

27,948 stars Java Java 1 file · ~13,013 tokens #ai#bi#chatgpt#clickhouse#clickhouse-client#database#datagrip#db2
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy Chat2DB on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name chat2db -p 10825:10825 --restart always chat2db/chat2db:${CHAT2DB_IMAGE_TAG:-latest}
Configured Services & Ports
⚙️ chat2db
image: chat2db/chat2db:${CHAT2DB_IMAGE_TAG:-latest}
🔌 Ports: ${CHAT2DB_BIND_ADDRESS:-127.0.0.1}:${CHAT2DB_PORT:-10825}:10825
docker-compose.yml
yaml (docker-compose.yml)
services:
  chat2db:
    image: chat2db/chat2db:${CHAT2DB_IMAGE_TAG:-latest}
    container_name: chat2db-community
    restart: unless-stopped
    ports:
      - "${CHAT2DB_BIND_ADDRESS:-127.0.0.1}:${CHAT2DB_PORT:-10825}:10825"
    environment:
      CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE: /run/secrets/chat2db-community-encryption.key
    volumes:
      - chat2db-community-data:/root/.chat2db-community
      - "${HOME}/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro"

volumes:
  chat2db-community-data:

1. Project Overview & Quickstart (OtterMind/Chat2DB)

File: README.md

An AI-powered database client and SQL workspace for developers, DBAs, analysts, and data teams.

What is Chat2DB?

Chat2DB Community is a free, cross-platform database client for Windows, macOS, and Linux. It runs entirely on your machine and combines a full-featured SQL workspace with an AI assistant that you connect to your own model.

  • 40+ databases — MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis, SQLite, MariaDB, TiDB, Hive, DB2, Snowflake, BigQuery, Elasticsearch, Trino, TimescaleDB, Greenplum, YugabyteDB, CrateDB, QuestDB, Apache IoTDB, Firebird, HSQLDB, Apache Derby, and more via plugins — new JDBC databases can be added through configuration only, without code changes.
  • SQL workspace — editing, completion, formatting, execution, saved SQL, and execution history.
  • AI assistant — bring your own AI model to generate, explain, and optimize SQL in natural language.
  • Database management — browse metadata, manage tables and objects (DDL/DML), and edit data in place.
  • Data import and export, dashboards and charts, and an open-source CLI with MCP support.

Screenshots

Dashboards and charts ER diagrams
Visual data management Data import and export

Early preview

The next feature line ships as an early preview before it reaches the regular Beta channel:

  • Chat2DB Community 5.4.0-beta.1 (early preview) — installers for macOS, Windows and Linux.
  • It adds an optional local agent runtime with skills, external MCP servers, and file and terminal tools; choose Pi Agent in the AI input's runtime selector to enable it (the first selection asks for confirmation and downloads the runtime).
  • This preview is neither the stable nor the regular Beta release: Latest stays on the stable build, and the regular Beta line continues with 5.3.8-beta.x. Enable Receive Beta versions in Settings → About Us to receive it in the app.

Quick Start

Option 1: Desktop App

Download the installer for your platform from GitHub Releases, install it, and start connecting to your databases. No further setup is required.

Option 2: Docker

Requirements: Docker 19.03.0+, Docker Compose 2.0.0+ (Compose V2, only for the Compose variant), 2+ CPU cores, 4+ GiB RAM.

First create the encryption key (see Encryption Key for why it matters), then start the container:

bash
# Run once from a repository checkout. Re-running reuses the same valid key.
git clone https://github.com/OtterMind/Chat2DB.git && cd Chat2DB
./script/security/init-community-encryption-key.sh

docker run --detach \
  --name chat2db-community \
  --restart unless-stopped \
  --publish 127.0.0.1:10825:10825 \
  --volume "$HOME/.chat2db-community-docker:/root/.chat2db-community" \
  --env CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE=/run/secrets/chat2db-community-encryption.key \
  --volume "$HOME/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro" \
  chat2db/chat2db:latest

Then open http://localhost:10825 in your browser.

Alternatively, use the bundled Compose definition:

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

Notes:

  • To update, pull the new image, remove the old container, and run the start command again. Keep ~/.config/chat2db-community/encryption.key across rebuilds.
  • The docker run example stores application data in $HOME/.chat2db-community-docker; the Compose definition uses the chat2db-community-data named volume. These locations do not share data.
  • Chat2DB Community 5.3.0 uses the independent /root/.chat2db-community directory and does not automatically migrate data from earlier images that used /root/.chat2db.

Security Notes

Chat2DB Community is a single-user, local-first application. It has no user
accounts or authorization boundaries between users. Keep the HTTP service
bound to 127.0.0.1 or ::1 and do not expose it to other users or
untrusted networks.

Custom JDBC drivers are executable Java code — install them only from
sources you trust. Imported configuration files, archives, SQL files,
database contents, and AI responses remain untrusted data. See the
Security Policy for the complete trust boundary and
vulnerability reporting process.

If you find this project useful, please give us a Star ⭐️ — it really helps!

Encryption Key

Chat2DB Community encrypts stored datasource passwords and AI model API keys with AES-256-GCM using a per-installation key. Create it once from a repository checkout (requires openssl):

bash
./script/security/init-community-encryption-key.sh

The key is written to ~/.config/chat2db-community/encryption.key. Back this file up separately and keep it across upgrades and container rebuilds — replacing or losing it makes previously stored datasource passwords and AI model API keys unreadable. Web/headless startup fails when no valid key is provided; only Desktop mode creates a missing key automatically.

Key configuration reference (custom paths, resolution order, validation)

The key must be valid Base64 that decodes to exactly 32 bytes. The bundled initializer generates the standard padded form: 44 Base64 characters ending in =. It is cryptographic key material, not a human-readable password. Datasource passwords and AI API keys use the same key with separate authenticated AAD values, so ciphertext from one purpose cannot be decrypted as the other.

To use a custom path, pass it to the script and configure the same path when starting Chat2DB:

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

The script's key-file path priority is the positional argument, CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE, then the default path. It reuses a valid regular file, rejects symbolic links and non-regular files, and refuses to overwrite an invalid file. Keep the key readable only by the Chat2DB process owner.

Key configuration is resolved in this order:

  1. JVM property chat2db.community.encryption-key containing the Base64 key.
  2. Environment variable CHAT2DB_COMMUNITY_ENCRYPTION_KEY containing the Base64 key.
  3. JVM property chat2db.community.encryption-key-file containing a key-file path.
  4. Environment variable CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE containing a key-file path.
  5. Default file ~/.config/chat2db-community/encryption.key.

The first configured value is authoritative. A blank value, malformed Base64, a key that does not decode to 32 bytes, or an invalid key file fails startup instead of falling through to the next source. File-based configuration is recommended because it avoids placing the key value directly in process arguments or environment variables.

Automatic key-file creation depends on chat2db.mode, not chat2db.gui. Community Desktop mode (chat2db.runtime.mode=community with chat2db.mode=DESKTOP) creates the selected key file when no inline key is configured and the file is missing. Any non-Desktop mode, including normal Web/headless startup, never creates a missing key and fails until a valid key is provided or initialized. The resolved key is cached for the process lifetime, so changing key configuration requires an application restart.

Build from Source

Prerequisites

Clone the Repository

bash
git clone https://github.com/OtterMind/Chat2DB.git

Frontend

Use Yarn with the checked-in lockfile.

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

Backend

bash
cd Chat2DB
mvn -B clean package -Dmaven.test.skip=true -Dchat2db.finalName=chat2db-community \
    -f chat2db-community-server/pom.xml \
    -pl chat2db-community-start -am
./script/security/init-community-encryption-key.sh
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.gui=false \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file="$HOME/.config/chat2db-community/encryption.key" \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -Dspring.profiles.active=dev \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

Build a Local Docker Image

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

Database guides

Step-by-step guides for connecting Chat2DB Community to specific databases:

  • BigQuery — Google BigQuery via a Google Cloud service account.

Community vs Commercial Editions

The Community edition contains the full local database client described above, including custom AI model support. The commercial Pro and Enterprise editions build on the same core and add hosted AI services, user accounts, cloud storage and multi-device sync, and team collaboration and governance features. See chat2db.ai for details.

Contributing

We welcome bug reports, feature requests, documentation improvements, testing feedback, and pull requests from the community.

Before opening an issue or submitting a pull request, please read our Contributing Guide. It explains how to report bugs, suggest improvements, and make contributions easier for maintainers to review.

  • For bugs and feature requests, please use GitHub Issues.
  • For questions, setup help, and open-ended discussions, please use GitHub Discussions.
  • If your pull request is related to an issue, please link it in the PR description.

Community and Support

Acknowledgments

Thanks to everyone who has contributed to Chat2DB.

License

Chat2DB Community version 5.3.0 and later is available under the
license terms in this repository. This is a source-available
license based on the Apache License 2.0 with additional conditions. Chat2DB
releases published before version 5.3.0, including version 0.3.7 and the
earlier historical tags, remain under the Apache License 2.0.


File: chat2db-community-client/readme.md

Chat2DB Community Frontend

The Community frontend is built with Umi 4, React, TypeScript, Ant Design 5,
and Zustand. Community behavior is selected with UMI_ENV=community.

Requirements

  • Node.js 18.17.0 or newer
  • Yarn using the repository's yarn.lock
  • The Community backend when running the development server

Install dependencies from this directory:

bash
yarn install --frozen-lockfile

Do not generate npm or pnpm lockfiles. The repository maintains only the Yarn
lockfile.

Development

Start the Community backend on 127.0.0.1:10825, then run:

bash
yarn run start:community:hot

The Community development server listens on port 8889.

Production Build

Build the Community renderer with an explicit public version:

bash
yarn run build:web:community --app_version=5.3.0

The generated renderer is written to dist/. For a web or Docker package, the
files are staged under the Spring Boot module at:

text
../chat2db-community-server/chat2db-community-start/src/main/resources/static/front/
../chat2db-community-server/chat2db-community-start/src/main/resources/thymeleaf/index.html

From the repository root, use ./docker/docker-build.sh to perform the complete
frontend, backend, and image build without manually staging these files.

Desktop Packaging

The JCEF desktop packaging entry point is repository-local:

bash
script/package/package-community-jcef.sh 5.3.0 prepare

Run it from the repository root. Replace prepare with mac, linux, or win
on the matching operating system to build a native installer. Generated inputs
and installers are written under jpackage/ and are not frontend source files.

Checks

bash
yarn run lint
yarn run test:i18n
yarn run test:result-markdown
yarn run test:sql-in-clipboard

Source Conventions

  • Prefix TypeScript interfaces and type aliases with I.
  • Use values from window._AppThemePack in JavaScript and CSS variables such
    as var(--control-item-bg-active) in styles instead of hard-coded theme
    colors.
  • Use keys from src/i18n/ through i18n or i18nElement. Placeholders use
    {1}, {2}, and so on. Spanish and Korean catalogs must keep exact module,
    key, placeholder, and HTML-tag parity with en-US; update their source hashes
    whenever the corresponding English wording changes.

File: README_CN.md

面向开发者、DBA、分析师和数据团队的 AI 驱动数据库客户端与 SQL 工作空间。

Chat2DB 是什么?

Chat2DB Community 是一款免费的跨平台数据库客户端,支持 Windows、macOS 和 Linux。它完全运行在你自己的机器上,提供功能完整的 SQL 工作空间,并可接入你自己的 AI 模型作为智能助手。

  • 40+ 种数据库 —— MySQL、PostgreSQL、Oracle、SQL Server、ClickHouse、MongoDB、Redis、SQLite、MariaDB、TiDB、Hive、DB2、Snowflake、BigQuery、Elasticsearch、Trino、TimescaleDB、Greenplum、YugabyteDB、CrateDB、QuestDB、Apache IoTDB、Firebird、HSQLDB、Apache Derby 等,通过插件扩展;新的 JDBC 数据库仅需配置即可接入,无需修改代码。
  • SQL 工作空间 —— SQL 编辑、补全、格式化、执行、SQL 收藏与历史记录。
  • AI 助手 —— 接入自定义 AI 模型,用自然语言生成、解释和优化 SQL。
  • 数据库管理 —— 元数据浏览、表和对象管理(DDL/DML)、在线编辑数据。
  • 数据导入导出、Dashboard 与图表,以及支持 MCP 的开源 CLI。

产品界面

Dashboard 与图表 ER 图
可视化数据管理 数据导入导出

超前预览

下一条功能线在进入常规 Beta 通道之前,先以超前预览的形式发布:

  • Chat2DB Community 5.4.0-beta.1(超前预览) —— 提供 macOS、Windows、Linux 安装包。
  • 它带来可选的本地 Agent 运行时,包含技能、外部 MCP Server、文件与终端工具;在 AI 输入框的运行时选择器里选 Pi Agent 即可启用(首次选择会确认并下载运行时)。
  • 该预览版既不是稳定版,也不是常规 Beta:Latest 仍是稳定版,常规 Beta 线继续走 5.3.8-beta.x。想在应用内收到它,请在设置 → 关于我们开启接收 Beta 版本。

快速开始

方式一:桌面应用

从 GitHub Releases 下载对应平台的安装包,安装后即可连接数据库使用,无需其他配置。

方式二:Docker

系统要求:Docker 19.03.0+、Docker Compose 2.0.0+(Compose V2,仅 Compose 方式需要)、CPU 2 核以上、内存 4 GiB 以上。

先创建加密密钥(用途见加密密钥一节),再启动容器:

bash
# 在仓库目录中首次执行一次;重复执行会复用同一把合法密钥。
git clone https://github.com/OtterMind/Chat2DB.git && cd Chat2DB
./script/security/init-community-encryption-key.sh

docker run --detach \
  --name chat2db-community \
  --restart unless-stopped \
  --publish 127.0.0.1:10825:10825 \
  --volume "$HOME/.chat2db-community-docker:/root/.chat2db-community" \
  --env CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE=/run/secrets/chat2db-community-encryption.key \
  --volume "$HOME/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro" \
  chat2db/chat2db:latest

然后在浏览器中访问 http://localhost:10825。

也可以使用仓库自带的 Compose 配置:

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

注意事项:

  • 更新时先拉取新镜像、删除旧容器,再重新执行启动命令。容器重建时必须保留 ~/.config/chat2db-community/encryption.key。
  • docker run 示例将应用数据保存在 $HOME/.chat2db-community-docker;Compose 配置使用名为 chat2db-community-data 的命名卷。两处存储不会自动共享数据。
  • Chat2DB Community 5.3.0 使用独立的 /root/.chat2db-community 目录,不会自动迁移旧镜像 /root/.chat2db 中的数据。

安全须知

Chat2DB Community 是单用户、本机优先的应用,不提供用户账号或多用户之间的
权限边界。HTTP 服务必须绑定到 127.0.0.1 或 ::1,不要暴露给其他用户或
不可信网络。

自定义 JDBC Driver 是可执行 Java 代码,只应安装来自可信来源的驱动。导入的
配置文件、压缩包、SQL 文件、数据库内容和 AI 响应仍属于不可信数据。完整信任
边界和漏洞报告流程请参阅安全策略。

如果你觉得这个项目对你有用,帮我们点个 Star ⭐️ 吧!

加密密钥

Chat2DB Community 使用 AES-256-GCM 加密保存的数据源密码和 AI 模型 API Key,每个安装实例使用独立密钥。在仓库目录中执行一次以下命令创建密钥(依赖 openssl):

bash
./script/security/init-community-encryption-key.sh

密钥会写入 ~/.config/chat2db-community/encryption.key。请单独备份该文件,并在升级和容器重建时保留 —— 替换或丢失密钥会导致已保存的数据源密码和 AI 模型 API Key 无法解密。Web/headless 方式启动时缺少合法密钥会直接启动失败;只有 Desktop 模式会自动创建缺失的密钥。

密钥配置参考(自定义路径、解析优先级、校验规则)

密钥必须是合法的 Base64,且解码后恰好为 32 字节。仓库提供的初始化脚本会生成标准带填充格式,即 44 个 Base64 字符并以 = 结尾。它是加密密钥材料,不是用户自行输入的普通口令。数据源密码和 AI API Key 使用同一把密钥,但使用不同的认证 AAD,因此一种用途的密文不能作为另一种用途解密。

如需使用自定义路径,应在初始化脚本和 Chat2DB 启动参数中指定同一路径:

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

脚本选择密钥文件路径的优先级依次为位置参数、CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE 和默认路径。脚本会复用已有的合法普通文件,拒绝符号链接和非普通文件;如果已有文件不合法,脚本会报错且不会覆盖。密钥文件应当只允许 Chat2DB 进程所属用户读取。

密钥配置按以下优先级解析:

  1. JVM 参数 chat2db.community.encryption-key,值为 Base64 密钥。
  2. 环境变量 CHAT2DB_COMMUNITY_ENCRYPTION_KEY,值为 Base64 密钥。
  3. JVM 参数 chat2db.community.encryption-key-file,值为密钥文件路径。
  4. 环境变量 CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE,值为密钥文件路径。
  5. 默认文件 ~/.config/chat2db-community/encryption.key。

第一个已配置的值具有最高优先级。空值、非法 Base64、解码后不是 32 字节的密钥或非法密钥文件都会直接导致启动失败,不会静默回退到下一项。推荐使用密钥文件,避免把密钥值直接暴露在进程参数或环境变量中。

密钥文件是否自动创建只取决于 chat2db.mode,与 chat2db.gui 无关。Community Desktop 模式(chat2db.runtime.mode=community 且 chat2db.mode=DESKTOP)会在未配置内联密钥且所选密钥文件不存在时自动创建该文件。任何非 Desktop 模式(包括常规 Web/headless 启动)都不会创建缺失的密钥,必须提前初始化或显式配置合法密钥,否则启动失败。解析后的密钥会在进程生命周期内缓存,因此修改密钥配置后必须重启应用。

从源码构建

环境要求

  • Java 运行环境:Eclipse Temurin 17
  • Node.js 18.17.0 或更高版本
  • Maven 3.8 或以上版本

克隆仓库

bash
git clone https://github.com/OtterMind/Chat2DB.git

前端

请使用仓库中的 Yarn lockfile。

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

后端

bash
cd Chat2DB
mvn -B clean package -Dmaven.test.skip=true -Dchat2db.finalName=chat2db-community \
    -f chat2db-community-server/pom.xml \
    -pl chat2db-community-start -am
./script/security/init-community-encryption-key.sh
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.gui=false \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file="$HOME/.config/chat2db-community/encryption.key" \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -Dspring.profiles.active=dev \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

构建本地 Docker 镜像

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

社区版与商业版

社区版包含上述完整的本地数据库客户端能力,包括自定义 AI 模型支持。商业版 Pro 和 Enterprise 在同一核心之上增加官方 AI 服务、账号体系、云端存储与多设备同步,以及团队协作和治理能力。详情请见 chat2db.ai。

参与贡献

我们欢迎社区提交 Bug、功能建议、文档改进、测试反馈和 Pull Request。

创建 Issue 或提交 Pull Request 前,请先阅读贡献指南。其中说明了如何报告问题、提出建议,以及如何让维护者更高效地审查贡献。

  • Bug 和功能建议请使用 GitHub Issues。
  • 使用问题、配置帮助和开放讨论请使用 GitHub Discussions。
  • 如果 Pull Request 与某个 Issue 相关,请在 PR 描述中附上对应链接。

社区与支持

致谢

感谢所有为 Chat2DB 贡献力量的同学们。

许可证

Chat2DB Community 5.3.0 及后续版本适用本仓库的
LICENSE。该许可基于 Apache License 2.0 并附加了使用条件,
属于 Source Available 许可。Chat2DB 5.3.0 之前发布的所有版本,包括 0.3.7
以及更早的历史版本,继续适用 Apache License 2.0。


File: README_ES.md

Un cliente de bases de datos y espacio de trabajo SQL con IA para desarrolladores, administradores de bases de datos, analistas y equipos de datos.

¿Qué es Chat2DB?

Chat2DB Community es un cliente de bases de datos gratuito y multiplataforma para Windows, macOS y Linux. Se ejecuta por completo en su equipo y combina un espacio de trabajo SQL con todas las funciones con un asistente de IA que usted conecta a su propio modelo.

  • Más de 40 bases de datos — MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis, SQLite, MariaDB, TiDB, Hive, DB2, Snowflake, BigQuery, Elasticsearch, Trino, TimescaleDB, Greenplum, YugabyteDB, CrateDB, QuestDB, Apache IoTDB, Firebird, HSQLDB, Apache Derby y más mediante plugins; las nuevas bases de datos JDBC se pueden añadir solo con configuración, sin cambios de código.
  • Espacio de trabajo SQL — edición, autocompletado, formato, ejecución, SQL guardado e historial de ejecución.
  • Asistente de IA — use su propio modelo de IA para generar, explicar y optimizar SQL en lenguaje natural.
  • Gestión de bases de datos — explore metadatos, gestione tablas y objetos (DDL/DML) y edite los datos directamente.
  • Importación y exportación de datos, paneles y gráficos, y una CLI de código abierto compatible con MCP.

Capturas de pantalla

Paneles y gráficos Diagramas ER
Gestión visual de datos Importación y exportación de datos

Vista previa anticipada

La siguiente línea de funciones se publica como vista previa anticipada antes de llegar al canal Beta habitual:

  • Chat2DB Community 5.4.0-beta.1 (vista previa anticipada) — instaladores para macOS, Windows y Linux.
  • Añade un entorno de agente local opcional con skills, servidores MCP externos y herramientas de archivo y terminal; elige Pi Agent en el selector de runtime del campo de entrada de la IA para activarlo (la primera vez pide confirmación y descarga el entorno).
  • Esta vista previa no es la versión estable ni la Beta habitual: Latest sigue siendo la estable y la línea Beta habitual continúa con 5.3.8-beta.x. Active Recibir versiones Beta en Configuración → Acerca de para recibirla en la aplicación.

Inicio rápido

Opción 1: Aplicación de escritorio

Descargue el instalador para su plataforma desde GitHub Releases, instálelo y empiece a conectarse a sus bases de datos. No se requiere ninguna configuración adicional.

Opción 2: Docker

Requisitos: Docker 19.03.0 o posterior, Docker Compose 2.0.0 o posterior (Compose V2, solo para la variante con Compose), 2 o más núcleos de CPU, 4 GiB o más de RAM.

Primero cree la clave de cifrado (consulte Clave de cifrado para saber por qué es importante) y, a continuación, inicie el contenedor:

bash
# Ejecútelo una vez desde un checkout del repositorio. Las ejecuciones posteriores reutilizan la misma clave válida.
git clone https://github.com/OtterMind/Chat2DB.git && cd Chat2DB
./script/security/init-community-encryption-key.sh

docker run --detach \
  --name chat2db-community \
  --restart unless-stopped \
  --publish 127.0.0.1:10825:10825 \
  --volume "$HOME/.chat2db-community-docker:/root/.chat2db-community" \
  --env CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE=/run/secrets/chat2db-community-encryption.key \
  --volume "$HOME/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro" \
  chat2db/chat2db:latest

Después abra http://localhost:10825 en su navegador.

Como alternativa, use la definición de Compose incluida:

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

Notas:

  • Para actualizar, descargue la nueva imagen, elimine el contenedor anterior y ejecute de nuevo el comando de inicio. Conserve ~/.config/chat2db-community/encryption.key entre reconstrucciones.
  • El ejemplo de docker run almacena los datos de la aplicación en $HOME/.chat2db-community-docker; la definición de Compose usa el volumen con nombre chat2db-community-data. Estas ubicaciones no comparten datos.
  • Chat2DB Community 5.3.0 utiliza el directorio independiente /root/.chat2db-community y no migra automáticamente los datos de imágenes anteriores que usaban /root/.chat2db.

Notas de seguridad

Chat2DB Community es una aplicación local y para un solo usuario. No tiene
cuentas de usuario ni límites de autorización entre usuarios. Mantenga el
servicio HTTP enlazado a 127.0.0.1 o ::1 y no lo exponga a otros usuarios
ni a redes que no sean de confianza.

Los controladores JDBC personalizados son código Java ejecutable: instálelos
solo desde fuentes en las que confíe. Los archivos de configuración
importados, los archivos comprimidos, los archivos SQL, los contenidos de las
bases de datos y las respuestas de la IA siguen siendo datos no confiables.
Consulte la Política de seguridad para conocer el límite de
confianza completo y el proceso de notificación de vulnerabilidades.

Si este proyecto le resulta útil, ¡regálenos una estrella ⭐️!

Clave de cifrado

Chat2DB Community cifra las contraseñas de fuentes de datos y las claves API de modelos de IA almacenadas con AES-256-GCM usando una clave por instalación. Créela una sola vez desde un checkout del repositorio (requiere openssl):

bash
./script/security/init-community-encryption-key.sh

La clave se escribe en ~/.config/chat2db-community/encryption.key. Haga una copia de seguridad de este archivo por separado y consérvelo entre actualizaciones y reconstrucciones del contenedor: si lo sustituye o lo pierde, las contraseñas de fuentes de datos y las claves API de modelos de IA almacenadas anteriormente dejarán de ser legibles. El inicio en modo web/headless falla cuando no se proporciona una clave válida; solo el modo Desktop crea automáticamente una clave que falte.

Referencia de configuración de la clave (rutas personalizadas, orden de resolución, validación)

La clave debe ser Base64 válido que se decodifique exactamente en 32 bytes. El inicializador incluido genera el formato estándar con relleno: 44 caracteres Base64 terminados en =. Es material criptográfico de clave, no una contraseña legible por humanos. Las contraseñas de fuentes de datos y las claves API de IA usan la misma clave con valores AAD autenticados independientes, por lo que el texto cifrado de un propósito no se puede descifrar como si perteneciera al otro.

Para usar una ruta personalizada, pásela al script y configure la misma ruta al iniciar Chat2DB:

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

La prioridad del script para la ruta del archivo de clave es: el argumento posicional, CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE y, por último, la ruta predeterminada. El script reutiliza un archivo regular válido, rechaza enlaces simbólicos y archivos no regulares, y se niega a sobrescribir un archivo no válido. Mantenga la clave legible únicamente por el propietario del proceso de Chat2DB.

La configuración de la clave se resuelve en este orden:

  1. Propiedad JVM chat2db.community.encryption-key que contiene la clave Base64.
  2. Variable de entorno CHAT2DB_COMMUNITY_ENCRYPTION_KEY que contiene la clave Base64.
  3. Propiedad JVM chat2db.community.encryption-key-file que contiene la ruta de un archivo de clave.
  4. Variable de entorno CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE que contiene la ruta de un archivo de clave.
  5. Archivo predeterminado ~/.config/chat2db-community/encryption.key.

El primer valor configurado es el autoritativo. Un valor en blanco, Base64 mal formado, una clave que no se decodifica en 32 bytes o un archivo de clave no válido hacen fallar el inicio en lugar de continuar con el origen siguiente. Se recomienda la configuración basada en archivo porque evita colocar el valor de la clave directamente en los argumentos del proceso o en las variables de entorno.

La creación automática del archivo de clave depende de chat2db.mode, no de chat2db.gui. El modo Desktop de Community (chat2db.runtime.mode=community con chat2db.mode=DESKTOP) crea el archivo de clave seleccionado cuando no hay configurada una clave en línea y el archivo no existe. Cualquier modo que no sea Desktop, incluido el inicio web/headless normal, nunca crea una clave que falte y falla hasta que se proporcione o inicialice una clave válida. La clave resuelta se almacena en caché durante la vida del proceso, por lo que cambiar la configuración de la clave requiere reiniciar la aplicación.

Compilar desde el código fuente

Requisitos previos

  • Entorno de ejecución de Java: Eclipse Temurin 17
  • Node.js 18.17.0 o posterior
  • Maven 3.8 o posterior

Clonar el repositorio

bash
git clone https://github.com/OtterMind/Chat2DB.git

Frontend

Use Yarn con el archivo de bloqueo incluido en el repositorio.

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

Backend

bash
cd Chat2DB
mvn -B clean package -Dmaven.test.skip=true -Dchat2db.finalName=chat2db-community \
    -f chat2db-community-server/pom.xml \
    -pl chat2db-community-start -am
./script/security/init-community-encryption-key.sh
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.gui=false \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file="$HOME/.config/chat2db-community/encryption.key" \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -Dspring.profiles.active=dev \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

Compilar una imagen de Docker local

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

Ediciones Community y comerciales

La edición Community contiene el cliente local de bases de datos completo descrito anteriormente, incluido el soporte de modelos de IA personalizados. Las ediciones comerciales Pro y Enterprise se basan en el mismo núcleo y añaden servicios de IA alojados, cuentas de usuario, almacenamiento en la nube y sincronización entre dispositivos, así como funciones de colaboración y gobierno para equipos. Consulte chat2db.ai para más detalles.

Contribuciones

Agradecemos los informes de errores, las solicitudes de funciones, las mejoras de documentación, los comentarios sobre pruebas y las pull requests de la comunidad.

Antes de abrir una incidencia o enviar una pull request, lea nuestra Guía de contribución. Explica cómo informar de errores, sugerir mejoras y facilitar la revisión de las contribuciones por parte de los mantenedores.

  • Para errores y solicitudes de funciones, utilice GitHub Issues.
  • Para preguntas, ayuda con la configuración y debates abiertos, utilice GitHub Discussions.
  • Si su pull request está relacionada con una incidencia, enlácela en la descripción de la PR.

Comunidad y soporte

Agradecimientos

Gracias a todas las personas que han contribuido a Chat2DB.

Licencia

La versión 5.3.0 y posteriores de Chat2DB Community están disponibles bajo los
términos de licencia de este repositorio. Se trata de una licencia
de código disponible basada en Apache License 2.0 con condiciones adicionales.
Las versiones de Chat2DB publicadas antes de la 5.3.0, incluida la 0.3.7 y las
etiquetas históricas anteriores, siguen estando bajo Apache License 2.0.


File: README_JA.md

開発者、DBA、アナリスト、データチーム向けの AI 搭載データベースクライアント兼 SQL ワークスペースです。

Chat2DB とは?

Chat2DB Community は、Windows、macOS、Linux に対応した無料のクロスプラットフォームデータベースクライアントです。すべてローカルマシン上で動作し、フル機能の SQL ワークスペースと、自分で用意したモデルに接続して使う AI アシスタントを組み合わせています。

  • 40 以上のデータベース — MySQL、PostgreSQL、Oracle、SQL Server、ClickHouse、MongoDB、Redis、SQLite、MariaDB、TiDB、Hive、DB2、Snowflake、BigQuery、Elasticsearch、Trino、TimescaleDB、Greenplum、YugabyteDB、CrateDB、QuestDB、Apache IoTDB、Firebird、HSQLDB、Apache Derby など。プラグインによりさらに拡張でき、新しい JDBC データベースはコード変更なしで設定のみで追加できます。
  • SQL ワークスペース — 編集、補完、フォーマット、実行、保存済み SQL、実行履歴。
  • AI アシスタント — 自分の AI モデルを接続し、自然言語で SQL の生成・説明・最適化を行えます。
  • データベース管理 — メタデータの参照、テーブルとオブジェクトの管理(DDL/DML)、データのインライン編集。
  • データのインポートとエクスポート、ダッシュボードとチャート、MCP 対応のオープンソース CLI。

スクリーンショット

ダッシュボードとチャート ER 図
ビジュアルデータ管理 データのインポートとエクスポート

アーリープレビュー

次の機能ラインは、通常の Beta チャネルに届く前にアーリープレビューとして公開されます。

  • Chat2DB Community 5.4.0-beta.1(アーリープレビュー) — macOS、Windows、Linux のインストーラー。
  • スキル、外部 MCP サーバー、ファイル/ターミナルツールを含むオプションのローカルエージェントランタイムを追加します。AI 入力欄のランタイムセレクターで Pi Agent を選ぶと有効になります(初回は確認のうえランタイムをダウンロードします)。
  • このプレビューは安定版でも通常の Beta でもありません。Latest は安定版のままで、通常の Beta ラインは 5.3.8-beta.x として続きます。アプリ内で受け取るには 設定 → 私たちについて で Beta バージョンを受け取る を有効にします。

クイックスタート

オプション 1: デスクトップアプリ

GitHub Releases からお使いのプラットフォーム向けのインストーラーをダウンロードしてインストールし、データベースへの接続を始めてください。追加のセットアップは不要です。

オプション 2: Docker

要件: Docker 19.03.0 以上、Docker Compose 2.0.0 以上(Compose V2、Compose を使う場合のみ)、CPU 2 コア以上、RAM 4 GiB 以上。

最初に暗号化キーを作成し(その重要性については暗号化キーを参照)、その後コンテナを起動します:

bash
# リポジトリのチェックアウト内で一度だけ実行します。再実行時は同じ有効なキーを再利用します。
git clone https://github.com/OtterMind/Chat2DB.git && cd Chat2DB
./script/security/init-community-encryption-key.sh

docker run --detach \
  --name chat2db-community \
  --restart unless-stopped \
  --publish 127.0.0.1:10825:10825 \
  --volume "$HOME/.chat2db-community-docker:/root/.chat2db-community" \
  --env CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE=/run/secrets/chat2db-community-encryption.key \
  --volume "$HOME/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro" \
  chat2db/chat2db:latest

その後、ブラウザで http://localhost:10825 を開いてください。

代わりに、リポジトリに含まれる Compose 定義を使用することもできます:

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

注意事項:

  • 更新する場合は、新しいイメージを取得し、古いコンテナを削除してから起動コマンドを再実行します。コンテナを再作成しても ~/.config/chat2db-community/encryption.key は保持してください。
  • docker run の例ではアプリケーションデータを $HOME/.chat2db-community-docker に保存し、Compose 定義は名前付きボリューム chat2db-community-data を使用します。両者のデータは共有されません。
  • Chat2DB Community 5.3.0 は独立した /root/.chat2db-community ディレクトリを使用し、/root/.chat2db を使用していた旧イメージのデータを自動移行しません。

セキュリティに関する注意

Chat2DB Community は、単一ユーザー向けのローカルファーストなアプリケーションです。
ユーザーアカウントや、複数ユーザー間の認可境界は提供しません。HTTP サービスは
127.0.0.1 または ::1 にバインドしたままにし、他のユーザーや
信頼できないネットワークへ公開しないでください。

カスタム JDBC ドライバーは実行可能な Java コードです。信頼できる提供元の
ドライバーだけをインストールしてください。インポートした設定ファイル、
アーカイブ、SQL ファイル、データベースの内容、AI の応答は引き続き信頼できない
データとして扱います。完全な信頼境界と脆弱性の報告手順については、
セキュリティポリシーを参照してください。

このプロジェクトが役に立ったら、ぜひ Star ⭐️ をお願いします!

暗号化キー

Chat2DB Community は、保存されたデータソースパスワードと AI モデル API キーを、インストールごとのキーを使って AES-256-GCM で暗号化します。リポジトリのチェックアウト内で一度だけ作成してください(openssl が必要です):

bash
./script/security/init-community-encryption-key.sh

キーは ~/.config/chat2db-community/encryption.key に書き込まれます。このファイルは別途バックアップし、アップグレードやコンテナ再作成後も保持してください。 キーを置き換えたり失ったりすると、保存済みのデータソースパスワードと AI モデル API キーを復号できなくなります。有効なキーが与えられていない場合、Web/headless 起動は失敗します。存在しないキーを自動生成するのは Desktop モードだけです。

キー設定リファレンス(カスタムパス、解決順序、検証)

キーは有効な Base64 で、デコード後に正確に 32 バイトでなければなりません。付属の初期化スクリプトは、末尾が = の 44 文字の Base64 からなる標準のパディング付き形式を生成します。これは暗号化用のキーマテリアルであり、人が読めるパスワードではありません。データソースパスワードと AI API キーは同じキーを使用しますが、認証された AAD 値がそれぞれ別であるため、一方の用途の暗号文をもう一方として復号することはできません。

カスタムパスを使用する場合は、スクリプトにそのパスを渡し、Chat2DB の起動時にも同じパスを設定します:

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

スクリプトが使用するキーファイルパスの優先順位は、位置引数、CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE、デフォルトパスの順です。スクリプトは有効な通常ファイルを再利用し、シンボリックリンクと通常ファイル以外を拒否し、無効なファイルの上書きを拒みます。キーは Chat2DB プロセスの所有者だけが読み取れる状態に保ってください。

キー設定は次の順序で解決されます:

  1. Base64 キーを含む JVM プロパティ chat2db.community.encryption-key。
  2. Base64 キーを含む環境変数 CHAT2DB_COMMUNITY_ENCRYPTION_KEY。
  3. キーファイルのパスを含む JVM プロパティ chat2db.community.encryption-key-file。
  4. キーファイルのパスを含む環境変数 CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE。
  5. デフォルトファイル ~/.config/chat2db-community/encryption.key。

最初に設定されている値が優先されます。空の値、不正な Base64、デコード後に 32 バイトにならないキー、無効なキーファイルは、次の設定ソースへフォールバックせずに起動を失敗させます。キー値をプロセス引数や環境変数に直接置かずに済むため、ファイルベースの設定を推奨します。

キーファイルの自動生成は chat2db.gui ではなく chat2db.mode に依存します。Community Desktop モード(chat2db.runtime.mode=community かつ chat2db.mode=DESKTOP)は、インラインキーが設定されておらず、選択されたキーファイルが存在しない場合にそのファイルを作成します。通常の Web/headless 起動を含む Desktop 以外のモードは、存在しないキーを決して作成せず、有効なキーが提供または初期化されるまで起動に失敗します。解決されたキーはプロセスの存続期間中キャッシュされるため、キー設定を変更した場合はアプリケーションの再起動が必要です。

ソースからビルド

前提条件

リポジトリのクローン

bash
git clone https://github.com/OtterMind/Chat2DB.git

フロントエンド

リポジトリに含まれる Yarn lockfile を使用してください。

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

バックエンド

bash
cd Chat2DB
mvn -B clean package -Dmaven.test.skip=true -Dchat2db.finalName=chat2db-community \
    -f chat2db-community-server/pom.xml \
    -pl chat2db-community-start -am
./script/security/init-community-encryption-key.sh
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.gui=false \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file="$HOME/.config/chat2db-community/encryption.key" \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -Dspring.profiles.active=dev \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

ローカル Docker イメージのビルド

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

Community 版と商用版の違い

Community 版には、カスタム AI モデルのサポートを含め、上記で説明したローカルデータベースクライアントの全機能が含まれています。商用の Pro 版と Enterprise 版は同じコアを基盤とし、ホスティングされた AI サービス、ユーザーアカウント、クラウドストレージとマルチデバイス同期、チームコラボレーションとガバナンス機能を追加します。詳細は chat2db.ai を参照してください。

コントリビューション

コミュニティからのバグ報告、機能リクエスト、ドキュメント改善、テストフィードバック、Pull Request を歓迎します。

Issue の作成や Pull Request の送信前に、コントリビューションガイドをお読みください。バグの報告方法、改善の提案方法、メンテナーがレビューしやすい形で貢献する方法を説明しています。

  • バグや機能リクエストには GitHub Issues を使用してください。
  • 質問、セットアップ支援、自由な議論には GitHub Discussions を使用してください。
  • Pull Request が Issue に関連する場合は、PR の説明に Issue へのリンクを含めてください。

コミュニティとサポート

謝辞

Chat2DB に貢献してくださったすべての方々に感謝します。

ライセンス

Chat2DB Community バージョン 5.3.0 以降は、
このリポジトリのライセンス条項の下で提供されます。これは
Apache License 2.0 を基礎として追加条件を設けた Source Available
ライセンスです。バージョン 5.3.0 より前に公開された Chat2DB のリリース
(バージョン 0.3.7 およびそれ以前の履歴タグを含む)には、引き続き
Apache License 2.0 が適用されます。


File: README_KO.md

개발자, DBA, 분석가 및 데이터 팀을 위한 AI 기반 데이터베이스 클라이언트이자 SQL 워크스페이스입니다.

Chat2DB란 무엇인가요?

Chat2DB Community는 Windows, macOS, Linux를 지원하는 무료 크로스 플랫폼 데이터베이스 클라이언트입니다. 전적으로 사용자의 컴퓨터에서 실행되며, 완전한 기능을 갖춘 SQL 워크스페이스와 사용자가 직접 연결하는 자체 AI 모델 기반의 AI 어시스턴트를 결합했습니다.

  • 40개 이상의 데이터베이스 — MySQL, PostgreSQL, Oracle, SQL Server, ClickHouse, MongoDB, Redis, SQLite, MariaDB, TiDB, Hive, DB2, Snowflake, BigQuery, Elasticsearch, Trino, TimescaleDB, Greenplum, YugabyteDB, CrateDB, QuestDB, Apache IoTDB, Firebird, HSQLDB, Apache Derby 등을 플러그인으로 지원하며, 새로운 JDBC 데이터베이스는 코드 수정 없이 설정만으로 추가할 수 있습니다.
  • SQL 워크스페이스 — 편집, 자동 완성, 서식 지정, 실행, 저장된 SQL 및 실행 기록을 제공합니다.
  • AI 어시스턴트 — 자체 AI 모델을 연결하여 자연어로 SQL을 생성, 설명 및 최적화합니다.
  • 데이터베이스 관리 — 메타데이터 탐색, 테이블 및 객체 관리(DDL/DML), 데이터 직접 편집을 지원합니다.
  • 데이터 가져오기 및 내보내기, 대시보드 및 차트, 그리고 **MCP를 지원하는 오픈 소스 CLI**를 제공합니다.

스크린샷

대시보드 및 차트 ER 다이어그램
시각적 데이터 관리 데이터 가져오기 및 내보내기

얼리 프리뷰

다음 기능 라인은 정규 Beta 채널에 도달하기 전에 얼리 프리뷰로 공개됩니다.

  • Chat2DB Community 5.4.0-beta.1(얼리 프리뷰) — macOS, Windows, Linux 설치 파일.
  • 스킬, 외부 MCP 서버, 파일 및 터미널 도구를 포함한 선택적 로컬 에이전트 런타임을 추가합니다. AI 입력창의 런타임 선택기에서 Pi Agent를 선택하면 활성화됩니다(처음 선택할 때 확인 후 런타임을 내려받습니다).
  • 이 프리뷰는 안정 버전도, 정규 Beta도 아닙니다. Latest는 안정 버전으로 유지되고 정규 Beta 라인은 5.3.8-beta.x로 이어집니다. 앱에서 받으려면 설정 → Chat2DB 정보에서 Beta 버전 받기를 켜세요.

빠른 시작

옵션 1: 데스크톱 앱

GitHub Releases에서 사용 중인 플랫폼용 설치 프로그램을 다운로드하여 설치한 다음 데이터베이스에 연결을 시작하세요. 추가 설정은 필요하지 않습니다.

옵션 2: Docker

요구 사항: Docker 19.03.0 이상, Docker Compose 2.0.0 이상(Compose V2, Compose 방식에만 필요), CPU 코어 2개 이상, RAM 4GiB 이상.

먼저 암호화 키를 생성하고(중요한 이유는 암호화 키를 참조하세요), 그다음 컨테이너를 시작하세요.

bash
# 저장소 체크아웃에서 한 번 실행하세요. 다시 실행하면 기존의 유효한 키를 재사용합니다.
git clone https://github.com/OtterMind/Chat2DB.git && cd Chat2DB
./script/security/init-community-encryption-key.sh

docker run --detach \
  --name chat2db-community \
  --restart unless-stopped \
  --publish 127.0.0.1:10825:10825 \
  --volume "$HOME/.chat2db-community-docker:/root/.chat2db-community" \
  --env CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE=/run/secrets/chat2db-community-encryption.key \
  --volume "$HOME/.config/chat2db-community/encryption.key:/run/secrets/chat2db-community-encryption.key:ro" \
  chat2db/chat2db:latest

그다음 브라우저에서 http://localhost:10825를 여세요.

또는 저장소에 포함된 Compose 정의를 사용할 수 있습니다.

bash
./script/security/init-community-encryption-key.sh
docker compose --file docker/docker-compose.yml up --detach

참고 사항:

  • 업데이트하려면 새 이미지를 가져오고 기존 컨테이너를 제거한 다음 시작 명령을 다시 실행하세요. 컨테이너를 다시 빌드할 때도 ~/.config/chat2db-community/encryption.key를 유지하세요.
  • docker run 예시는 애플리케이션 데이터를 $HOME/.chat2db-community-docker에 저장하고, Compose 정의는 chat2db-community-data라는 이름이 지정된 볼륨을 사용합니다. 두 위치의 데이터는 공유되지 않습니다.
  • Chat2DB Community 5.3.0은 독립적인 /root/.chat2db-community 디렉터리를 사용하며, /root/.chat2db를 사용하던 이전 이미지의 데이터를 자동으로 마이그레이션하지 않습니다.

보안 참고 사항

Chat2DB Community는 단일 사용자용 로컬 우선 애플리케이션입니다. 사용자 계정이나
여러 사용자 사이의 권한 경계를 제공하지 않습니다. HTTP 서비스는
127.0.0.1 또는 ::1에 바인딩된 상태로 유지하고, 다른 사용자나
신뢰할 수 없는 네트워크에 노출하지 마세요.

사용자 지정 JDBC 드라이버는 실행 가능한 Java 코드입니다. 신뢰할 수 있는
출처의 드라이버만 설치하세요. 가져온 구성 파일, 압축 파일, SQL 파일,
데이터베이스 내용과 AI 응답은 계속 신뢰할 수 없는 데이터로 취급해야 합니다.
전체 신뢰 경계와 취약점 신고 절차는 보안 정책을
참조하세요.

이 프로젝트가 유용하다고 생각되시면 Star ⭐️를 눌러주세요!

암호화 키

Chat2DB Community는 저장된 데이터 소스 비밀번호와 AI 모델 API 키를 설치별 키를 사용하여 AES-256-GCM으로 암호화합니다. 저장소 체크아웃에서 키를 한 번 생성하세요(openssl이 필요합니다).

bash
./script/security/init-community-encryption-key.sh

키는 ~/.config/chat2db-community/encryption.key에 기록됩니다. 이 파일을 별도로 백업하고 업그레이드와 컨테이너 재빌드 후에도 유지하세요. 키를 교체하거나 분실하면 이전에 저장한 데이터 소스 비밀번호와 AI 모델 API 키를 읽을 수 없습니다. 유효한 키가 제공되지 않으면 웹/헤드리스 시작은 실패하며, Desktop 모드만 누락된 키를 자동으로 생성합니다.

키 구성 참조(사용자 지정 경로, 결정 순서, 유효성 검사)

키는 디코딩 시 정확히 32바이트가 되는 유효한 Base64여야 합니다. 제공되는 초기화 도구는 표준 패딩 형식, 즉 =으로 끝나는 44자의 Base64를 생성합니다. 이는 사람이 읽을 수 있는 비밀번호가 아니라 암호화 키 자료입니다. 데이터 소스 비밀번호와 AI API 키는 서로 다른 인증 AAD 값과 동일한 키를 사용하므로 한 용도의 암호문을 다른 용도로 복호화할 수 없습니다.

사용자 지정 경로를 사용하려면 스크립트에 경로를 전달하고 Chat2DB를 시작할 때 동일한 경로를 구성하세요.

bash
./script/security/init-community-encryption-key.sh /secure/path/chat2db-community.key

java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.gui=false \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file=/secure/path/chat2db-community.key \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

스크립트의 키 파일 경로 우선순위는 위치 인수, CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE, 기본 경로 순입니다. 스크립트는 유효한 일반 파일을 재사용하고 심볼릭 링크와 일반 파일이 아닌 파일을 거부하며, 유효하지 않은 파일을 덮어쓰지 않습니다. 키는 Chat2DB 프로세스 소유자만 읽을 수 있도록 유지하세요.

키 구성은 다음 순서로 결정됩니다.

  1. Base64 키가 포함된 JVM 속성 chat2db.community.encryption-key.
  2. Base64 키가 포함된 환경 변수 CHAT2DB_COMMUNITY_ENCRYPTION_KEY.
  3. 키 파일 경로가 포함된 JVM 속성 chat2db.community.encryption-key-file.
  4. 키 파일 경로가 포함된 환경 변수 CHAT2DB_COMMUNITY_ENCRYPTION_KEY_FILE.
  5. 기본 파일 ~/.config/chat2db-community/encryption.key.

처음 구성된 값이 최종 기준입니다. 빈 값, 잘못된 Base64, 디코딩 시 32바이트가 아닌 키 또는 유효하지 않은 키 파일이 있으면 다음 소스로 넘어가지 않고 시작에 실패합니다. 키 값을 프로세스 인수나 환경 변수에 직접 넣지 않을 수 있으므로 파일 기반 구성을 권장합니다.

키 파일 자동 생성 여부는 chat2db.gui가 아니라 chat2db.mode에 따라 결정됩니다. Community Desktop 모드(chat2db.runtime.mode=community 및 chat2db.mode=DESKTOP)에서는 인라인 키가 구성되지 않았고 선택한 키 파일이 없을 때 해당 파일을 생성합니다. 일반 웹/헤드리스 시작을 포함한 모든 비 Desktop 모드에서는 누락된 키를 절대 생성하지 않으며, 유효한 키가 제공되거나 초기화될 때까지 시작에 실패합니다. 확인된 키는 프로세스 수명 동안 캐시되므로 키 구성을 변경한 후에는 애플리케이션을 다시 시작해야 합니다.

소스에서 빌드

사전 요구 사항

저장소 복제

bash
git clone https://github.com/OtterMind/Chat2DB.git

프런트엔드

저장소에 포함된 잠금 파일과 함께 Yarn을 사용하세요.

bash
cd Chat2DB/chat2db-community-client
yarn install --frozen-lockfile
yarn run start:community:hot

백엔드

bash
cd Chat2DB
mvn -B clean package -Dmaven.test.skip=true -Dchat2db.finalName=chat2db-community \
    -f chat2db-community-server/pom.xml \
    -pl chat2db-community-start -am
./script/security/init-community-encryption-key.sh
java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \
    -Dchat2db.gui=false \
    -Dchat2db.runtime.mode=community \
    -Dchat2db.mode=WEB \
    -Dchat2db.network.status=OFFLINE \
    -Dchat2db.community.encryption-key-file="$HOME/.config/chat2db-community/encryption.key" \
    -Dserver.address=127.0.0.1 \
    -Dserver.port=10825 \
    -Dspring.profiles.active=dev \
    -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar

로컬 Docker 이미지 빌드

bash
./docker/docker-build.sh 5.3.0 chat2db/chat2db:5.3.0

Community와 상용 에디션 비교

Community 에디션에는 사용자 지정 AI 모델 지원을 포함하여 위에서 설명한 로컬 데이터베이스 클라이언트의 전체 기능이 들어 있습니다. 상용 버전인 Pro와 Enterprise 에디션은 동일한 핵심 기능 위에 호스팅 AI 서비스, 사용자 계정, 클라우드 저장소 및 다중 기기 동기화, 팀 협업 및 거버넌스 기능을 추가합니다. 자세한 내용은 chat2db.ai를 참조하세요.

기여하기

커뮤니티의 버그 보고, 기능 요청, 문서 개선, 테스트 피드백 및 Pull Request를 환영합니다.

Issue를 열거나 Pull Request를 제출하기 전에 기여 가이드를 읽어 주세요. 버그 보고, 개선 제안 및 유지 관리자가 기여 내용을 더 쉽게 검토할 수 있도록 하는 방법을 안내합니다.

  • 버그 및 기능 요청은 GitHub Issues를 이용해 주세요.
  • 질문, 설정 도움말 및 자유로운 논의는 GitHub Discussions를 이용해 주세요.
  • Pull Request가 Issue와 관련되어 있다면 PR 설명에 해당 Issue 링크를 포함해 주세요.

커뮤니티 및 지원

감사의 말

Chat2DB에 기여해 주신 모든 분께 감사드립니다.

라이선스

Chat2DB Community 버전 5.3.0 이상에는
이 저장소의 라이선스 조건이 적용됩니다. 이는 Apache License 2.0을
기반으로 추가 조건이 포함된 소스 공개 라이선스입니다. 버전 0.3.7과 그 이전의
과거 태그를 포함하여 5.3.0보다 먼저 게시된 Chat2DB 릴리스에는 Apache License
2.0이 계속 적용됩니다.

2. Official Technical Reference & Guides (OtterMind/Chat2DB-docs)

File: README.md

Website

This website is built using Docusaurus 2, a modern static website generator.

Installation

text
$ yarn

Local Development

text
$ yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

text
$ yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

Using SSH:

text
$ USE_SSH=true yarn deploy

Not using SSH:

text
$ GIT_USER=<Your GitHub username> yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.


File: docs/index.md


title: 'Chat2DB简介' sidebar_position: 1

📖 简介

   Chat2DB 是一款有开源免费的多数据库客户端工具,支持windows、mac本地安装,也支持服务器端部署,web网页访问。和传统的数据库客户端软件Navicat、DBeaver 相比Chat2DB集成了AIGC的能力,能够将自然语言转换为SQL,也可以将SQL转换为自然语言,可以给出研发人员SQL的优化建议,极大的提升人员的效率,是AI时代数据库研发人员的利器,未来即使不懂SQL的运营业务也可以使用快速查询业务数据、生成报表能力。

✨ 特性

  • 🍎 Chat2DB整体的设计简单易用,没有任何花里胡哨的东西,符合技术人喜欢简洁的特点。
  • 👩 为了不同类型用户群里的喜爱,同时支持客户端版、web版,同时也支持客户端版连接远程服务。 前端使用 Electron 开发,提供 Windows、Mac、Linux 客户端、网页版本一体化的解决方案
  • 🔧 突出了AI 智能生成SQL、SQL解析的的能力,但在传统数据库能力方便一点都不少。
  • 🔌 强大的扩展能力,目前已经支持Mysql、PostgreSQL、Oracle、SQLServer、ClickHouse、Oceanbase、H2、SQLite等等,未来会支持更多的数据库
  • ⚙️ 强大的数据管理能力,支持数据表、视图、存储过程、函数、触发器、索引、序列、用户、角色、授权等管理
  • 👭 支持团队协作,研发无需知道线上数据库密码,解决企业数据库账号安全问题
  • 🎁 支持环境隔离、线上、日常数据权限分离

📑 Github地址

🔌 支持的数据库

  • Mysql
  • PostgreSQL
  • Oracle
  • SQLServer
  • ClickHouse
  • Oceanbase
  • H2
  • SQLite
  • 更多数据库支持中...

☎️ 联系我们

微信:yxccw132