Config and Profiles
The CLI persists profile configuration through src/config/config-store.ts.
Default behavior
When the CLI initializes a fresh state, it creates:
- a profile named
default - URL
liorandb://127.0.0.1:27018 - output mode
table
If you initialize a different profile name first, the CLI creates that profile on demand too.
Initialize config
liorandb init
Representative output:
{
"initialized": true,
"configPath": "/home/you/.config/liorandb-nodejs/cli.json",
"profile": "default"
}
Stored profile fields
Each profile can persist these fields:
urloutputdatabasemetricsUrl
That means one profile can target local Docker while another points to a managed deployment.
Set and get profile values
liorandb set url liorandb://admin:YOUR_PASSWORD@127.0.0.1:27018/default
liorandb set output table
liorandb set db default
liorandb set metrics-url http://127.0.0.1:27201/metrics
liorandb get url
liorandb get output
liorandb get metrics-url
Important behavior from the source:
set urlvalidates the connection string by calling the driver parserget urlredacts passwords before printingset outputonly acceptstable,json,ndjson, orquietset dbstores the active database for the selected profileset metrics-urlis only needed formetrics --raw
URL override versus stored URL
The runtime resolver prefers values in this order:
--url <url>on the current command- stored profile URL
So this command does not change saved config:
liorandb --url liorandb://admin:OTHER_PASSWORD@staging.db.example.com:443/default whoami
Profile commands
The profile manager in src/commands/profile.ts supports:
profile listprofile create <name>profile use <name>profile show <name>profile delete <name>
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 metrics-url http://liorandb:27201/metrics
liorandb profile list
Representative output:
+---------+---------+---------------------------------------------+----------+--------+------------------------------+
| profile | current | url | database | output | metrics_url |
+---------+---------+---------------------------------------------+----------+--------+------------------------------+
| local | false | liorandb://admin:********@127.0.0.1:27018/ | default | table | http://127.0.0.1:27201/... |
| managed | true | liorandb://admin:********@acme.db.example...| default | table | http://liorandb:27201/metrics |
+---------+---------+---------------------------------------------+----------+--------+------------------------------+
Deleting profiles
The CLI prevents one dangerous case by default:
- you cannot delete the currently selected profile unless you pass
--force - at least one profile must remain
That guard exists directly in the source.
Full config view
liorandb config --json
Use this when you want to inspect the resolved local configuration file without touching server state.