Add MongoDB Shell (mongosh) installation support#161
Merged
Conversation
Copilot
AI
changed the title
[WIP] Add installing shell capability to the tool
Add MongoDB Shell (mongosh) installation support
Oct 24, 2025
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
…alidation Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
7e02434 to
b9c9651
Compare
thanks copilot closes #160
9adb4e0 to
0468c7d
Compare
0468c7d to
ef4abbd
Compare
Owner
|
@copilot Review and update this PR description to accurately reflect the changes. |
Co-authored-by: aheckmann <166834+aheckmann@users.noreply.github.com>
Contributor
Author
Updated the PR description to accurately reflect the implementation. Key changes:
All documentation (README and help text) now matches the actual implementation. Commit: aa0780d Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds the ability to install and manage MongoDB Shell (mongosh) versions directly through the
mtool, addressing issue #160. Users can now install mongosh just like they install MongoDB server and Database Tools.Motivation
MongoDB Shell (mongosh) is released separately from the MongoDB server starting with MongoDB 6.0+. Previously, users had to manually install mongosh via package managers (e.g., brew on macOS) or download it manually. This PR brings mongosh management into the
mtool, providing a consistent interface for managing all MongoDB components.New Features
MongoDB Shell Installation Commands
Enhanced Shell Execution
The
m shell <version> [args...]command now intelligently handles both mongosh and legacy mongo shells:mongoshell from the MongoDB server installation if mongosh is not installedDatabase Tools Enhancement
Added
rmsupport for Database Tools:# Remove Database Tools versions $ m tools rm 100.9.0 100.9.1Implementation Details
The implementation follows the same patterns established for Database Tools management:
Core Functions:
SHELL_DIRconfiguration variable for version storage ($M_PREFIX/m/shell/versions/)get_all_shell_versions()fetches available versions from mongodb-js/mongosh GitHub releasesinstall_shell_bin()downloads and installs mongosh binaries from downloads.mongodb.com/compassinstall_shell()activates a specific mongosh versioncheck_current_shell_version()detects the currently active versionlist_shell_versions()anddisplay_shell_versions()provide version listingsremove_shell_versions()removes installed mongosh versionshandle_mongosh()dispatches mongosh subcommandsPlatform Support:
UX Improvements:
m mongoshshows installed versions (consistent withmandm tools)m,m tools, andm mongoshBackward Compatibility
The implementation maintains full backward compatibility:
m shell <version> [args...]continues to work, now with intelligent mongosh/mongo fallbacks,sh,mongo) continue to workTesting
Added comprehensive test coverage in
test/suite.mjs:Documentation
Updated both inline help (
m --help) and README.md with:Example Usage
Fixes #160
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.