FireHydrant CLI tool (fhcli)

FireHydrant provides a command line tool, fhcli, to easily submit changes from your existing CI or orchestration systems. With fhcli you can record the creation of Docker images, deploy events in Jenkins, CI build statuses, etc.

We publish releases at and builds are available for MacOS (darwin) and Linux (amd64) with support for more platforms coming. 


You'll need a bot token for the controller to authenticate with; we recommend that you generate one specifically for this integration. Put this in an environment variable in your CI system or export it in a setup script. If the bot token is stored in FH_API_KEY  then fhcli tool will automatically use it. 

You can also store it in ~/firehydrant.cfg  or /etc/firehydrant.cfg  and it will automatically be used. We recommend also storing the environment name there if it's the same across all invocations of fhcli  from this system.

apiKey: fhb-00a0a0a00a0a0a00a0a0a0a0a00a0a0a
environment: production 


You can record the creation of a docker image in FireHydrant by wrapping your call to docker build  with fhcli:

fhcli execute --service=railsapp -- docker build -t app .

This is a simple example but we recommend sending identities for a change like the Git revision or container image URL with the fhcli  call: 

fhcli execute --service=railsapp --identities "revision=${CIRCLE_SHA1},git=${CIRCLE_REPOSITORY_URL}:${CIRCLE_SHA1},${GOOGLE_PROJECT_ID}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_SHA1}" -- docker build -t app .

This may look complicated at first but it's just adding the above mentioned data , in this case it's provided by CircleCI:

  • Current Git revision revision=${CIRCLE_SHA1} 
  • Full path of Git commit git=${CIRCLE_REPOSITORY_URL}:${CIRCLE_SHA1} 

By sending this information we can link a GitHub pull request to an updated Pod spec in a Kubernetes deployment. Sending this level of detail is not required but leads to better visibility into the propagation of changes through your system.

Was this article helpful?
0 out of 0 found this helpful

Articles in this section

See more