GitXplorerGitXplorer
o

SshClient

public
5 stars
2 forks
0 issues

Commits

List of commits on branch main.
Unverified
10bf6d78d6cc25e6da48ec9ca178aae9ccc8d79f

Update Package.resolved

oorobio committed 3 years ago
Unverified
20d59e9e4a187381b6a2a16aca645531c62d1dd7

Update swift-nio-ssh dependency to .upToNextMinor(from: "0.4.0")

oorobio committed 3 years ago
Unverified
1ba7134b20172067b7eb2c64ced12fcfcc0d8c8b

Fix formatting issues in README

oorobio committed 3 years ago
Unverified
6ad507b88bafb09a1b6f5347256d8fe7297f36f8

Add 'Documentation' section in README

oorobio committed 3 years ago
Unverified
cfa709641dcb4b05f139650052c6b80c7dd4b8b1

Remove unnecessary 'mutating'

oorobio committed 3 years ago
Verified
7b720476d76c778861042147271176b379c202c1

Merge pull request #1 from xtremekforever/run-on-macos

oorobio committed 3 years ago

README

The README file for this repository.

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.