Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

mongosh

> 前端框架
Open source

The MongoDB Shell

395 stars0 likes3 views
WebsiteGitHub

About

The MongoDB Shell

mongosh

Evergreen Waterfall CI

The MongoDB Shell

This repository is a monorepo for all the various components in the MongoDB Shell across all environments (REPL, Browser, Compass, etc).

For our official documentation, please visit MongoDB Docs page.

MongoDB Shell works with MongoDB servers >= 4.0.

Installation

You can get the release tarball from our Downloads Page. We currently maintain MongoDB Shell on three different platforms - Windows (zip), MacOS (zip) and Linux (tgz, deb and rpm). Once downloaded, you will have to extract the binary and add it to your PATH variable. For detailed instructions for each of our supported platforms, please visit installation documentation.

Alternatively:

  • Run npx mongosh to run mongosh without a full installation. This is easiest if you already have npm installed.
  • Run download_latest.sh to download a mongosh binary. You can use the following script:
bash
curl -fsSL https://raw.githubusercontent.com/mongodb-js/mongosh/refs/heads/main/download_latest.sh | sh

CLI Usage

…

Local Development

Requirements

  • Node.js v24.x

Install

bash
npm run bootstrap
npm run compile-cli

Running Tests

Run all tests (this may take some time):

bash
npm test

Run tests from a specific package:

bash
npm -w @mongosh/cli-repl run test

To test against a specific version, the MONGOSH_SERVER_TEST_VERSION environment variable can be set to a semver string specifying a server version, e.g. MONGOSH_SERVER_TEST_VERSION='>= 7.0.0-rc0' npm -w @mongosh/cli-repl run test.

Starting the CLI

Via npm:

bash
npm run start 

This will compile all Typescript dependencies of the CLI package first.

Alternatively you can also run start inside the cli-repl package, if you're sure everything else is compiled:

bash
npm run -w @mongosh/cli-repl start 

Compiling

Compile all Typescript:

bash
npm run compile

Compile just the CLI ands its dependencies:

bash
npm run compile-cli

Compile the standalone executable (this may take some time):

bash
npm run compile-exec

Relevant environment variables for compiling are:

  • NODE_JS_VERSION: Specify a Node.js version to use for compilation, e.g. 16.15.0 or 16.x
  • BOXEDNODE_CONFIGURE_ARGS: Node.js configure flags as a comma-separated list or JSON array, e.g. --shared-openssl,--shared-zlib
  • BOXEDNODE_MAKE_ARGS: Node.js make args (no distinction from BOXEDNODE_CONFIGURE_ARGS on Windows) as a comma-separated list or JSON array, e.g. -j12

Compile a specific package, e.g. the .deb for Debian:

bash
npm run compile-exec
npm run evergreen-release package -- --build-variant=deb-x64

Compilation and packaging output is written to dist/.

Releasing

Refer to the build package documentation.

Contributing

For issues, please create a ticket in our JIRA Project.

For contributing, please refer to CONTRIBUTING.md.

Is there anything else you’d like to see in MongoDB Shell? Let us know by submitting suggestions in our feedback forum.

License

Apache-2.0

Issues· 26 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptcompasscompass-plugindrivermongodb

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架