XUtil CLI Installation Guide (example)

Overview

XUtil is a modern CLI tool that provides developers and system administrators with essential utilities for:

  • File compression and encryption
  • JSON/XML data transformation
  • System monitoring and reporting
  • Automated backup and sync operations
  • Network diagnostics and testing

System Requirements

Minimum Requirements

PlatformArchitectureMemoryDisk Space
Linuxx64, ARM64512 MB50 MB
macOSx64, ARM64 (M1/M2)512 MB50 MB
Windowsx64, ARM641 GB50 MB

Installation Methods

# Install XUtil via Homebrew
brew tap xutil/tap
brew install xutil

# Verify installation
xutil --version
# Add XUtil repository (Ubuntu/Debian)
curl -fsSL https://packages.xutil.dev/gpg | sudo apt-key add -
echo "deb https://packages.xutil.dev/apt stable main" | sudo tee /etc/apt/sources.list.d/xutil.list

# Install XUtil
sudo apt update
sudo apt install xutil

# Verify installation
xutil --version
# Add XUtil repository (RHEL/CentOS/Fedora)
sudo tee /etc/yum.repos.d/xutil.repo > /dev/null <<EOF
[xutil]
name=XUtil Repository
baseurl=https://packages.xutil.dev/rpm
enabled=1
gpgcheck=1
gpgkey=https://packages.xutil.dev/gpg
EOF

# Install XUtil (RHEL/CentOS)
sudo yum install xutil

# Install XUtil (Fedora)
sudo dnf install xutil

# Verify installation
xutil --version
# Install via Chocolatey
choco install xutil

# Verify installation
xutil --version
# Add XUtil bucket
scoop bucket add xutil https://github.com/xutil/scoop-bucket.git

# Install XUtil
scoop install xutil

# Verify installation
xutil --version

Method 2: Direct Download Manual

# Download latest release
curl -L "https://github.com/xutil/xutil/releases/latest/download/xutil-$(uname -s)-$(uname -m).tar.gz" | tar xz

# Move to system path
sudo mv xutil /usr/local/bin/

# Make executable
sudo chmod +x /usr/local/bin/xutil

# Verify installation
xutil --version
# Create installation directory
New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\XUtil"

# Download latest release
$LatestRelease = Invoke-RestMethod -Uri "https://api.github.com/repos/xutil/xutil/releases/latest"
$DownloadUrl = $LatestRelease.assets | Where-Object { $_.name -match "xutil-Windows-x64.zip" } | Select-Object -ExpandProperty browser_download_url

Invoke-WebRequest -Uri $DownloadUrl -OutFile "$env:TEMP\xutil.zip"

# Extract and install
Expand-Archive -Path "$env:TEMP\xutil.zip" -DestinationPath "$env:LOCALAPPDATA\XUtil" -Force

# Add to PATH (requires restart or new session)
$CurrentPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::User)
if ($CurrentPath -notlike "*$env:LOCALAPPDATA\XUtil*") {
    [Environment]::SetEnvironmentVariable("PATH", "$CurrentPath;$env:LOCALAPPDATA\XUtil", [EnvironmentVariableTarget]::User)
}

# Verify installation (in new session)
xutil --version

Method 3: From Source Advanced

# Clone repository
git clone https://github.com/xutil/xutil.git
cd xutil

# Build from source
make build

# Install globally
sudo make install

# Verify installation
xutil --version

Post-Installation Setup

Shell Completion Optional

Enable tab completion for your shell:

# Generate completion script
xutil completion bash > ~/.xutil-completion.bash

# Add to .bashrc
echo 'source ~/.xutil-completion.bash' >> ~/.bashrc

# Reload shell
source ~/.bashrc
# Generate completion script
xutil completion zsh > ~/.xutil-completion.zsh

# Add to .zshrc
echo 'source ~/.xutil-completion.zsh' >> ~/.zshrc

# Reload shell
source ~/.zshrc
# Generate completion script
xutil completion fish > ~/.config/fish/completions/xutil.fish

# Reload fish
fish -c "source ~/.config/fish/completions/xutil.fish"

Configuration File Optional

Create a global configuration file:

# Create config directory
mkdir -p ~/.config/xutil

# Generate default config
xutil config init > ~/.config/xutil/config.yaml

Default Configuration:

# ~/.config/xutil/config.yaml
global:
  log_level: info
  temp_dir: /tmp/xutil
  max_concurrent_jobs: 4

compression:
  default_algorithm: gzip
  compression_level: 6

encryption:
  default_cipher: aes-256-gcm
  key_derivation: pbkdf2

network:
  timeout: 30s
  retry_attempts: 3
  user_agent: "XUtil/2.1.4"

Verification

Basic Functionality Test

Run these commands to verify XUtil is working correctly:

# Check version and build info
xutil version --detailed

# Test file operations
echo "Hello XUtil!" > test.txt
xutil compress test.txt
xutil decompress test.txt.gz

# Test JSON processing
echo '{"name": "test", "value": 42}' | xutil json pretty

# Test system info
xutil system info

# Cleanup
rm test.txt*

Expected Output


Troubleshooting

Common Issues

Getting Help

Uninstallation

# Homebrew
brew uninstall xutil

# APT
sudo apt remove xutil

# YUM/DNF
sudo yum remove xutil  # or dnf remove xutil

# Chocolatey
choco uninstall xutil

# Scoop
scoop uninstall xutil
# Remove binary
sudo rm /usr/local/bin/xutil

# Remove config (optional)
rm -rf ~/.config/xutil

# Remove shell completions (optional)
rm ~/.xutil-completion.*