spaceheadlabs/ssh-bundle
A Symfony bundle that integrates SSH connectivity into your application, providing services for running remote commands and managing SSH sessions. It wraps SSH client functionality in configurable bundle services, making remote server operations easier to inject and use within Symfony projects.
Architecture fit. The package is a Symfony Bundle — it ships a Bundle class, a DI Extension, and compiler passes that register against a Symfony kernel. That is not a Laravel extension mechanism. In a Laravel codebase, there is no bundle lifecycle to hook into, so the releasable value is whatever plain PHP service classes exist beneath the Symfony glue. From a TPM standpoint this is a framework-fit disqualifier as a dependency and a scope reference only. The realistic leverage is in reading it to see the shape of the abstraction (named connections, config-driven hosts, credential handling, a command runner), not in shipping it.
Integration feasibility. Low-to-moderate, contingent on unverified facts. The bundle almost certainly wraps phpseclib/phpseclib or ext-ssh2. If it is a thin facade, integration cost is small but so is the delta — we can depend on the underlying library directly. If it encodes real value (connection registry, multi-host config resolution, SFTP helpers), extraction is viable but we own that extracted code permanently. Critical unknowns before any commitment: composer.json PHP constraint, Symfony version range, whether the bundle is coupled to Symfony's EventDispatcher/Config in ways that assume a kernel, and the license.
Technical risk. High, and concentrated in the metadata more than the code. Zero stars, zero dependents, and a 0.1 composite score mean there is no downstream validation — nobody has run this in production and reported back. For a component that handles private keys and remote shell access, that is the worst possible place to be a first adopter. Specific risks a TPM must weigh: (1) no observable security disclosure process or CVE monitoring for a credential-handling dependency; (2) likely stale PHP/Symfony constraints that will conflict with Laravel 10/11's Symfony 6/7 components; (3) unknown test coverage for auth failure, timeout, and host-key verification — the three places SSH wrappers most often fail; (4) transitive dependency drift if it pins an old phpseclib major. Each is manageable in isolation; the combination means we cannot inherit trust and must audit the source before use.
Key questions.
phpseclib, ext-ssh2, or a shell-out to the ssh binary? Shell-out would be disqualifying for most of our use cases.Stack fit. Poor as-is for Laravel. This is not a Laravel package that is mislabeled — it is a different framework's extension mechanism. Adopting it means adopting a Symfony-shaped abstraction inside a Laravel app, creating a permanent impedance mismatch in service registration, config publishing, and testing. The TPM decision is explicit: do not add this as a runtime dependency.
Migration path. Treat the bundle as a reference implementation, never as shipped code:
SshClient interface with the three or four operations we actually need (execute, upload, download, disconnect).phpseclib/phpseclib directly, which is almost certainly the underlying transport.config/ssh.php, since Symfony's tree-based config definitions do not carry over.The likely outcome is that we keep the phpseclib implementation and delete the extraction — which is the desired outcome, not a failure.
Compatibility. Must confirm the PHP constraint against our floor (8.1/8.2) and the Symfony component range against our Laravel version. Expect a conflict. If the bundle pins Symfony 3/4 or PHP 7.x, extraction becomes mandatory rather than optional and the effort estimate roughly doubles.
Sequencing. (1) Source audit and license check — half a day. (2) Spike the phpseclib direct implementation and benchmark it against the requirement — one to two days. (3) Only if the bundle clears the audit and the spike shows meaningful savings, extract; otherwise close the evaluation. Do not put this on a critical path before step 2 completes. This sequencing keeps the TPM's exposure capped at roughly three days of engineering before a go/no-go.
Alternatives to evaluate in parallel. spatie/ssh for simple command execution (idiomatic Laravel, maintained), laravel/envoy for task-runner semantics, and Ansible or a hosted deploy platform for orchestration at scale. The TPM framing is: SSH execution is a real primitive on the roadmap, but this specific package is a poor vehicle for it.
Maintenance. Effectively an owned fork from day one. With zero dependents there is no upstream community applying pressure to keep it current and no signal that PHP or Symfony version bumps will be handled. Budget for periodic source review on every PHP minor upgrade and on any security advisory touching SSH, phpseclib, or OpenSSL. This is the single largest hidden cost of adoption and should be stated plainly in any stakeholder pitch.
Support. None. No issue triage, no maintainer responsiveness to rely on, no Stack Overflow corpus. Every behavioral question is answered by reading the code. Acceptable for a 200-line adapter; unacceptable for anything load-bearing across teams. This is why the recommendation is to build on a maintained transport and keep this package out of the dependency tree.
Scaling. SSH is stateful and this is the axis most likely to bite. Each connection is a persistent TCP session with a remote daemon enforcing its own MaxSessions/MaxStartups limits. Naive per-request connection opening under load exhausts those limits on target hosts and surfaces as intermittent auth or handshake failures that read like network problems in incident response. If the bundle pools connections, we inherit correct behavior for free — but must verify the pool is safe across Laravel queue workers and Octane's long-lived processes; a pool that assumes one request per process will leak or cross-contaminate credentials. Horizontal scaling also multiplies connection count linearly with worker count, so capacity planning is measured against the target fleet, not our own.
Failure modes. Ranked by operational pain:
StrictHostKeyChecking=no equivalents turn convenience into a MITM surface. Verify the default and pin known hosts explicitly.Ramp-up. A PHP developer comfortable with phpseclib needs roughly a day to be productive against the extracted code. Bundle-specific knowledge is a dead end — do not invest in documentation for it beyond a short ADR recording why we did not depend on it. The larger cost is organizational: whoever inherits this owns an unaudited SSH client in a security-sensitive path, and that needs an explicitly named owner before first production deploy, not after. The TPM action item is to secure that named owner and a security review slot before the spike begins.
How can I help you explore Laravel packages today?