Skip to main content

CLI-First, AI-Native database management tool — open-source Navicat alternative

Project description

OpenNavicat

CLI-First, AI-Native Database Management Tool

A free, open-source alternative to Navicat Premium, built with Python.

Python 3.10+ License: MIT PRs Welcome Issues

English | 简体中文


English

What is OpenNavicat?

OpenNavicat is a full-featured database management tool inspired by Navicat Premium. It provides both a CLI-first interface and an optional GUI (PySide6/Qt), with built-in AI capabilities for natural language queries, SQL optimization, and schema design.

Highlights

  • CLI-First — Every operation has a CLI command. AI (LLM) can call CLI directly.
  • AI-Native — Natural language to SQL, query optimization, auto-fix broken SQL, intelligent data generation.
  • Full GUI — Navicat-like graphical interface with object browser, SQL editor, table designer, data viewer, BI dashboard, and more.
  • Multi-Database — MySQL/MariaDB + PostgreSQL.
  • 7 Export Formats — CSV, JSON, XML, HTML, SQL, TXT, Excel.
  • Open Source — MIT License. Free for personal and commercial use.

Quick Start

# Install
pip install open-navicat

# Add a connection
opennavicat conn add --name prod --host db.example.com --user root --test

# Activate connection
opennavicat conn open prod

# Natural language query
opennavicat query nl "show me the top 10 customers by revenue"

# Execute SQL
opennavicat query run "SELECT COUNT(*) FROM users"

# Launch GUI
opennavicat gui

AI Features

Command Description Example
query nl Natural language → SQL → Execute query nl "users registered last 7 days"
ai optimize SQL performance analysis ai optimize "SELECT * FROM t WHERE YEAR(d)=2026"
ai explain Plain language SQL explanation ai explain "SELECT ... LEFT JOIN ..."
ai fix Fix broken SQL queries ai fix "SELCT * FORM users"
ai chat Interactive data analysis ai chat --conn prod
ai agent ReAct multi-step reasoning ai agent "query all active users" --db mydb
ai config Configure AI provider ai config --provider deepseek --api-key sk-xxx
ai test Test AI connection ai test
ai chat-history View/clear chat history ai chat-history show
schema design AI schema design schema design "blog: users, posts, comments" --deploy
data generate Intelligent test data data generate mydb.users --count 1000

CLI Commands

opennavicat
├── conn             Connection management
│   ├── list / add / edit / remove / test / open / close
│
├── query            SQL queries
│   ├── run / file / explain / nl / history
│
├── schema           Schema management
│   ├── databases / list / show / create / diff / sync / design
│
├── data             Data operations
│   ├── browse / export / import / generate
│
├── backup           Backup & restore
│   ├── create / restore / list / delete / history / schedule
│   ├── jobs / job-remove / job-toggle
│
├── ai               AI assistant
│   ├── ask / optimize / explain / fix / chat / tables
│   ├── agent / config / test / chat-history
│
└── gui              Launch GUI (optional)

Tech Stack

Component Technology
CLI Framework Typer + Rich
GUI Framework PySide6 (Qt 6)
Database Driver aiomysql + asyncpg (async)
SSH Tunnel asyncssh
SQL Parser sqlparse
Password Encryption cryptography (AES-GCM)
AI Engine OpenAI / DeepSeek / Ollama
Scheduler APScheduler
Packaging PyInstaller

Documentation

Document For Description
CLI Reference All users Complete CLI command reference
AI Module Developers AI architecture, prompts, provider config
Architecture Developers System architecture, module design
Security Ops/Security Encryption, transport security
Development Guide Contributors Setup, code standards, testing
Data Flow Developers Data flow diagrams
Deployment Ops Packaging, CI/CD, Docker

Contributing

We welcome contributions! Please read CONTRIBUTING.md first.

License

MIT License — Free for personal and commercial use.


简体中文

什么是 OpenNavicat?

