Skip to main content

Config and Profiles

Learn how to use config and profiles in the LioranDB CLI to manage connection settings and environments. Understand how to create, switch, inspect, and manage profiles for different LioranDB deployments.

What gets stored​

Each CLI profile can persist:

  • url
  • output
  • database
  • metricsUrl

At the top level, the config also stores:

  • currentProfile

That means one local CLI install can target multiple environments without mixing their URLs, database defaults, or output preferences.

Default config behavior​

When the config store initializes a fresh state, it creates:

  • a profile named default
  • default URL liorandb://127.0.0.1:27018
  • default output mode table

The config store can also create additional profiles on demand when a command references them by name and initialization is required.

liorandb init​

Creates the initial config if it does not already exist.

Initialize config
liorandb init
liorandb init --profile staging

Practical use:

  • first command on a new machine
  • first command in a clean CI workspace
  • first step before set url, login, or profile workflows

liorandb set ...​

The set command group updates persisted profile values.

liorandb set url <connection-uri>​

Stores the connection string for the selected profile.

Source-backed behavior:

  • validates the URI before saving it
  • uses the same connection-string parser family as the driver
  • fails early if the URI is malformed

Example:

liorandb set url liorandb://admin:YOUR_PASSWORD@127.0.0.1:27018/default

liorandb set output <format>​

Stores the default output format for the selected profile.

Allowed values from the source:

  • table
  • json
  • ndjson
  • quiet

Example:

liorandb set output json

liorandb set db <name>​

Stores the default active database for the selected profile.

This affects commands that resolve the active database implicitly, such as:

  • collection list
  • find users
  • db current
  • shell

Example:

liorandb set db analytics

liorandb set metrics-url <url>​

Stores the raw metrics endpoint URL for the selected profile.

This is used by:

  • liorandb metrics --raw

when you do not pass --metrics-url directly on the command line.

Example:

liorandb set metrics-url http://127.0.0.1:27201/metrics

liorandb get ...​

The get group prints persisted values from the selected profile.

liorandb get url​

Prints the stored connection string, but redacts credentials before output.

liorandb get output​

Prints the stored default output format.

liorandb get metrics-url​

Prints the stored raw metrics URL, or an empty string if none is stored.

URL override versus stored URL​

At runtime, the CLI resolves the connection URL in this order:

  1. --url <url> on the current command
  2. stored profile URL

That means this command does not rewrite saved config:

One-off URL override
liorandb --url liorandb://admin:OTHER_PASSWORD@staging.db.example.com:443/default whoami

liorandb config​

Prints the full persisted CLI configuration view.

Current output includes:

  • configPath
  • currentProfile
  • profiles

Each profile row includes:

  • profile
  • current
  • url
  • output
  • database
  • metrics_url
Show full config
liorandb config --json

Use this when you want to inspect local state without touching server APIs.

liorandb profile ...​

The profile manager exposes:

  • profile list
  • profile create <name>
  • profile use <name>
  • profile show <name>
  • profile delete <name>

liorandb profile list​

Lists all configured profiles and marks the current one.

liorandb profile create <name>​

Creates a new profile.

Important source behavior:

  • creation copies the current profile as a template when available
  • the new profile inherits URL, output, database, and metrics URL from the current profile
  • it does not automatically become the current profile

liorandb profile use <name>​

Switches the current profile.

This changes what future commands use by default when --profile is not passed.

liorandb profile show <name>​

Shows one profile in detail.

liorandb profile delete <name>​

Deletes one profile.

Source-backed safeguards:

  • the currently selected profile cannot be deleted unless --force is passed
  • at least one profile must remain after deletion
  • if --force deletes the current profile, the CLI falls back to another remaining profile

Multiple-environment example​

Multiple environments
liorandb profile create local
liorandb profile create managed
liorandb profile use managed
liorandb --profile managed set url liorandb://admin:ENCODED_PASSWORD@acme.db.example.com:443/default
liorandb --profile managed set output json
liorandb --profile managed set metrics-url http://liorandb:27201/metrics
liorandb profile list