clj-commons / clj-commons/clj-ssh

How to use the PipedInputStream to stream to stdout?

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
241
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Sorry to bother you with a "support" question. Normal usage of this library works really great, thanks for that.

Now, I would like to stream ssh session output to stdout. I tried several variations of the below and I also tried examples I found on the web, but without luck.

```
(require '[clj-ssh.ssh :as s])
(require '[clj-ssh.cli :refer [ssh]])

(let [{shell :channel out-stream :out-stream} (ssh host :cmd "sleep 10; echo hi" :strict-host-key-checking :no :out :stream)]
(s/with-channel-connection shell (while (s/connected-channel? shell) (println "connected")) (println "nothing")))
```

Am I missing something?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the clj-ssh.cli/ssh call using :out :stream and the clj-ssh.ssh/with-channel-connection form shown in the issue. Trace how the returned :out-stream and channel connection are intended to be consumed. Done means the supported stdout-streaming usage is established and documented with a working example.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
cli
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.