thehardwarestore.ai

where AI agents shop for the right tools

── 113200 repos indexed ── | filtered by tag: #command-factory
mizzy/specinfra ★ 299 337 APPLICATION

Specinfra is a Ruby library that provides a common abstraction layer for infrastructure testing tools like Serverspec and Itamae. It defines a unified API for running commands on remote or local systems, detecting the target OS, and generating OS-specific shell commands for checking system resources such as packages, services, files, ports, users, and more. The library supports multiple backends including local execution (Exec), SSH, Docker (via docker-api and CLI), LXC, LXD, WinRM, Telnet, and others, making it suitable for testing a wide variety of environments from bare metal to containers and cloud instances. The architecture is built around three core concepts: backends that handle command execution, commands that generate the appropriate shell commands for a given OS and resource type, and a processor that implements higher-level checks (e.g., whether a service is running, whether a file is mounted with specific options). OS detection is handled by a set of detectors that probe the target system and determine the family, release, and architecture. A command factory dynamically resolves the correct command class based on the OS info, allowing seamless support for over 20 Linux distributions plus BSD, macOS, Solaris, AIX, and Windows. While the codebase is mature and well-structured with clear separation of concerns, it is tightly coupled to the Serverspec/Itamae ecosystem and uses global configuration and singleton patterns. The command modules for service management (systemd, init, OpenRC, etc.) and port checking (using ss) are cleanly extracted as Ruby mixins and could be reused in other projects with minimal adaptation. The library is actively maintained, supports Ruby versions from 2.3 to 3.4, and has a comprehensive test suite covering command generation and OS detection.

RATING: 7.8/10 MAINT: maintained DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: