{"id":13531565,"url":"https://github.com/mongodb-js/mongosh","last_synced_at":"2025-05-14T00:06:31.575Z","repository":{"id":37097472,"uuid":"212473529","full_name":"mongodb-js/mongosh","owner":"mongodb-js","description":"The MongoDB Shell","archived":false,"fork":false,"pushed_at":"2025-05-05T14:11:42.000Z","size":76742,"stargazers_count":357,"open_issues_count":22,"forks_count":70,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-05T14:53:45.507Z","etag":null,"topics":["compass","compass-plugin","driver","mongodb","nodejs","react","shell"],"latest_commit_sha":null,"homepage":"https://www.mongodb.com/try/download/shell","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mongodb-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/security-test-summary.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-03T01:13:03.000Z","updated_at":"2025-05-05T14:08:15.000Z","dependencies_parsed_at":"2024-02-23T14:47:09.093Z","dependency_job_id":"5786b78a-4ede-4fbb-a5b3-de47d9922a39","html_url":"https://github.com/mongodb-js/mongosh","commit_stats":{"total_commits":3646,"total_committers":45,"mean_commits":81.02222222222223,"dds":0.7303894679100384,"last_synced_commit":"0f0681f5ed67530071c9b3811cf5e18a222b9ae4"},"previous_names":[],"tags_count":540,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-js%2Fmongosh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-js%2Fmongosh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-js%2Fmongosh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mongodb-js%2Fmongosh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mongodb-js","download_url":"https://codeload.github.com/mongodb-js/mongosh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043502,"owners_count":22004962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compass","compass-plugin","driver","mongodb","nodejs","react","shell"],"created_at":"2024-08-01T07:01:04.030Z","updated_at":"2025-05-14T00:06:31.544Z","avatar_url":"https://github.com/mongodb-js.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":["Shell"],"readme":"# mongosh\n\n[Evergreen Waterfall CI](https://evergreen.mongodb.com/waterfall/mongosh)\n\n## The MongoDB Shell\n\nThis repository is a monorepo for all the various components in the MongoDB Shell across\nall environments (REPL, Browser, Compass, etc).\n\nFor our official documentation, please visit [MongoDB Docs\npage](https://docs.mongodb.com/mongodb-shell).\n\nMongoDB Shell works with MongoDB servers \u003e= 4.0.\n\n![MongoDB Shell Example](./mongosh.gif)\n\n## Installation\nYou can get the release tarball from our [Downloads\nPage](https://www.mongodb.com/try/download/shell). We currently maintain MongoDB\nShell on three different platforms - Windows (zip), MacOS (zip) and Linux (tgz, deb and rpm).\nOnce downloaded, you will have to extract the binary and add it to your PATH\nvariable. For detailed instructions for each of our supported platforms, please visit\n[installation documentation](https://www.mongodb.com/docs/mongodb-shell/install#mdb-shell-install).\n\n## CLI Usage\n\n\u003c!-- AUTOMATICALLY_INSERT_CLI_USAGE --\u003e\n\n```shell\n  $ mongosh [options] [db address] [file names (ending in .js or .mongodb)]\n\n  Options:\n\n    -h, --help                                 Show this usage information\n    -f, --file [arg]                           Load the specified mongosh script\n        --host [arg]                           Server to connect to\n        --port [arg]                           Port to connect to\n        --build-info                           Show build information\n        --version                              Show version information\n        --quiet                                Silence output from the shell during the connection process\n        --shell                                Run the shell after executing files\n        --nodb                                 Don't connect to mongod on startup - no 'db address' [arg] expected\n        --norc                                 Will not run the '.mongoshrc.js' file on start up\n        --eval [arg]                           Evaluate javascript\n        --json[=canonical|relaxed]             Print result of --eval as Extended JSON, including errors\n        --retryWrites[=true|false]             Automatically retry write operations upon transient network errors (Default: true)\n\n  Authentication Options:\n\n    -u, --username [arg]                       Username for authentication\n    -p, --password [arg]                       Password for authentication\n        --authenticationDatabase [arg]         User source (defaults to dbname)\n        --authenticationMechanism [arg]        Authentication mechanism\n        --awsIamSessionToken [arg]             AWS IAM Temporary Session Token ID\n        --gssapiServiceName [arg]              Service name to use when authenticating using GSSAPI/Kerberos\n        --sspiHostnameCanonicalization [arg]   Specify the SSPI hostname canonicalization (none or forward, available on Windows)\n        --sspiRealmOverride [arg]              Specify the SSPI server realm (available on Windows)\n\n  TLS Options:\n\n        --tls                                  Use TLS for all connections\n        --tlsCertificateKeyFile [arg]          PEM certificate/key file for TLS\n        --tlsCertificateKeyFilePassword [arg]  Password for key in PEM file for TLS\n        --tlsCAFile [arg]                      Certificate Authority file for TLS\n        --tlsAllowInvalidHostnames             Allow connections to servers with non-matching hostnames\n        --tlsAllowInvalidCertificates          Allow connections to servers with invalid certificates\n        --tlsCertificateSelector [arg]         TLS Certificate in system store (Windows and macOS only)\n        --tlsCRLFile [arg]                     Specifies the .pem file that contains the Certificate Revocation List\n        --tlsDisabledProtocols [arg]           Comma separated list of TLS protocols to disable [TLS1_0,TLS1_1,TLS1_2]\n        --tlsFIPSMode                          Enable the system TLS library's FIPS mode\n\n  API version options:\n\n        --apiVersion [arg]                     Specifies the API version to connect with\n        --apiStrict                            Use strict API version mode\n        --apiDeprecationErrors                 Fail deprecated commands for the specified API version\n\n  FLE Options:\n\n        --awsAccessKeyId [arg]                 AWS Access Key for FLE Amazon KMS\n        --awsSecretAccessKey [arg]             AWS Secret Key for FLE Amazon KMS\n        --awsSessionToken [arg]                Optional AWS Session Token ID\n        --keyVaultNamespace [arg]              database.collection to store encrypted FLE parameters\n        --kmsURL [arg]                         Test parameter to override the URL of the KMS endpoint\n\n  OIDC auth options:\n\n        --oidcFlows[=auth-code,device-auth]    Supported OIDC auth flows\n        --oidcRedirectUri[=url]                Local auth code flow redirect URL [http://localhost:27097/redirect]\n        --oidcTrustedEndpoint                  Treat the cluster/database mongosh as a trusted endpoint\n        --oidcIdTokenAsAccessToken             Use ID tokens in place of access tokens for auth\n        --oidcDumpTokens[=mode]                Debug OIDC by printing tokens to mongosh's output [redacted|include-secrets]\n        --oidcNoNonce                          Don't send a nonce argument in the OIDC auth request\n\n  DB Address Examples:\n\n        foo                                    Foo database on local machine\n        192.168.0.5/foo                        Foo database on 192.168.0.5 machine\n        192.168.0.5:9999/foo                   Foo database on 192.168.0.5 machine on port 9999\n        mongodb://192.168.0.5:9999/foo         Connection string URI can also be used\n\n  File Names:\n\n        A list of files to run. Files must end in .js and will exit after unless --shell is specified.\n\n  Examples:\n\n        Start mongosh using 'ships' database on specified connection string:\n        $ mongosh mongodb://192.168.0.5:9999/ships\n\n  For more information on usage: https://docs.mongodb.com/mongodb-shell.\n```\n\n\u003c!-- /AUTOMATICALLY_INSERT_CLI_USAGE --\u003e\n\n## Local Development\n\n### Requirements\n\n- Node.js v20.x\n\n### Install\n\n```shell\nnpm run bootstrap\nnpm run compile-cli\n```\n\n### Running Tests\n\nRun all tests (this may take some time):\n\n```shell\nnpm test\n```\n\nRun tests from a specific package:\n\n```shell\nnpm -w @mongosh/cli-repl run test\n```\n\nTo test against a specific version, the `MONGOSH_SERVER_TEST_VERSION`\nenvironment variable can be set to a semver string specifying a server version,\ne.g. `MONGOSH_SERVER_TEST_VERSION='\u003e= 7.0.0-rc0' npm -w @mongosh/cli-repl run test`.\n\n### Starting the CLI\n\nVia npm:\n\n```shell\nnpm run start \u003c... connection string, CLI args, etc.\u003e\n```\n\nThis will compile all Typescript dependencies of the CLI package first.\n\nAlternatively you can also run start inside the `cli-repl` package, if you're\nsure everything else is compiled:\n\n```shell\nnpm run -w @mongosh/cli-repl start \u003c... connection string, CLI args, etc.\u003e\n```\n\n### Compiling\n\nCompile all Typescript:\n\n```shell\nnpm run compile\n```\n\nCompile just the CLI ands its dependencies:\n\n```shell\nnpm run compile-cli\n```\n\nCompile the standalone executable (this may take some time):\n\n```shell\nnpm run compile-exec\n```\n\nRelevant environment variables for compiling are:\n- `NODE_JS_VERSION`: Specify a Node.js version to use for compilation, e.g. `16.15.0` or `16.x`\n- `BOXEDNODE_CONFIGURE_ARGS`: Node.js configure flags as a comma-separated list\n  or JSON array, e.g. `--shared-openssl,--shared-zlib`\n- `BOXEDNODE_MAKE_ARGS`: Node.js make args (no distinction from `BOXEDNODE_CONFIGURE_ARGS` on Windows)\n  as a comma-separated list or JSON array, e.g. `-j12`\n\nCompile a specific package, e.g. the `.deb` for Debian:\n\n```shell\nnpm run compile-exec\nnpm run evergreen-release package -- --build-variant=deb-x64\n```\n\nCompilation and packaging output is written to `dist/`.\n\n### Releasing\n\nRefer to the [`build` package](./packages/build/README.md) documentation.\n\n## Contributing\n\nFor issues, please create a ticket in our\n[JIRA Project](https://jira.mongodb.org/browse/MONGOSH).\n\nFor contributing, please refer to [CONTRIBUTING.md](./CONTRIBUTING.md).\n\nIs there anything else you’d like to see in MongoDB Shell? Let us know by\nsubmitting suggestions in our [feedback\nforum](https://feedback.mongodb.com/forums/929233-mongodb-shell).\n\n## License\n\n[Apache-2.0](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-js%2Fmongosh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmongodb-js%2Fmongosh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmongodb-js%2Fmongosh/lists"}