A comprehensive Swift CLI toolkit for engineers, providing essential utilities for scripts and secret management.
mpct is a modular Swift CLI project targeting macOS 15+ that helps engineers with common development tasks through a collection of specialized modules and commands.
-
Add
mpctto the[tools]section in yourmise.toml[tools] "ubi:MacPaw/cocoa-tools-cli" = { version = "latest", exe = "mpct" }
-
Run
mise install.
mpct
βββ envsubst # Environment variable substitution
βββ secrets # Secret management commands
βββ export # Export secrets from providers
βββ obfuscate # Generate obfuscated Swift code
Environment variable substitution command.
mpct envsubst --input template.txt --output config.txtKey Features:
- Shell-compatible variable expansion
- Support for default values and error handling
- Stdin/stdout processing
- Strict validation options
Import secrets from various providers.
mpct secrets export --config secrets.yaml --source op --destination miseKey Features:
- 1Password CLI integration
- HashiCorp Vault integration
- Multiple export formats (dotenv, mise, stdout)
- YAML-based configuration
- Environment variable substitution in configs
Generate obfuscated Swift code for secrets.
mpct secrets obfuscate --swift-confidential-config config.yaml --output Sources/Secrets.swiftKey Features:
- Swift-confidential integration
- Environment variable substitution
- Secret importing integration
- Build-time code generation
Shell-compatible environment variable substitution in strings and data.
- Features: Shell-style variable expansion, default values, error handling
- Use Cases: Template processing, configuration file generation
- Example:
${VAR:-default},${VAR+alternate},${VAR?error}
Comprehensive secret management with support for multiple providers and export destinations.
- Features: 1Password integration, YAML configuration, batch operations
- Use Cases: Secret importing, environment file generation, CI/CD integration
- Example: Import from 1Password to
.envfiles or mise configurations
Swift code generation with obfuscated secret literals using swift-confidential.
- Features: Swift-confidential integration, environment variable substitution
- Use Cases: Secure secret storage in mobile apps, build-time secret processing
- Example: Generate obfuscated Swift accessors for runtime secret access
Comprehensive semantic versioning implementation with compile-time macro support and build tool integration.
- Features: Semantic Versioning 2.0.0 compliance, compile-time
#semanticVersionmacro, build plugin for automatic version generation - Use Cases: Version management, build automation, CI/CD integration
- Example:
#semanticVersion("1.2.3-beta.1"), automatic.versionfile processing
Shell command execution utilities with mise integration.
- Features: Process execution, mise tool management
- Use Cases: Build scripts, tool integration
- Loose Coupling: Modules can be used independently (w/o CLI execution)
- Protocol-Based: Extensible through well-defined interfaces
- Type Safety: Leverages Swift's type system for safety
mpct (executable)
βββ EnvSubstCommand β EnvSubst
βββ ExportSecretsCommand β ExportSecrets -> ImportSecrets, EnvSubst, Shell
βββ ObfuscateSecretsCommand β ObfuscateSecrets β EnvSubst, ExportSecrets
See the docs/DEVELOPMENT.md file.
- EnvSubstCommand - Environment variable substitution
- ExportSecretsCommand - Secret importing
- ObfuscateSecretsCommand - Secret obfuscation
- EnvSubst - Variable substitution engine
- ImportSecrets - Secret management
- ObfuscateSecrets - Secret obfuscation
- SemanticVersion - Semantic versioning
- swift-confidential - Secret obfuscation library
- swift-argument-parser - Command-line argument parsing
- Yams - YAML parsing for Swift
Built with β€οΈ by the MacPaw Foundation/Terminus Team