MongoScope

CLI flags

mongoscope startup flags for log paths and ephemeral live connect

Start MongoScope from a terminal. Use flags to skip Welcome, point at a log directory, or open a session-only live connection.

Show help or version

mongoscope --help
mongoscope --version

During development:

bun start --help

bun link exposes mongoscope on your PATH (same entry as bun start). bun run build produces a separate standalone binary at dist/mongoscope.

FlagDescription
-h, --helpPrint help and exit
-v, --versionPrint version and exit. Release binaries use the embedded release version; development builds fall back to package.json.

Flags

FlagRequiredDefaultDescription
--log-dirNo.Second Welcome log list (alongside /var/log/mongodb)
--log-pathNo—Parse this log file on startup and skip the picker. Must be an existing file; invalid paths exit 1.
--uriNo—Ephemeral live connect for this session (not saved to the credential store)
--hostWith discrete flags—Host for a built URI
--portNo27017 when building a URIPort for a built URI
--usernameNo—Username for a built URI
--passwordNo—Password for a built URI (requires --username)
--auth-dbNo—authSource for a built URI

Mutual exclusion

Use either --uri or the discrete --host / --port / --username / --password / --auth-db set — not both. --host is required when any of the other discrete flags are set. Password without username fails.

Ephemeral connect

CLI connection flags activate a session-only live connection (cli-ephemeral). Credentials are not written to Bun.secrets or config.json. Save a profile in the app when you need persistence — see Connections.

Startup combinations

FlagsBehavior
No flagsWelcome screen
--log-path PATHParse PATH (static Slow Queries / Logs), open dashboard
Connection flags onlyOpen dashboard; Slow Queries and Logs start in Live mode
--log-path + connection flagsParse the log (static sources) and connect in parallel

Examples

Parse a log file:

mongoscope --log-path /var/log/mongodb/mongod.log

Open with a session-only URI (replace placeholders):

mongoscope --uri 'mongodb://USER:PASSWORD@HOST:27017/?authSource=admin'

Build a URI from discrete flags:

mongoscope --host HOST --port 27017 --username USER --password PASSWORD --auth-db admin

List logs from a custom directory on Welcome:

mongoscope --log-dir /path/to/logs

On this page