What is Salt?
Salt is a Golang utility library that provides a collection of modular, reusable packages designed to simplify and enhance application development. It offers battle-tested components for common tasks, including configuration management, CLI utilities, authentication, logging, database operations, and observability. Built and maintained by Raystack, Salt powers production applications across the Raystack ecosystem.Why use Salt?
Salt eliminates the need to write boilerplate code for common application needs, allowing you to focus on building your core business logic.Production-ready
Battle-tested libraries used in production across the Raystack ecosystem
Modular design
Import only what you need without unnecessary dependencies
Type-safe
Full Go type safety with comprehensive validation support
Cloud-native
Built for modern infrastructure with observability and graceful shutdowns
Key features
Configuration management
Load and validate configuration from multiple sources with a clear precedence order:- Command-line flags
- Environment variables
- Configuration files
- Default values
Structured logging
Choose between Logrus and Zap implementations with a unified interface:Database operations
Connect to databases with connection pooling, timeouts, and transaction support:CLI utilities
Build interactive command-line tools with:- Commander: Command management and documentation generation
- Printer: Formatted output (tables, JSON, YAML, markdown)
- Prompter: Interactive user prompts and surveys
- Terminator: Terminal utilities and browser integration
Authentication & security
- OIDC: OpenID Connect authentication flows and token management
- Audit: Security event logging and compliance tracking
Observability
Integrate OpenTelemetry for metrics, traces, and monitoring:Package overview
config
Configuration management with environment variables, files, and defaults
log
Structured logging with Logrus and Zap support
db
Database connections, migrations, and transaction helpers
cli
Command-line tools, prompts, and formatted output
auth
OIDC authentication and audit logging
server
HTTP server utilities and SPA serving
telemetry
OpenTelemetry integration for observability
jsondiff
JSON diff calculation and reconstruction
Who uses Salt?
Salt is used across the Raystack ecosystem to power production applications including:- API services and microservices
- CLI tools and utilities
- Data processing pipelines
- Infrastructure management tools
Requirements
- Go 1.22 or higher
- Compatible with Linux, macOS, and Windows
Next steps
Install Salt
Get started by installing Salt in your Go projectInstallation guide →
Quick start
Build your first application with SaltQuickstart guide →
Explore packages
Dive deeper into specific packagesPackage overview →