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
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--verbose | -v | bool | false | Enable verbose output with detailed information |
--dry-run | -n | bool | false | Show what would be done without executing |
--help | -h | bool | false | Show help information for the command |
--version | bool | false | Show DevEx version information |
Configuration Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--config-dir | string | ~/.local/share/devex/config | Override default configuration directory |
--user-config-dir | string | ~/.devex | Override user configuration directory |
--cache-dir | string | ~/.cache/devex | Override cache directory |
--no-backup | bool | false | Disable automatic backups |
Output Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--output | string | auto | Output format: table, json, yaml, csv |
--no-color | bool | false | Disable colored output |
--quiet | bool | false | Suppress non-essential output |
--debug | bool | false | Enable 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 34sEnvironment 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
| Variable | Default | Description |
|---|---|---|
DEVEX_CONFIG_DIR | ~/.local/share/devex/config | Default configuration directory |
DEVEX_USER_CONFIG_DIR | ~/.devex | User override configuration directory |
DEVEX_CACHE_DIR | ~/.cache/devex | Cache directory for downloads and metadata |
DEVEX_BACKUP_DIR | ~/.devex/backups | Directory for configuration backups |
DEVEX_LOG_DIR | ~/.local/share/devex/logs | Directory for log files |
Behavior Environment Variables
| Variable | Default | Description |
|---|---|---|
DEVEX_DEBUG | false | Enable debug logging and verbose output |
DEVEX_NO_COLOR | false | Disable colored terminal output |
DEVEX_NO_BACKUP | false | Disable automatic backup creation |
DEVEX_AUTO_YES | false | Automatically answer "yes" to prompts |
DEVEX_TIMEOUT | 300 | Command timeout in seconds |
Platform-Specific Variables
| Variable | Platform | Description |
|---|---|---|
DEVEX_PACKAGE_MANAGER | Linux | Force specific package manager (apt, dnf, pacman) |
DEVEX_USE_SUDO | Linux | Control sudo usage (true/false/auto) |
DEVEX_HOMEBREW_PREFIX | macOS | Custom Homebrew installation prefix |
DEVEX_WINGET_SOURCE | Windows | Custom 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 installShell 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
| Flag | Type | Default | Description |
|---|---|---|---|
--no-descriptions | bool | false | Disable 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, completionSubcommand Completion
devex config <TAB>
# Shows: backup, diff, edit, show, validate
devex template <TAB>
# Shows: apply, create, list, showFlag Completion
devex install --<TAB>
# Shows: --verbose, --dry-run, --category, --app
devex config show --format <TAB>
# Shows: table, json, yaml, csvDynamic 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, desktopAdvanced 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, csvHelp 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 --helpContextual 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 vscodeConfiguration 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 variablesEnvironment Variables
export DEVEX_CONFIG_DIR=./team-config
devex install # Uses ./team-configConfiguration Files
# ~/.devex/config.yaml
defaults:
verbose: true
backup: trueBuilt-in Defaults (Lowest Priority)
Default values hardcoded in DevExBest Practices
Global Flag Best Practices:
- Use dry-run for safety - Always preview major changes
- Enable verbose mode for debugging - Get detailed information when troubleshooting
- Set up shell completion - Improves command-line efficiency
- Use environment variables for consistency - Set team-wide defaults
- Leverage help system - Use
--helpfor 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-teamRelated Commands
devex help- Get comprehensive help informationdevex version- Show version and build informationdevex config- Manage configuration files and settings
Master these global flags and environment variables to get the most out of DevEx. They provide powerful ways to customize behavior across all commands.