ssh-commander-core 0.1.0

Async Rust domain layer for SSH, SFTP, FTP/FTPS, PostgreSQL, and connection management — the engine behind midnight-ssh.
Documentation

ssh-commander

CI License: MIT OR Apache-2.0

Async Rust domain layer for SSH, SFTP, FTP/FTPS, PostgreSQL, and connection management. The shared engine that powers midnight-ssh — extracted as a standalone library so any Rust client can use it.

Crates

Crate Purpose
ssh-commander-core crates.io docs.rs SSH, SFTP, FTP/FTPS, Postgres explorer, connection manager, event bus, macOS keychain.
ssh-commander-pg-parquet crates.io docs.rs Parquet export pipeline for the Postgres explorer (pulls in arrow + parquet — opt-in).

Pull in only what you need: the core crate has zero arrow/parquet weight unless you also depend on ssh-commander-pg-parquet.

Features

  • SSH (via russh) — password and public-key auth, PTY shell sessions, known-hosts (TOFU), exec with capture, port forwarding, agent auth.
  • SFTP — full file ops, recursive transfer, attribute introspection.
  • FTP / FTPS (via suppaftp).
  • PostgreSQL explorer — schema introspection, paginated cursor reads, edits, exec, parquet export, optional SSH tunneling.
  • Connection managerArc<RwLock<HashMap>>-backed lifecycle for sessions across protocols.
  • Typed event bus — single broadcast channel for async PTY output, transfer progress, and status updates.
  • macOS Keychain integration (gated on cfg(target_os = "macos")).

Install

[dependencies]
ssh-commander-core = "0.1"
# Optional: Parquet export for the Postgres explorer
ssh-commander-pg-parquet = "0.1"

Requires Rust 1.95+ (edition 2024).

Usage

use ssh_commander_core::ssh::{SshConfig, AuthMethod};
use ssh_commander_core::connection_manager::ConnectionManager;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let mgr = ConnectionManager::new();

    let config = SshConfig {
        host: "example.com".into(),
        port: 22,
        user: "alice".into(),
        auth: AuthMethod::Password { password: "secret".into() },
        ..Default::default()
    };

    let connection_id = mgr.create_connection(config).await?;
    // … use the connection for shell sessions, command execution, file transfer
    Ok(())
}

See docs.rs/ssh-commander-core for the full API.

Status

0.1.x — pre-1.0, expect API changes. Originally extracted from a multi-crate workspace; the published surface is opinionated and follows the consumer's needs. Issues and PRs that improve generality are welcome.

License

Dual-licensed under either of:

at your option.

This crate is derived from work originally licensed MIT by GOODBOY008 (the upstream r-shell project); their copyright notice is preserved in LICENSE-MIT.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.