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:
urloutputdatabasemetricsUrl
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.
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, orprofileworkflows
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:
tablejsonndjsonquiet
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 listfind usersdb currentshell
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:
--url <url>on the current command- stored profile URL
That means this command does not rewrite saved config:
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:
configPathcurrentProfileprofiles
Each profile row includes:
profilecurrenturloutputdatabasemetrics_url
liorandb config --json
Use this when you want to inspect local state without touching server APIs.
liorandb profile ...
The profile manager exposes:
profile listprofile 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
--forceis passed - at least one profile must remain after deletion
- if
--forcedeletes the current profile, the CLI falls back to another remaining profile
Multiple-environment example
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