Skip to content

orobio/SshClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SshClient

Easy to use SSH client functionality with an asynchronous API (async/await), built on swift-nio-ssh.

SshClient currently provides the following functionality:

  • Opening an SSH connection.
  • Executing a command remotely.
  • Getting an AsyncSequence with stdout and/or stderr output lines from the remote command.

Usage

A simple example of setting up an SSH connection and executing a remote command:

let sshConnection = try await SshClient().connect(host: "10.0.0.1", username: "username")
let remoteProcess = try await sshConnection.execute("ls")
for await line in remoteProcess.stdOutLines {
    print(line)
}

Documentation

For detailed documentation, please see: SshClient documentation.

Adding SshClient as a Dependency

To use SshClient in a SwiftPM project, add the following line to the dependencies in your Package.swift file:

.package(url: "https://github.com/orobio/SshClient", from: "0.1.0"),

Include "SshClient" as a dependency for your executable target:

.target(name: "<target>", dependencies: [
    "SshClient",
]),

Finally, add import SshClient to your source code.

Source Stability

This package does not have a stable 1.0.0 release yet. Public API can change at any time.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published