DevEx CLI

Enterprise-grade CLI tool for streamlined development environment setup and management across Linux, macOS, and Windows. Built with modern Go patterns using Cobra + Viper architecture.
π Features
- π Plugin Architecture: 36 specialized plugins for package managers and desktop environments
- β‘ Cross-Platform: Native support for Linux distributions, macOS, and Windows
- π’ Enterprise Patterns: Cobra CLI framework with Viper configuration management
- π― Smart Detection: Automatic platform, distribution, and desktop environment detection
- π 12-Factor Config: Hierarchical configuration (flags > env > config > defaults)
- π‘οΈ Quality Gates: Comprehensive testing with Ginkgo BDD and security scanning
π¦ Supported Package Managers
Linux Package Managers
- Debian/Ubuntu: apt, deb
- Fedora/RHEL: dnf, rpm
- Arch Linux: pacman, yay
- openSUSE: zypper
- Gentoo: emerge
- Void Linux: xbps
- Solus: eopkg
- Alpine: apk
Universal Package Managers
- flatpak: Cross-distribution app distribution
- snap: Ubuntu's universal packages
- appimage: Portable application format
- docker: Containerized applications
- pip: Python package manager
- mise: Multi-language version manager
- brew: macOS and Linux package manager
- curlpipe: Direct download installer
Nix Ecosystem
- nixpkgs: Nix package manager
- nixflake: Nix flakes for reproducible builds
π₯οΈ Desktop Environment Support
- GNOME: Extensions, themes, and configuration
- KDE Plasma: Widgets, themes, and settings
- XFCE: Lightweight desktop customization
- MATE: Traditional desktop environment
- Cinnamon: Modern desktop with classic paradigms
- LXQt: Lightweight Qt desktop
- Budgie: Modern, elegant desktop
- Pantheon: Elementary OS desktop
- COSMIC: System76's new Rust-based desktop
ποΈ Architecture
CLI Framework
apps/cli/
βββ cmd/ # Cobra command definitions
β βββ root.go # Root command with PersistentPreRunE
β βββ install.go # Installation commands
β βββ system.go # System configuration
β βββ list.go # List available packages
βββ pkg/ # Public packages
β βββ commands/ # Command implementations
β βββ installers/ # Package manager interfaces
β βββ types/ # Core data structures
β βββ config/ # Configuration management
βββ internal/ # Private application code
β βββ cli/ # CLI-specific logic
β βββ config/ # Internal configuration
βββ config/ # Default YAML configurations
β βββ applications.yaml
β βββ environment.yaml
β βββ desktop.yaml
β βββ system.yaml
βββ Taskfile.yml # Development automation
Configuration System
DevEx follows 12-Factor App configuration principles:
- Command-line flags (highest precedence)
- Environment variables (
DEVEX_*
)
- Configuration files (
~/.devex/config.yaml
)
- Default values (lowest precedence)
π Quick Start
Installation
# One-line installation
curl -fsSL https://devex.sh/install | bash
# Or install locally for development
cd apps/cli
task install
Basic Usage
# Install development environment
devex install
# Install specific categories
devex install --categories development,databases
# List available applications
devex list apps
# Configure desktop environment
devex system apply
# Show current configuration
devex config show
π» Development
Prerequisites
- Go: Version 1.24+
- Task: Task runner (
go install github.com/go-task/task/v3/cmd/task@latest
)
- golangci-lint: Linting (
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
)
Development Workflow
# Default workflow (lint + test)
task
# Development commands
task build:local # Build for local testing
task test # Run all tests
task test:ginkgo # Run Ginkgo BDD tests
task lint # Run golangci-lint
task lint:fix # Auto-fix linting issues
task vulncheck # Security vulnerability check
# Install locally
task install
Testing Framework
DevEx uses Ginkgo BDD exclusively for testing:
var _ = Describe("Install Command", func() {
var (
installer *mocks.MockInstaller
cmd *cobra.Command
)
BeforeEach(func() {
installer = mocks.NewMockInstaller()
cmd = NewInstallCommand(installer)
})
Context("when installing applications", func() {
It("should install default applications", func() {
err := cmd.Execute()
Expect(err).ToNot(HaveOccurred())
Expect(installer.InstallCalls).To(HaveLen(3))
})
})
})
Adding New Commands
Use cobra-cli for consistent command generation:
# Install cobra-cli
go install github.com/spf13/cobra-cli@latest
# Generate new command
cobra-cli add [command]
# Generate child command
cobra-cli add [child] -p [parent]
π Plugin Development
DevEx uses a modular plugin system with 36 specialized plugins:
Plugin Interface
type Installer interface {
Install(ctx context.Context, app types.CrossPlatformApp) error
Uninstall(ctx context.Context, app types.CrossPlatformApp) error
IsInstalled(ctx context.Context, app types.CrossPlatformApp) (bool, error)
GetName() string
GetPriority() int
CanInstall(app types.CrossPlatformApp) bool
}
Plugin Commands
# Check plugin changes
lefthook run plugin-check
# Build all changed plugins
lefthook run plugin-build
# Test specific plugin
lefthook run plugin-test [plugin-name]
π‘οΈ Quality & Security
Quality Gates
- golangci-lint: Comprehensive Go linting
- Ginkgo BDD: Behavior-driven testing
- govulncheck: Security vulnerability scanning
- lefthook: Git hooks for quality enforcement
Security Best Practices
- Context-aware command execution
- Input validation for shell commands
- Minimal but essential security patterns
- Secure configuration file handling
π Configuration Examples
Application Configuration (~/.devex/applications.yaml
)
applications:
- name: "Visual Studio Code"
description: "Modern code editor"
categories: ["development", "editors"]
linux:
apt:
package: "code"
repository: "https://packages.microsoft.com/repos/code"
macos:
brew:
cask: "visual-studio-code"
System Configuration (~/.devex/system.yaml
)
git:
user_name: "Your Name"
user_email: "your.email@example.com"
default_branch: "main"
shell:
preferred: "zsh"
plugins: ["oh-my-zsh", "powerlevel10k"]
π Release Management
DevEx uses automated releases with semantic versioning:
- GoReleaser: Multi-platform binary builds
- GitHub Actions: Automated testing and deployment
- Semantic Commits: Conventional commit-based versioning
Commit Conventions
# Feature (minor version)
git commit -m "feat: add new package manager support"
# Bug fix (patch version)
git commit -m "fix: resolve installation issue on Ubuntu"
# Breaking change (major version)
git commit -m "feat!: redesign configuration system"
π Documentation
π€ Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature
- Make your changes following our coding standards
- Run tests:
task test && task lint
- Commit with conventional commits:
git commit -m "feat: your feature"
- Push and create a Pull Request
π License
This project is licensed under the Apache-2.0 License.