DEV.co
Open-Source Databases · dbcli

mycli

Mycli is a terminal client for MySQL and compatible databases (MariaDB, Percona, TiDB, Apache Doris) that provides auto-completion, syntax highlighting, and a modern command-line experience. It simplifies database interaction for developers and DBAs who work frequently with MySQL-compatible systems.

Source: GitHub — github.com/dbcli/mycli
11.9k
GitHub stars
695
Forks
Python
Primary language
BSD-3-Clause
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorydbcli/mycli
Ownerdbcli
Primary languagePython
LicenseBSD-3-Clause — OSI-approved
Stars11.9k
Forks695
Open issues11
Latest releasev2.1.1 (2026-07-08)
Last updated2026-07-08
Sourcehttps://github.com/dbcli/mycli

What mycli is

Written in Python using prompt_toolkit, mycli offers context-aware SQL completion, fuzzy history search via fzf, Pygments-based syntax highlighting, SSL support, and LLM integration for schema-aware queries. It requires Python 3.10+ and connects via PyMySQL, supporting multiline queries and output redirection.

Quickstart

Get the mycli source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/dbcli/mycli.gitcd mycli# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Local and remote MySQL development workflows

Primary use case: developers and DBAs who need fast, interactive MySQL access with intelligent completion for table/column names and context-sensitive suggestions (e.g., suggesting columns after WHERE).

Ad-hoc SQL query exploration and debugging

Replaces basic mysql CLI with tabular output, query timing, syntax highlighting, and fuzzy history search to quickly iterate on queries and diagnose issues.

Cross-compatible database access

Single unified tool for teams using MySQL, MariaDB, Percona, TiDB, or Apache Doris, reducing context-switching and training overhead.

Implementation considerations

  • Python 3.10+ required; pip/package-manager installation straightforward (pip install mycli[all], brew, apt, dnf, AUR supported).
  • First run auto-generates ~/.myclirc config file; users should review SSL settings, keyring password storage, and LLM integration toggles for their security posture.
  • Optional dependencies (fzf, Pygments) enhance UX but are not required; plan installation strategy based on OS package availability.
  • Windows support is partial/unsupported; native Windows users may encounter issues. WSL2 or macOS/Linux strongly preferred.
  • Credentials stored in system keyring when enabled; ensure host OS keyring is secured and documented for team access policies.

When to avoid it — and what to weigh

  • Scripted or CI/CD automation pipelines — Mycli is designed for interactive terminal use. For automation, use mysql CLI client or programmatic libraries (PyMySQL, SQLAlchemy); interactive features add overhead.
  • Production incident response at scale — Not designed for high-throughput batch operations or complex stored procedure debugging. Better suited for ad-hoc queries; heavy transactional load testing should use native drivers.
  • Non-MySQL database ecosystems — Specific to MySQL and MySQL-compatible databases. For PostgreSQL, use pgcli; for other databases, use native or language-specific tools.
  • Teams requiring fully offline operation — LLM feature and some optional dependencies may require network access. Limited Windows/WSL support means native Windows deployments need testing and PR support.

License & commercial use

BSD-3-Clause (Revised License). This is a permissive OSI-approved license allowing commercial use, modification, and distribution, provided copyright notice and license text are retained and the disclaimer is included.

BSD-3-Clause permits commercial use. No license restrictions on deploying mycli in commercial environments (e.g., bundling with paid tools, internal enterprise use). However, verify that all dependencies (PyMySQL, prompt_toolkit, Pygments, fzf, Click) are also compatible with your commercial use case; each has its own license (typically permissive, but requires review).

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Mycli stores credentials via system keyring when enabled (no plaintext in config by default). SSL/TLS support for encrypted MySQL connections is available. Passwords can be entered interactively or via keyring. LLM feature sends schema context to external service—review data privacy before enabling. No known CVEs reported in provided data, but dependencies (PyMySQL, prompt_toolkit) should be kept updated. No formal security audit mentioned.

Alternatives to consider

pgcli

Equivalent tool for PostgreSQL. Use if primary database is PostgreSQL instead of MySQL.

Native mysql CLI

Built-in, no installation required. Lacks auto-completion, syntax highlighting, and modern UX; suitable for scripts/automation rather than interactive development.

DBeaver / DataGrip

Full-featured database IDEs with GUI, multi-database support, and visual query builders. Heavier weight; better for complex schema exploration but overkill for CLI-first workflows.

Software development agency

Build on mycli with DEV.co software developers

Review the implementation checklist and security considerations above. For production deployments, test on your target platform (macOS/Linux preferred) and verify all dependencies meet your license compliance requirements.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

mycli FAQ

Can I use mycli in production scripts?
Not recommended. Mycli is designed for interactive terminal use. For automation, use mysql CLI client or programmatic drivers (PyMySQL, SQLAlchemy) to avoid interactive UI overhead and ensure deterministic behavior.
Does mycli work on Windows?
Partially. Native Windows support is not officially supported; basic features work but with known limitations. Windows Subsystem for Linux (WSL) is recommended for better compatibility.
How do I save and reuse queries?
Use favorite queries: save with `/fs <alias> <query>` and execute with `/f <alias>`. Supports optional positional parameters. All queries are logged to a file if enabled in config.
What databases does mycli support?
MySQL, MariaDB, Percona, TiDB, and Apache Doris. Any MySQL-compatible database should work via the same PyMySQL connector.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like mycli into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Evaluate Mycli for Your Team

Review the implementation checklist and security considerations above. For production deployments, test on your target platform (macOS/Linux preferred) and verify all dependencies meet your license compliance requirements.