Docs Menu

Docs HomeMongoDB Command Line Interface

Enable Autocomplete for the MongoDB CLI

On this page

  • Enable Autocomplete
  • Use Tab to Autocomplete Commands

You can enable autocomplete for MongoDB CLI commands to see available commands and their syntax directly in your shell.

Once you have autocomplete configured, you can autocomplete commands by typing mongocli in your shell and pressing the Tab key. Press Tab multiple times to cycle through available autocompletion options.

You can press Tab at any stage of writing your command to see available autocomplete options.

When you type mongocli in your shell and press Tab, the output resembles the following:

atlas -- Atlas operations.
cloud-manager -- Cloud Manager operations.
completion -- Generate shell completion scripts
config -- Configure a profile to store access settings for your MongoDB deployment.
help -- Help about any command
iam -- Organization and projects operations.
ops-manager -- Ops Manager operations.

If you type a specific property such as atlas as part of your command, you can see autocompletion options for your selected property.

For example, when you type mongocli atlas in your shell and press Tab, the output resembles the following:

accessLists -- Manage the IP access list for your project.
accessLogs -- Manage the access logs of a cluster.
alerts -- Manage alerts for your project.
backups -- Manage backups for your project.
clusters -- Manage clusters for your project.
dbusers -- Manage database users for your project.
events -- Manage events for your project.
logs -- Download host logs for your project.
metrics -- Get measurements on the state of the MongoDB process.
processes -- Manage MongoDB processes for your project.
←  Environment VariablesCustomize the MongoDB CLI Output Using a Go Template →
Share Feedback