2026-01-14 15:02:08 +05:30
# Configuration
PMG supports local configuration through a configuration file. To create the default configuration file, run:
```bash
pmg setup install
```
To see the configuration file path and activated configuration, run:
```bash
pmg setup info
```
2026-05-06 12:45:36 +05:30
To edit configuration file:
```bash
pmg setup edit
```
2026-04-17 01:13:30 +05:30
See [config template ](../config/config.template.yml ) for the configuration schema.
## Environment Variables
2026-05-06 12:45:36 +05:30
Any configuration key can be overridden using environment variables, without modifying the config
file. This is useful for CI/CD pipelines or temporary overrides.
2026-04-17 01:13:30 +05:30
**Format:** `PMG_<KEY>` where the key is the config key uppercased, with nested keys joined by `_` .
| Config key | Environment variable |
|---|---|
| `transitive` | `PMG_TRANSITIVE` |
| `paranoid` | `PMG_PARANOID` |
2026-05-06 18:27:23 +05:30
| `proxy.enabled` | `PMG_PROXY_ENABLED` |
| `proxy.install_only` | `PMG_PROXY_INSTALL_ONLY` |
2026-04-17 01:13:30 +05:30
| `verbosity` | `PMG_VERBOSITY` |
| `skip_event_logging` | `PMG_SKIP_EVENT_LOGGING` |
| `sandbox.enabled` | `PMG_SANDBOX_ENABLED` |
| `dependency_cooldown.enabled` | `PMG_DEPENDENCY_COOLDOWN_ENABLED` |
| `cloud.enabled` | `PMG_CLOUD_ENABLED` |
2026-05-06 18:27:23 +05:30
Legacy environment variables `PMG_PROXY_MODE` and `PMG_PROXY_INSTALL_ONLY` (for the old flat keys) are still supported when the `proxy:` section does not exist in the config file.
2026-04-17 01:13:30 +05:30
**Example:**
```bash
# Enable paranoid mode without editing the config file
PMG_PARANOID = true pmg npm install express
# Restrict proxy to install commands only
PMG_PROXY_INSTALL_ONLY = true pmg npm install express
```
**Precedence (highest to lowest):**
1. CLI flags
2. Environment variables (`PMG_*` )
3. Config file (`config.yml` )
2026-05-06 12:45:36 +05:30
4. Built-in defaults