SAI is a lightweight CLI tool for executing software management actions using provider-based configurations. The core philosophy is "Do everything on every software on every OS" through a unified interface.
Unix/Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/example42/sai/main/scripts/install.sh | bash
Windows PowerShell:
iwr -useb https://raw.githubusercontent.com/example42/sai/main/scripts/install.ps1 | iex
Homebrew (macOS/Linux):
brew install example42/tap/sai
Scoop (Windows):
scoop bucket add example42 https://github.com/example42/scoop-bucket
scoop install sai
- Download the latest release from GitHub Releases
- Extract the archive
- Move the binary to a directory in your PATH
# Install software (auto-detects best provider)
sai install nginx
# Start a service
sai start nginx
# Check service status
sai status nginx
# View logs
sai logs nginx
# Get help
sai --help
- Install/Uninstall:
sai install nginx
,sai uninstall nginx
- Upgrade:
sai upgrade nginx
- Search:
sai search nginx
- Information:
sai info nginx
,sai version nginx
- List:
sai list
(all installed software)
- Control:
sai start nginx
,sai stop nginx
,sai restart nginx
- Boot Management:
sai enable nginx
,sai disable nginx
- Status:
sai status nginx
- Configuration:
sai config nginx
- Logs:
sai logs nginx
orsai logs
(system logs) - Performance:
sai cpu nginx
,sai memory nginx
,sai io nginx
- Health:
sai check nginx
- Batch Operations:
sai apply actions.yaml
- System Statistics:
sai stats
- Repository Management:
sai saidata
SAI uses a dynamic provider system where all provider logic is defined in YAML files rather than hardcoded implementations:
- Zero-Code Provider Addition: Add new providers by creating YAML files
- Runtime Flexibility: Modify provider behavior without recompiling
- Community Contributions: Non-Go developers can contribute providers
- Cross-Platform: Automatic provider detection and prioritization
When software-specific configuration (saidata) isn't available, SAI generates intelligent defaults:
- Package Names: Uses software name as default
- Service Names: Uses software name as default service
- Configuration Paths: Generates standard paths like
/etc/{software}/
- Safety Validation: Verifies resources exist before execution
SAI supports OS-specific overrides with automatic environment detection:
software/ap/apache/
βββ default.yaml # Base configuration
βββ ubuntu/22.04.yaml # Ubuntu 22.04 specific
βββ centos/8.yaml # CentOS 8 specific
βββ macos/13.yaml # macOS 13 specific
# Install with automatic provider detection
sai install docker
# Install with specific provider
sai install docker --provider apt
# Install with confirmation bypass
sai install docker --yes
# Dry run (show what would be executed)
sai install docker --dry-run
# Search across all providers
sai search docker
# Get detailed information
sai info docker
# Check versions across providers
sai version docker
# Upgrade to latest version
sai upgrade docker
# Uninstall software
sai uninstall docker
# Start service
sai start apache
# Stop service
sai stop apache
# Restart service
sai restart apache
# Enable at boot
sai enable apache
# Disable at boot
sai disable apache
# Check status
sai status apache
# View configuration files
sai config apache
# Check if service is working
sai check apache
# View service logs
sai logs nginx
# View system logs
sai logs
# Monitor CPU usage
sai cpu nginx
# Monitor memory usage
sai memory nginx
# Monitor I/O statistics
sai io nginx
# System-wide monitoring
sai cpu
sai memory
sai io
Create an actions.yaml
file:
version: "0.1"
actions:
- action: install
software: nginx
provider: apt
- action: start
software: nginx
- action: enable
software: nginx
Execute batch operations:
sai apply actions.yaml
# Use custom configuration
sai install nginx --config /path/to/config.yaml
# Verbose output
sai install nginx --verbose
# Quiet mode
sai install nginx --quiet
# JSON output
sai list --json
# Force specific provider
sai install nginx --provider docker
# Auto-confirm all prompts
sai install nginx --yes
# Show commands without executing
sai install nginx --dry-run
- Go 1.21 or later
- Git
# Clone repository
git clone https://github.com/example42/sai.git
cd sai
# Build for current platform
make build
# Build for all platforms
make build-all
# Build optimized release binaries
make build-release
# Create distribution packages
make package
# Generate checksums
make checksums
# Install locally
make install
# Run tests
make test
# Run linter
make lint
# Clean build artifacts
make clean
# Build with race detection
make build-dev
# Run with verbose output
make run -- --verbose
# Install development dependencies
make deps
# Verify build environment
make verify-env
βββ cmd/sai/ # Main application entry point
βββ internal/ # Private application code
β βββ cli/ # CLI command implementations
β βββ action/ # Action management and orchestration
β βββ provider/ # Provider loading and management
β βββ saidata/ # Software data management
β βββ template/ # Template engine and functions
β βββ executor/ # Command execution
β βββ config/ # Configuration management
β βββ logger/ # Structured logging
β βββ ... # Other internal packages
βββ docs/ # Documentation and examples
β βββ saidata_samples/ # Example software configurations
β βββ *.md # Documentation files
βββ providers/ # Provider implementation files
β βββ specialized/ # Specialized operational providers
β βββ *.yaml # Standard provider definitions
βββ schemas/ # JSON Schema validation files
βββ scripts/ # Installation and utility scripts
βββ .github/workflows/ # CI/CD workflows
βββ Makefile # Build configuration
βββ Dockerfile # Container build configuration
βββ .goreleaser.yml # Release automation configuration
βββ go.mod # Go module definition
- apt (Debian/Ubuntu)
- brew (macOS/Linux)
- dnf (Fedora/RHEL)
- yum (CentOS/RHEL)
- pacman (Arch Linux)
- zypper (openSUSE)
- apk (Alpine Linux)
- pkg (FreeBSD)
- choco (Windows)
- winget (Windows)
- scoop (Windows)
- docker (Docker containers)
- helm (Kubernetes packages)
- npm (Node.js)
- pip (Python)
- gem (Ruby)
- cargo (Rust)
- go (Go modules)
- maven (Java)
- gradle (Java/Kotlin)
- composer (PHP)
- nuget (.NET)
- Security: Vulnerability scanning, SBOM generation
- Debugging: GDB integration, performance profiling
- Operations: Backup/restore, network analysis
- Monitoring: Resource usage, performance metrics
SAI works on:
- Linux (all major distributions)
- macOS (Intel and Apple Silicon)
- Windows (x64 and ARM64)
Automatic environment detection includes:
- Platform identification (linux, darwin, windows)
- OS distribution detection (ubuntu, centos, fedora, etc.)
- Version resolution (22.04, 8, 13.0, etc.)
- Architecture detection (amd64, arm64)
SAI looks for configuration files in:
--config
flag path./sai.yaml
~/.config/sai/config.yaml
/etc/sai/config.yaml
Example configuration:
saidata_repository: "https://github.com/example42/saidata.git"
default_provider: ""
provider_priority:
apt: 100
brew: 90
docker: 80
timeout: 300s
log_level: "info"
confirmations:
install: true
uninstall: true
system_changes: true
info_commands: false
output:
provider_color: "blue"
command_style: "bold"
success_color: "green"
error_color: "red"
show_commands: true
show_exit_codes: true
repository:
git_url: "https://github.com/example42/saidata.git"
local_path: "~/.cache/sai/saidata"
update_interval: "24h"
offline_mode: false
SAI_CONFIG
: Configuration file pathSAI_PROVIDER
: Default providerSAI_VERBOSE
: Enable verbose outputSAI_DRY_RUN
: Enable dry-run modeSAI_YES
: Auto-confirm promptsSAI_QUIET
: Enable quiet mode
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run
make test lint
- Submit a pull request
Create a new provider by adding a YAML file to the providers/
directory:
version: "1.0"
provider:
name: "my-provider"
type: "package_manager"
platforms: ["linux", "darwin"]
executable: "my-package-manager"
actions:
install:
description: "Install software package"
template: "my-package-manager install {{sai_package}}"
validation:
command: "my-package-manager list | grep {{sai_package}}"
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation
- π Issue Tracker
- π¬ Discussions
- π§ Email
SAI CLI - Do everything on every software on every OS π