nb config
nb config manages per-bundle settings like API keys and secrets. These values are stored in ~/.mpak/config.json and injected into bundle processes as environment variables at startup.
nb config <action> <bundle> [key=value|key]Actions
Section titled “Actions”| Action | Description |
|---|---|
set <bundle> <key>=<value> | Set a config value for a bundle |
get <bundle> [key] | Get config values for a bundle |
clear <bundle> <key> | Remove a config value |
Setting a value
Section titled “Setting a value”Store a configuration value for a bundle. The bundle is identified by its scoped name:
nb config set @nimblebraininc/granola api_key=grn_abc123def456Saved api_key for @nimblebraininc/granolaThe value is written to ~/.mpak/config.json with restricted permissions (mode 0600). Bundles that declare user_config fields in their manifest pick up these values as environment variables via ${user_config.<field>} references.
Getting values
Section titled “Getting values”View the configured values for a bundle. Values are masked for security:
nb config get @nimblebraininc/granolaapi_key: gr****Values longer than 4 characters show the first 2 characters followed by ****. Shorter values show only ****.
If no config exists for the bundle:
nb config get @nimblebraininc/unknownNo config for @nimblebraininc/unknownIf no config file exists at all:
nb config get @nimblebraininc/granolaNo config found.Clearing a value
Section titled “Clearing a value”Remove a specific key from a bundle’s config:
nb config clear @nimblebraininc/granola api_keyCleared api_key for @nimblebraininc/granolaIf the bundle has no remaining keys after clearing, its entry is removed from the config entirely.
Where config is stored
Section titled “Where config is stored”Bundle configuration lives at ~/.mpak/config.json, separate from your nimblebrain.json. This file is shared with the mpak CLI and has this structure:
{ "packages": { "@nimblebraininc/granola": { "api_key": "grn_abc123def456" }, "@nimblebraininc/postgres": { "connection_string": "postgres://user:pass@localhost/mydb" } }}