MCPcopy Index your code
hub / github.com/dbcli/mssql-cli

github.com/dbcli/mssql-cli @1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0 ↗ · + Follow
976 symbols 3,517 edges 93 files 290 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PyPI Python 2.7|3.4|3.5|3.6|3.7|3.8

mssql-cli

mssql-cli is an interactive command line query tool for SQL Server. This open source tool works cross-platform and proud to be a part of the dbcli community.

mssql-cli Autocomplete

mssql-cli supports a rich interactive command line experience, with features such as: - Auto-completion: fewer keystrokes needed to complete complicated queries. - Syntax highlighting: highlights T-SQL keywords. - Query history: easily complete an auto-suggested query that was previously executed. - Configuration file support: customize the mssql-cli experience for your needs. - Multi-line queries: execute multiple queries at once using the multi-line edit mode. - Non-interactive support: execute a query without jumping into the interactive experience.

Quick Start

Read the section below to quickly get started with mssql-cli. Consult the usage guide for a deeper dive into mssql-cli features.

Install mssql-cli

Platform-specific installation instructions are below: | Windows | macOS | Linux | | - | - | - |

Visit the installation reference guide to view all supported releases and downloads.

Install with Linux Package Manager

Follow the Linux installation instructions to install mssql-cli using apt-get, yum, and other Linux package managers.

Install with pip

python -m pip install mssql-cli

Please refer to the pip installation docs for more platform-specific information.

Connect to Server

Complete the command below to connect to your server:

mssql-cli -S <server URL> -d <database name> -U <username> -P <password>

Exit mssql-cli

Press Ctrl+D or type quit.

Show Options

For general help content, pass in the -h parameter:

mssql-cli --help

Usage Docs

Please refer to the usage guide for details on options and example usage. If you are having any issues using mssql-cli, please see the troubleshooting guide.

Telemetry

The mssql-cli tool includes a telemetry feature. Please refer to the telemetry guide for more information.

Contributing

If you would like to contribute to the project, please refer to the development guide.

Contact Us

If you encounter any bugs or would like to leave a feature request, please file an issue in the Issues section of our GitHub repo.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

mssql-cli is licensed under the BSD-3 license.

Core symbols most depended-on inside this repo

format
called by 175
mssqlcli/jsonrpc/contracts/connectionservice.py
result_set
called by 87
tests/metadata.py
suggest_type
called by 82
mssqlcli/packages/sqlcompletion.py
get
called by 73
mssqlcli/packages/special/namedqueries.py
execute_query
called by 56
mssqlcli/mssql_cli.py
function
called by 40
tests/metadata.py
extract_tables
called by 36
mssqlcli/packages/parseutils/tables.py
get_result
called by 34
tests/metadata.py

Shape

Method 456
Function 439
Class 71
Route 10

Languages

Python100%

Modules by API surface

tests/test_sqlcompletion.py79 symbols
tests/test_smart_completion_public_schema_only.py72 symbols
mssqlcli/mssqlcompleter.py59 symbols
tests/test_smart_completion_multiple_schemata.py48 symbols
tests/parseutils/test_parseutils.py38 symbols
mssqlcli/mssql_cli.py35 symbols
mssqlcli/jsonrpc/contracts/queryexecutestringservice.py32 symbols
tests/test_globalization.py31 symbols
tests/metadata.py29 symbols
mssqlcli/mssqlcliclient.py26 symbols
mssqlcli/telemetry.py23 symbols
mssqlcli/jsonrpc/jsonrpcclient.py23 symbols

For agents

$ claude mcp add mssql-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact