DevEx LogoMy App
CLI Reference

Global Flags & Completion

Global command-line options, environment variables, and shell completion

Global Flags & Completion

DevEx provides a comprehensive set of global flags, environment variables, and shell completion features that work across all commands to enhance your development experience.

Global Flags

These flags are available for all DevEx commands and provide consistent behavior across the CLI.

Core Global Flags

FlagShortTypeDefaultDescription
--verbose-vboolfalseEnable verbose output with detailed information
--dry-run-nboolfalseShow what would be done without executing
--help-hboolfalseShow help information for the command
--versionboolfalseShow DevEx version information

Configuration Flags

FlagTypeDefaultDescription
--config-dirstring~/.local/share/devex/configOverride default configuration directory
--user-config-dirstring~/.devexOverride user configuration directory
--cache-dirstring~/.cache/devexOverride cache directory
--no-backupboolfalseDisable automatic backups

Output Flags

FlagTypeDefaultDescription
--outputstringautoOutput format: table, json, yaml, csv
--no-colorboolfalseDisable colored output
--quietboolfalseSuppress non-essential output
--debugboolfalseEnable debug logging

Global Flag Examples

# Verbose installation with detailed logs
devex install --verbose

Output:
[INFO] Loading configuration from ~/.local/share/devex/config
[INFO] Detected platform: Ubuntu 22.04 (x86_64)
[INFO] Using package manager: apt
[DEBUG] Checking repository keys...
[DEBUG] Repository https://download.docker.com/linux/ubuntu is accessible
[INFO] Installing docker...
[DEBUG] Running: sudo apt-get install docker-ce
[DEBUG] Command output: Reading package lists...
[INFO] ✓ Docker installed successfully
[DEBUG] Post-install: Adding user to docker group
[INFO] Installation completed in 2m 34s

Environment Variables

DevEx recognizes several environment variables that control its behavior globally.

Core Environment Variables

DEVEX_DEBUG

Enable debug logging (true/false)

DEVEX_CONFIG_DIR

Override default configuration directory

DEVEX_NO_COLOR

Disable colored output (true/false)

DEVEX_CACHE_DIR

Override cache directory location

Configuration Environment Variables

VariableDefaultDescription
DEVEX_CONFIG_DIR~/.local/share/devex/configDefault configuration directory
DEVEX_USER_CONFIG_DIR~/.devexUser override configuration directory
DEVEX_CACHE_DIR~/.cache/devexCache directory for downloads and metadata
DEVEX_BACKUP_DIR~/.devex/backupsDirectory for configuration backups
DEVEX_LOG_DIR~/.local/share/devex/logsDirectory for log files

Behavior Environment Variables

VariableDefaultDescription
DEVEX_DEBUGfalseEnable debug logging and verbose output
DEVEX_NO_COLORfalseDisable colored terminal output
DEVEX_NO_BACKUPfalseDisable automatic backup creation
DEVEX_AUTO_YESfalseAutomatically answer "yes" to prompts
DEVEX_TIMEOUT300Command timeout in seconds

Platform-Specific Variables

VariablePlatformDescription
DEVEX_PACKAGE_MANAGERLinuxForce specific package manager (apt, dnf, pacman)
DEVEX_USE_SUDOLinuxControl sudo usage (true/false/auto)
DEVEX_HOMEBREW_PREFIXmacOSCustom Homebrew installation prefix
DEVEX_WINGET_SOURCEWindowsCustom winget source repository

Environment Variable Examples

# Development environment setup
export DEVEX_DEBUG=true
export DEVEX_CONFIG_DIR=./dev-configs
export DEVEX_CACHE_DIR=/tmp/devex-cache

# Run with development settings
devex install

Shell Completion

DevEx provides comprehensive shell completion for all major shells, making command-line usage faster and more intuitive.

devex completion

Generate shell completion scripts for your shell.

Usage

devex completion <shell> [flags]

Supported Shells

  • bash - Bash shell completion
  • zsh - Zsh shell completion
  • fish - Fish shell completion
  • powershell - PowerShell completion (Windows)

Options

FlagTypeDefaultDescription
--no-descriptionsboolfalseDisable completion descriptions

Installation Instructions

# Install bash completion
devex completion bash > /etc/bash_completion.d/devex

# Or for user-only installation
devex completion bash > ~/.local/share/bash-completion/completions/devex

# Reload your shell or run:
source ~/.bashrc

# Test completion
devex <TAB><TAB>

Completion Features

Command Completion

devex <TAB>
# Shows: add, config, install, list, remove, setup, status, template

devex c<TAB>
# Shows: config, completion

Subcommand Completion

devex config <TAB>
# Shows: backup, diff, edit, show, validate

devex template <TAB>
# Shows: apply, create, list, show

Flag Completion

devex install --<TAB>
# Shows: --verbose, --dry-run, --category, --app

devex config show --format <TAB>
# Shows: table, json, yaml, csv

Dynamic Content Completion

devex add <TAB>
# Shows available applications: docker, git, node, python, vscode

devex template apply <TAB>
# Shows available templates: backend, frontend, full-stack

devex config edit <TAB>
# Shows configuration files: applications, environment, system, desktop

Advanced Completion Examples

# Complete application names
devex add doc<TAB>
# Completes to: docker, docker-compose

# Complete with descriptions
devex add docker<TAB>
# Shows: docker (Container platform for developers)

# Complete configuration files
devex config edit app<TAB>
# Completes to: applications

# Complete template names
devex template show back<TAB>
# Completes to: backend

# Complete output formats
devex status --output <TAB>
# Shows: table, json, yaml, csv

Help System

DevEx provides comprehensive help at multiple levels.

Command Help

# General help
devex --help
devex help

# Command-specific help
devex install --help
devex config --help

# Subcommand help
devex config edit --help
devex template apply --help

Contextual Help

DevEx provides contextual help based on your current environment and configuration:

# Smart help suggestions
devex help
# Shows relevant commands based on your setup status

# Context-aware tips
devex status
# May suggest: "Run 'devex recovery check' to diagnose issues"

# Command suggestions
devex
# If no subcommand: "Try 'devex setup' for first-time configuration"

Help Output Examples

devex install --help

Install your development environment

Usage:
  devex install [flags]

Description:
  The install command automates the installation of your complete 
  development environment based on your configuration files.

Flags:
  -c, --category string    Install specific category (development, databases, optional)
  -a, --app stringArray    Install specific applications only
  -f, --force              Force reinstall even if already installed
  -h, --help               help for install
  -n, --dry-run            Show what would be installed without executing
  -v, --verbose            Enable verbose output

Global Flags:
      --config-dir string   Override default config directory
      --no-color           Disable colored output
      --debug              Enable debug logging

Examples:
  devex install
  devex install --category development
  devex install --app docker --app vscode

Configuration Priority

DevEx follows a clear priority order when determining configuration values:

Command Line Flags (Highest Priority)

devex install --config-dir ./custom
# Always uses ./custom regardless of environment variables

Environment Variables

export DEVEX_CONFIG_DIR=./team-config
devex install  # Uses ./team-config

Configuration Files

# ~/.devex/config.yaml
defaults:
  verbose: true
  backup: true

Built-in Defaults (Lowest Priority)

Default values hardcoded in DevEx

Best Practices

Global Flag Best Practices:

  1. Use dry-run for safety - Always preview major changes
  2. Enable verbose mode for debugging - Get detailed information when troubleshooting
  3. Set up shell completion - Improves command-line efficiency
  4. Use environment variables for consistency - Set team-wide defaults
  5. Leverage help system - Use --help for unfamiliar commands

Common Patterns

# Safe operation pattern
devex install --dry-run    # Preview
devex install --verbose    # Execute with details

# Automation pattern
export DEVEX_AUTO_YES=true
export DEVEX_NO_COLOR=true
devex install --quiet

# Debugging pattern
export DEVEX_DEBUG=true
devex config validate --verbose

# Team consistency pattern
export DEVEX_CONFIG_DIR=/shared/team-configs
devex template apply backend-team

Master these global flags and environment variables to get the most out of DevEx. They provide powerful ways to customize behavior across all commands.

On this page