Config Commands

v0.4.8Updated for ɳSelf v0.4.8

The nself config command provides comprehensive configuration management for your ɳSelf project. View, modify, validate, and compare configurations across environments.

Configuration Management Features

  • View/Edit: Easy configuration viewing and modification
  • Validation: Validate configuration with password strength checks
  • Diff: Compare configurations between environments
  • Export/Import: Portable configuration management with secret redaction

Usage

nself config <subcommand> [options]

Subcommands

nself config show (default)

Show current configuration.

nself config                    # Show config
nself config show               # Same as above

nself config get

Get specific configuration value.

nself config get <key> [options]

# Options:
#   --reveal             Show secret values (default: masked)

# Examples
nself config get POSTGRES_HOST
nself config get HASURA_GRAPHQL_ADMIN_SECRET --reveal

nself config set

Set configuration value.

nself config set <key> <value>

# Examples
nself config set REDIS_ENABLED true
nself config set POSTGRES_PORT 5433

nself config list

List all configuration keys.

nself config list               # All keys
nself config list --json        # JSON array

nself config edit

Open .env in editor.

nself config edit               # Uses $EDITOR

nself config validate

Validate configuration.

nself config validate           # Check for issues

nself config diff

Compare configurations between environments.

nself config diff <env1> <env2>

# Examples
nself config diff local staging
nself config diff staging prod

nself config export

Export configuration (with redacted secrets).

nself config export             # JSON export
nself config export --reveal    # Include secrets

nself config import

Import configuration from file.

nself config import <file>

# Example
nself config import config.json

nself config reset

Reset to defaults.

nself config reset              # Interactive
nself config reset --force      # No confirmation

Options

OptionDescriptionDefault
--env NAMETarget environmentcurrent
--revealShow secret valuesfalse
--jsonOutput in JSON formatfalse
--no-backupDon't create backup before changesfalse
--output FILEExport to specific file-
--forceSkip confirmationfalse

Configuration Categories

CategoryVariables
CorePROJECT_NAME, ENV, BASE_DOMAIN, POSTGRES_*, HASURA_*, AUTH_*
ServicesREDIS_*, MINIO_*, MAILPIT_*, MEILISEARCH_*, MLFLOW_*, FUNCTIONS_*
MonitoringMONITORING_*, PROMETHEUS_*, GRAFANA_*, LOKI_*, TEMPO_*
CustomCS_*, FRONTEND_APP_*

Output Examples

Show Command

  ➞ Environment: local
  ➞ File: .env

  Core Configuration
  PROJECT_NAME=myapp
  BASE_DOMAIN=local.nself.org
  POSTGRES_DB=myapp_db
  POSTGRES_PASSWORD=********

  Services
  REDIS_ENABLED=true
  MINIO_ENABLED=true
  MAILPIT_ENABLED=true

  Monitoring
  MONITORING_ENABLED=true

  ℹ Secret values redacted. Use --reveal to show.

Validate Command

  ➞ Validating Configuration

  ✓ PROJECT_NAME configured
  ✓ BASE_DOMAIN configured
  ! POSTGRES_PASSWORD: Password too short (< 12 chars)
  ✓ HASURA_GRAPHQL_ADMIN_SECRET configured

  ⚠ Configuration valid with 1 warning(s)

Secret Keys

The following key patterns are treated as secrets and redacted by default:

Use --reveal to show actual values.

Validation Checks

The validate subcommand checks:

  1. Required keys - Essential configuration present
  2. Password strength - Minimum 12 characters
  3. Default values - Not using 'changeme' etc.
  4. Duplicate keys - No duplicate definitions

Backups

By default, backups are created before changes:

.env.bak                    # Latest backup
.env.20260123_103000.bak    # Timestamped backup

Use --no-backup to skip backup creation.

Environment Files

EnvironmentPrimary FileFallback
local/dev.env.env.local
staging.env.staging-
prod.env.prod.env.production

Related Commands