Command-line tool
mongosh
brew/mongosh
Checked 26 Oct 2026, 08:31 UTC · Still published on npm
MongoDB Shell to connect, configure, query, and work with your MongoDB database mongosh mongodb mongo shell
At a glance
- Type
- Command-line tool
- Install on
- Windows, macOS, Linux
- Last checked
- 26 Oct 2026, 08:31 UTC
Install it
Windows
npm install -g @mongosh/cli-repl npm install -g mongosh scoop bucket add extras; scoop install extras/mongosh
macOS
brew install mongosh npm install -g @mongosh/cli-repl npm install -g mongosh
Linux
brew install mongosh npm install -g @mongosh/cli-repl npm install -g mongosh
Connect to a local database on the default port (`mongodb://localhost:27017`)
mongosh
Connect to a database
mongosh --host host --port port db_name
Authenticate using the specified username on the specified database (you will be prompted for a password)
mongosh --host host --port port --username username --authenticationDatabase authdb_name db_name
Browse
Related command-line tools
- MongoDB Shell
The legacy MongoDB shell. See `mongosh` for the new shell. Note: All connection options can be replaced with one… - cypher-shell
Command-line shell where you can execute Cypher against Neo4j - mongodb
A document database with the scalability and flexibility. - MongoDB CLI
MongoDB CLI (Windows package; no description in the winget index) mongodb db mongo shell - duckdb
Embeddable SQL OLAP Database Management System - mongodb-atlas-cli
Atlas CLI enables you to manage your MongoDB Atlas database mongodb cloud cli atlas cloud-management - Snowflake SnowSQL
SnowSQL client for Snowflake's Data Cloud. database sql 数据库 snowflake - dbx-cli
Command-line interface for DBX database connections, schema, and safe queries rust database mongodb mysql postgresql…
Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents