Skip to content

Latest commit

 

History

History
79 lines (60 loc) · 1.57 KB

File metadata and controls

79 lines (60 loc) · 1.57 KB

LNMP CLI Configuration

Environment Variables

The LNMP CLI supports configuration through environment variables:

Log Level

export LNMP_LOG_LEVEL=debug    # error, warn, info, debug, trace

Default Output Format

export LNMP_FORMAT=json        # text, json, binary, compact

Verbose/Quiet Mode

export LNMP_VERBOSE=1          # Enable verbose output
export LNMP_QUIET=1            # Enable quiet mode

Color Output

export LNMP_COLOR=always       # auto, always, never
export NO_COLOR=1              # Standard env var to disable colors

Validation Profile

export LNMP_PROFILE=strict     # loose, standard, strict

Config File

export LNMP_CONFIG=~/.lnmprc   # Path to config file (future)

Usage in Code

use lnmp_cli::Config;

fn main() {
    let config = Config::from_env();
    
    if config.is_verbose() {
        println!("Verbose mode enabled");
    }
    
    if config.use_colors() {
        println!("\x1b[32m✓\x1b[0m Green checkmark");
    }
}

Examples

Debug Mode with JSON Output

LNMP_LOG_LEVEL=debug LNMP_FORMAT=json lnmp-cli info version

Quiet Mode with No Colors

LNMP_QUIET=1 NO_COLOR=1 lnmp-cli container inspect file.lnmp

Strict Validation

LNMP_PROFILE=strict lnmp-cli validate check input.lnmp

Future Enhancements

  • Config file support (~/.lnmprc, .lnmp.toml)
  • Per-project config (.lnmp/config.toml)
  • Config override with CLI flags (--verbose, --format, etc.)
  • Config validation and defaults