Ability to pass command to `altis stack ssh` and pipe ouput

Aperta
#16 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
api, cli

Direzione di ricerca

Inizia con il comando altis-cli stack ssh e le Altis Dashboard APIs coinvolte nella creazione delle sessioni SSH. Analizza come potrebbero essere rappresentati un comando iniziale, la soppressione del MOTD e la gestione di stdin/stdout/stderr, inclusa la limitazione di Amazon SSM menzionata. Il lavoro è completato quando i comandi possono ricevere argomenti e input tramite pipe, restituendo al contempo in modo pulito un output utilizzabile alle pipe locali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

User Story

As a CLI user I am able to pass a command to execute to altis-cli stack ssh such as wp user list and then pipe the output to my local machine. For example, something like altis-cli stack ssh altis-demo -- wp user list | grep joe (in this case grep is being run on my local machine.

I would also like to pipe data in to a command, for example: echo joe | altis-cli stack ssh altis-demo -- wp user get.


I chatted to @rmccue about the feasibility to doing these, and there are a few low-level challenges that we need to overcome to be able to implement this. As I understand it:

  1. We need to be able to change the "initial" command when ssh is run, as currently it will output MOTD and other boilerplate as part of setting up the SSH sessions. If developers want to just be able to just run a command and pipe output, we can't have any of the initial data.
  2. Altis Dashbaord APIs need to be updated to allow passing the initial command, as we can't run the command client-side in the interactive sessions, as there's no easy to way understand when the command might be complete and exit the program.
  3. Currently the session's SSH output is all a single stream of data, so there's no way to split stdout / stderr in pipes on the client machine. This means if something like wp user list output PHP errors or any other error, it would be in stdout and piped along with the list of users. This makes the data useless in many situations. There's an open issue on https://github.com/aws/amazon-ssm-agent/issues/358 (2.5 years old) to address this, but it doesn't look like there's any progress.
Lingua principale
TypeScript
Stelle
0
Fork
2
Merge medio
15h 10m
PR unite (30g)
6

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di humanmade/altis-cli

Tutte le issue di humanmade/altis-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.