Skip to content
CAI
Software that uses CAICheck a score

capistrano/sshkit

66.0

Adequate · 20 September 2026

1.8k

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

SSHKit is a Ruby library designed for executing commands and transferring files across multiple remote hosts via SSH or locally. It provides a structured API for managing connection pooling, parallel and sequential execution strategies, and customizable output formatting. The system supports both SCP and SFTP for file operations and includes robust configuration options for environment variables, user context, and logging behavior.

How it got here

2012–2013 — SSHKit v1.25.1 release and architecture refactoring

13 changes.

This period focused on releasing SSHKit v1.25.1, which introduced a major architectural refactoring of backends, formatters, and runners to support connection pooling, local execution, and improved concurrency controls. The work also established a robust testing infrastructure using Docker Compose and comprehensive unit tests, alongside the addition of core Ruby extensions and a centralized configuration API.

2015–2024 — Connection pooling and SFTP support

6 changes.

This period focused on refactoring the connection pool implementation to improve efficiency and correctness through dedicated cache classes. The Netssh backend was enhanced with SFTP support for file transfers and a robust custom known\_hosts implementation. Testing infrastructure was modernized by replacing Vagrant with Docker and adding comprehensive unit tests for error handling and host key parsing.

Features

Added Array and Hash core extensions

New core extension methods have been added to Ruby's standard classes to improve data handling. The Array class now includes an \extract\_options!\ method that removes and returns the last element if it is a Hash, otherwise returning an empty Hash. The Hash class now provides \symbolize\_keys\ and \symbolize\_keys!\ methods to convert all keys to symbols, with the bang version modifying the hash in place.

_lib/core\ext · high confidence

Added simple SSHKit connection example

A new runnable example file (examples/simple\_connection.rb) has been added to demonstrate basic SSHKit usage. This script allows users to quickly test the library by executing a simple command on a host specified via the HOST environment variable.

examples · high confidence

Introduction of SSHKit configuration API

The library now exposes a configuration API via the SSHKit module, allowing users to define global settings using SSHKit.configure. This new entry point initializes a Configuration object and provides methods to access and reset the configuration state, serving as the central hub for library setup.

lib · high confidence

Behavioural changes

Add RuboCop linting and CI configuration

The project now includes RuboCop for code style enforcement, configured via \.rubocop.yml\ and \.rubocop\_todo.yml\, with a dedicated \lint\ Rake task added to the \Rakefile\. CI infrastructure has been updated to use GitHub Actions (replacing Travis CI) and Docker Compose for functional testing, supported by new configuration files like \docker-compose.yml\ and \Dangerfile\.

(repo-wide) · high confidence

Add SFTP support for file transfers and replace default known\_hosts implementation

The Netssh backend now supports SFTP for upload and download operations via new SftpTransfer and ScpTransfer classes, allowing users to choose SFTP as an alternative to SCP. Additionally, a custom KnownHosts implementation has been introduced to replace the default net-ssh known\_hosts handling, providing more robust parsing of host keys and hashes while ensuring compatibility with older net-sftp APIs and fixing known\_hosts key matching issues.

lib/sshkit/backends/netssh · high confidence

New Docker environment for functional tests

A new Dockerfile and setup script have been added to the .docker directory to provide a containerized Ubuntu 22.04 environment for running functional tests. This environment provisions a 'deployer' user with password-based SSH access, replacing the previous Vagrant-based setup.

.docker · high confidence

Refactored connection pooling with dedicated cache classes

The connection pool implementation has been rewritten to improve efficiency and correctness by introducing dedicated cache classes. A new \Cache\ class now manages connection storage with idle timeouts, synchronization, and eviction of stale connections, while a \NilCache\ class provides a no-op alternative that immediately closes connections. This structural change supports fixes for issues where connections were opened multiple times or reused while closed, ensuring that connection state is checked safely within synchronized blocks.

_lib/sshkit/backends/connection\pool · high confidence

Refactored formatter architecture with new Abstract base and dedicated formatters

The formatter system has been restructured to use a new \Abstract\ base class that centralizes logging methods (fatal, error, warn, info, debug) and command lifecycle hooks (start, data, exit). This change introduces a \BlackHole\ formatter for silent operation, a \Dot\ formatter for concise progress indicators, and refactors \Pretty\ and \SimpleText\ to inherit from \Abstract\. The \Pretty\ formatter now supports colorized output based on TTY detection or environment variables, displays command host/user context, and aligns log messages with verbosity levels. \SimpleText\ retains its historical behavior of disabling colors while inheriting the new structure. Users will see more consistent log formatting, better color support, and clearer command execution details.

