Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.
/ agent-cli Public archive

Stateless CLI over REST API using Estuary Agent. Smoothly control your CLI application and configure your machines.

License

Notifications You must be signed in to change notification settings

estuaryoss/agent-cli

Repository files navigation

Testing as a service

Estuary Cli

Stateless CLI over REST API using estuary-agent. Smoothly control and configure your machine / CLI application.

Code quality

Codacy Badge Maintainability

Linux status

Build Status

Win status

CircleCI

Steps

  • deploy estuary-agent-java on the target machine ( metal/VM/Docker/IoT device)
  • connect to the target machine with this CLI

! Obs: Compatible with agent versions >= 4.2.4

CLI in action on Katacoda

https://katacoda.com/estuaryoss/scenarios/agent-cli

Interactive usage

python main.py 
python .\main.py --ip=192.168.0.10 --port=8080 --username=admin --password=yourSecret

Non-interactive usage

python .\main.py --ip=192.168.0.10 --port=8080 --username=admin --password=yourSecret --cmds="dir;;-trump"
python .\main.py --ip=192.168.0.10 --port=8080 --username=admin --password=yourSecret --cmds="dir;;cat requirements.txt;;-trump"

The default endpoint is /command. The endpoint can be overridden if it is compatible.

python .\main.py --ip=192.168.0.10 --port=8080 --username=admin --password=yourSecret --endpoint=/docker/command --cmds="dir;;cat requirements.txt;;-trump"
python .\main.py --ip=localhost --port=8080 --username=admin --password=yourSecret --protocol=https --cmds="dir;;-get --args README.md;altcva.md;;-quit"
python .\main.py --ip=192.168.0.10 --port=8080 --username=admin --password=yourSecret --endpoint=/kubectl/command --cmds="dir;;cat requirements.txt;;-trump"

File download and upload

CLI supports file upload and download similar to sftp transfers.

-put --args LOCAL_PATH;REMOTE_PATH
-get --args REMOTE_PATH;LOCAL_PATH

-put --args C:\Users\Dinuta\Downloads\669564.pdf;/tmp/remote/669564.pdf
-get --args /tmp/remote/669564.pdf;C:\Users\Dinuta\Downloads\669564.pdf

Params

PS > python main.py --help
Usage: main.py [OPTIONS]

Options:
  --ip TEXT             The IP/hostname of the target machine where Agent is
                        deployed

  --port INTEGER        The port number of the target machine where Agent is
                        deployed

  --username TEXT       The username used for the Basic authentication
  --password TEXT       The password used for the Basic authentication
  --protocol TEXT       The protocol with which the Agent was deployed.
                        Default is http. E.g. https

  --cert TEXT           The certificate with which the Agent was deployed.
                        E.g. https/cert.pem

  --endpoint TEXT       The endpoint to sent the request. Default is
                        "/command"

  --keep_state BOOLEAN  Whenever to keep the current working dir. Default is
                        "False"

  --cmds TEXT           The commands to be sent separated by ";". Useful for
                        non-interactive mode.

  --help                Show this message and exit.

Stateless cli example

image

Use cases

  • Remote IoT device control
  • Remote machine control
  • Remote software settings
  • Remote debugging

Exit cli

ctrl + c
-quit
-trump

Support project: