Prerequisites

To get the most out of this guide, you will need to:

Installation

Through homebrew:

  brew tap hoophq/brew https://github.com/hoophq/brew
  brew install hoop

To upgrade it:

  brew upgrade hoop

Authenticate

The <gateway-url> is the URL of the API Gateway. If you are using our managed instance, you don’t need to set this value, go directly to the hoop login command below that it will isntruct it for you with the correct URL as https://use.hoop.dev. If you deployed your own instance, this will be the same URL you set on the API_URL environment variable for the host of your hoop Gateway.

hoop config create --api-url https://<gateway-url>

With this configuration in place, you must obtain an access token to interact with the API. The command below will open your browser and redirect you to the identity provider.

hoop login

If you need to clear this configuration, issue the command below.

hoop config clear

hoop connect

The hoop connect command allows you to create an interactive session with a remote resource. The resource can be an interactive terminal console or TCP services such as databases.. Here are a few examples:

Terminal console

  • docker exec
  • bash
  • ssh
  • rails console
  • python console
  • kubectl exec
  • aws ecs execute-command
hoop connect bash-console
connection: bash-console | session: 53ed53f9-a5f9-45e9-bbf5-becd1f44f41e
root@5601881aa15e:/app#

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.

$ 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!

The connection is established through a secure tunnel. The connection is encrypted and authenticated using the user’s identity.