logo

Hoop CLI

Command Line

The command line allows administrating gateway resources and connecting to remote resources. To begin, you need to configure your gateway instance.
shell
hoop config create --api-url https://<gateway-url>
The configuration is saved at $HOME/.hoop/config.yaml
With this configuration in place you need to obtain a access token to interact with the API. The command below will open your browser and redirect to the identity provider.
shell
hoop login
If you need to clear this configuration, issue the command below
shell
hoop config clear
💡
If you are unsure about the <gateway-url>, contact your administrator. In our multi-tenant environment, the login will automatically prompt you with a default URL: https://use.hoop.dev.
After logging in, you can interact with connections. There are two methods for this interaction.

Exec (ad-hoc executions)

The exec command is used to execute ad-hoc commands over remote connections. It triggers a command in a remote service, returns the result, and applies all relevant policies and configurations.
shell
$ hoop exec myconnection -i '/bin/process-job.sh'
ad-hoc cli execution example

Connect (terminal console)

The 'connect' command allows you to create an interactive session with a remote resource. Any command that can run in a terminal console can be integrated with Hoop. Here are a few examples:
  • docker exec
  • bash
  • ssh
  • rails console
  • python console
  • kubectl exec
  • aws ecs execute-command
shell
$ hoop connect bash-console connection: bash-console | session: 53ed53f9-a5f9-45e9-bbf5-becd1f44f41e root@5601881aa15e:/app#
terminal console cli example

Connect (TCP)

The connect feature can be used to interact with TCP services such as databases. It can be used with an IDE or any native database client. The port is forwarded locally to the end-user, providing a secure connection to remote services.
shell
$ hoop connect pg-prod connection: pg-prod | session: 4619c80f-7166-487c-8c9f-9609e59ae5d6 --------------------postgres-credentials-------------------- host=127.0.0.1 port=5433 user=noop password=noop ------------------------------------------------------------ ready to accept connections!
postgres tcp connection example
💡
Database types are unique kinds of connections which enable users to authenticate using their SSO credentials. More details can be found on the connections page.

Powered by Notaku