OpenNavicat 是一款功能齐全的数据库管理工具,灵感来源于 Navicat Premium。它提供 CLI 优先 的操作方式和可选的 图形界面(PySide6/Qt),内置 AI 能力,支持自然语言查询、SQL 优化和结构设计。

核心特性

  • CLI 优先 — 每个操作都有对应的 CLI 命令,AI (LLM) 可直接调用。
  • AI 原生 — 自然语言转 SQL、查询优化、自动修复错误 SQL、智能数据生成。
  • 完整 GUI — 类 Navicat 图形界面,包含对象浏览器、SQL 编辑器、表设计器、数据查看器、BI 看板等。
  • 多数据库 — MySQL/MariaDB + PostgreSQL。
  • 7 种导出格式 — CSV、JSON、XML、HTML、SQL、TXT、Excel。
  • 开源免费 — MIT 许可证,个人和商业用途均可免费使用。

快速上手

# 安装
pip install open-navicat

# 添加连接
opennavicat conn add --name prod --host db.example.com --user root --test

# 激活连接
opennavicat conn open prod

# 自然语言查询
opennavicat query nl "上个月每个品类的销售额趋势"

# 执行 SQL
opennavicat query run "SELECT COUNT(*) FROM users"

# 启动图形界面
opennavicat gui

AI 功能

命令 功能 示例
query nl 自然语言 → SQL → 执行 query nl "最近7天注册用户"
ai optimize SQL 性能分析 ai optimize "SELECT * FROM t WHERE YEAR(d)=2026"
ai explain SQL 作用解释 ai explain "SELECT ... LEFT JOIN ..."
ai fix 修复报错 SQL ai fix "SELCT * FORM users"
ai chat 交互式数据分析 ai chat --conn prod
ai agent ReAct 多步推理代理 ai agent "查询所有活跃用户" --db mydb
ai config 配置 AI 提供商 ai config --provider deepseek --api-key sk-xxx
ai test 测试 AI 连接 ai test
ai chat-history 查看/清除聊天历史 ai chat-history show
schema design AI 设计表结构 schema design "博客系统: 用户、文章、评论" --deploy
data generate 智能生成测试数据 data generate mydb.users --count 1000

技术栈

组件 技术
CLI 框架 Typer + Rich
GUI 框架 PySide6 (Qt 6)
数据库驱动 aiomysql + asyncpg(异步)
SSH 隧道 asyncssh
SQL 解析 sqlparse
密码加密 cryptography (AES-GCM)
AI 引擎 OpenAI / DeepSeek / Ollama
定时任务 APScheduler
打包 PyInstaller

贡献

欢迎贡献!请先阅读 CONTRIBUTING.md(贡献指南)。

许可证

MIT 许可证 — 个人和商业用途均可免费使用。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_navicat-0.2.0.tar.gz (178.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_navicat-0.2.0-py3-none-any.whl (225.5 kB view details)

Uploaded Python 3

File details

Details for the file open_navicat-0.2.0.tar.gz.

File metadata

  • Download URL: open_navicat-0.2.0.tar.gz
  • Upload date:
  • Size: 178.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.8 Windows/11

File hashes

Hashes for open_navicat-0.2.0.tar.gz
Algorithm Hash digest
SHA256 726d36a7dbab2f74f65c2b3515d20ec8ebf0b78c7502f99905939135e5a92609
MD5 fcb2f3eef7f3e4c58040843e50ff13d8
BLAKE2b-256 aea85169b23451f5d1f7af1183f59ed26f06a01230b9334afc2b1ee228624045

See more details on using hashes here.

File details

Details for the file open_navicat-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: open_navicat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 225.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.8 Windows/11

File hashes

Hashes for open_navicat-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55cf0f828d467621f64773d5f215217eddfde3d14070e8b55b385e99ed11fda1
MD5 83ea9076332ab1eb9680e8a329b8952e
BLAKE2b-256 95fe495774a912d7cf6f7f437b112fedf3e69d2ba7a99445a5c4eda4bb628f42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page