lib/sshkit/formatters · high confidence

Refactored runner architecture and added execution limits

The runner classes have been extracted into individual files (Abstract, Group, Null, Parallel, Sequential) to improve code organization. The Parallel runner now wraps exceptions to include the hostname and user context, providing clearer error messages. A new Group runner has been introduced that allows limiting the number of concurrent hosts via the \:limit\ option, and the Sequential runner now supports a configurable \:wait\ interval between host executions.

lib/sshkit/runners · high confidence

SSHKit backends refactored with connection pooling and local execution support

The SSHKit backend architecture has been restructured around a new \Abstract\ base class, introducing a thread-local connection pool (\ConnectionPool\) to reuse SSH connections and improve performance. This change enables the \Local\ backend to execute commands directly on the host machine using \on(:local)\ and \run\_locally\, supporting file uploads and downloads via \upload!\ and \download!\. The \Netssh\ backend now supports SFTP transfers as an alternative to SCP, respects local \.ssh/config\ files, and includes a deprecation warning for the \background\ helper. Additionally, the \Printer\ backend now correctly implements \test\ to return true, and the \Skipper\ backend suppresses non-warning logs.

lib/sshkit/backends · high confidence

SSHKit v1.25.1 release

This update releases SSHKit version 1.25.1. The library now includes a built-in Color class for ANSI color support that automatically disables coloring when output is not a TTY or unless the SSHKIT\_COLOR environment variable is set. Command execution now raises a Failed exception by default when a command exits with a non-zero status, including the full stdout and stderr in the error message. The host parser has been updated to handle IPv6 addresses without port numbers, and the DSL provides a run\_locally method for executing commands on the local machine. Configuration options now support setting a default umask, default environment variables, and custom formatters with arguments.

lib/sshkit · high confidence

Test coverage

Added functional tests for file transfer and backend execution; Added test fixtures for known\_hosts parsing; Added test infrastructure with Docker Compose support; Added tests for error wrapping in SSHKit runners; Added unit tests for SSHKit backends and connection pooling; Added unit tests for SSHKit core components; Added unit tests for SSHKit formatters.

Dependencies

Initial gemspec and Gemfile setup for SSHKit

The project now defines its package structure via a Gemfile and sshkit.gemspec. The gem specifies a minimum Ruby version of 2.5 and declares runtime dependencies on base64, logger, net-ssh (\>= 2.8.0), net-scp (\>= 1.1.2), net-sftp (\>= 2.1.2), and ostruct. Development dependencies include minitest (\>= 5.0.0), rubocop (\~\> 0.52.0), mocha, and others for testing and linting.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 66.

Lenses

  • Code Health 97
  • Architecture 97
  • Maturity 56
  • Readiness 64
  • Security 75

Changes since last survey

  • 300 commits — 246 feature/other, 54 fixes

By area

  • (root) — 129 commits
  • (repo) — 75 commits
  • lib/sshkit — 60 commits
  • .github/workflows — 22 commits
  • test/functional — 5 commits
  • test/unit — 5 commits
  • .github/dependabot.yml — 2 commits
  • .github/release-drafter.yml — 1 commit
  • lib/sshkit.rb — 1 commit

Notable commits

  • fix: Add logger runtime dependency to fix warning on Ruby 3.4 (#552)
  • fix: Add mutex_m dependency to fix Ruby 3.3 warning (#525)
  • fix: Add ostruct dependency to fix warning on Ruby 3.3.5+ (#542)
  • fix: Explicitly require base64 to fix missing constant with net-ssh 7.2.2+ (#532)
  • fix: Fix "unnecessary splat" violation in RuboCop 0.43
  • fix: Fix #336
  • fix: Fix #336
  • fix: Fix CI failures by running Ruby <= 2.2 on older Ubuntu image (#516)
  • fix: Fix KnownHostsKeys#keys_for to match on the entire hostlist
  • fix: Fix NoMethodError assign_defaults with net-ssh older than 4.0.0
  • fix: Fix Ruby 2.0 on Travis
  • fix: Fix all warnings reported by rubocop --lint
  • fix: Fix broken link
  • fix: Fix broken thread safety by widening critical section
  • fix: Fix cache key generation performance for connection pooling (#417)
  • fix: Fix changelog links
  • fix: Fix colorized log alignment. (#349)
  • fix: Fix default options test [fix #351] (#353)
  • fix: Fix escaped quotes bug in Command#group (#425)
  • fix: Fix failing tests on ruby head (#533)
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

capistrano/sshkit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 28e04dc73de911374a23c4fc3fd5ef34012dcd63 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.