Skip to main content

Crate ferrissh

Crate ferrissh 

Source
Expand description

§Ferrissh

Async SSH CLI scraper library for network device automation.

Ferrissh provides a high-level async API for interacting with network devices over SSH, similar to Python’s scrapli and netmiko libraries.

§Features

  • Async SSH connections via russh
  • Multi-vendor support (Linux, Juniper, Arista, Nokia, Arrcus)
  • Efficient pattern buffer matching (scrapli-style tail search)
  • Privilege level management with graph-based navigation
  • Zero-copy Payload responses backed by reference-counted Bytes
  • In-place buffer normalization with SIMD-accelerated byte search
  • Multi-channel support: multiple PTY shells on a single SSH connection
  • Easy vendor extensibility

§Quick Start

use ferrissh::{DriverBuilder, Driver, Platform};

#[tokio::main]
async fn main() -> Result<(), ferrissh::Error> {
    let mut driver = DriverBuilder::new("192.168.1.1")
        .username("admin")
        .password("secret")
        .platform(Platform::Linux)
        .build()?;

    driver.open().await?;

    let response = driver.send_command("uname -a").await?;
    println!("{}", response.result);

    driver.close().await?;
    Ok(())
}

Re-exports§

pub use driver::Channel;
pub use driver::ChannelState;
pub use driver::CommandStream;
pub use driver::ConfigSession;
pub use driver::ConfirmableCommit;
pub use driver::Diffable;
pub use driver::Driver;
pub use driver::DriverBuilder;
pub use driver::GenericConfigSession;
pub use driver::GenericDriver;
pub use driver::InteractiveBuilder;
pub use driver::InteractiveEvent;
pub use driver::InteractiveResult;
pub use driver::NamedSession;
pub use driver::Payload;
pub use driver::Response;
pub use driver::SessionState;
pub use driver::StreamCompletion;
pub use driver::Validatable;
pub use driver::ValidationResult;
pub use error::DisconnectReason;
pub use error::Error;
pub use platform::ConfDConfigSession;
pub use platform::ConfDJStyleConfigSession;
pub use platform::Platform;
pub use platform::PlatformDefinition;
pub use platform::PrivilegeLevel;
pub use platform::StreamProcessor;
pub use session::Session;
pub use session::SessionBuilder;
pub use transport::HostKeyVerification;

Modules§

channel
Channel layer for pattern matching and PTY operations.
driver
High-level driver for device interaction.
error
Error types for ferrissh.
platform
Platform definitions for multi-vendor support.
session
SSH session management.
transport
SSH transport layer wrapping russh.