CLI
The Hava CLI provides a simple way to interact with Hava through a command line interface. This is a powerful way to integrate Hava into CI/CD and GitOps pipelines to ensure that diagrams are always up to date when changes are deployed in your environment

The CLI is available for Windows, MacOS, Linux, and as a Docker container
The cli is a single binary with no dependencies, so install is a simple matter for downloading the binary and run it from the local environment
We have provided some simple install scripts to simplify this and keep the cli up to date automatically using homebrew for macOS
brew tap teamhava/hava
brew install hava
Before use the CLI needs to be configured with the API token so it can authenticate to the API. The CLI can be configured either using environment variables or by using the in-built configure command to save the configuration long term
Variable | Required | Description |
---|---|---|
HAVA_TOKEN | yes | API token to authenticate with Hava API |
HAVA_ENDPOINT | no | API Endpoint to connect to, defaults to SaaS endpoint. This is useful when Hava is running in a custom environment |
Once installed a configured, the CLI can be called from the command line with the
hava
commandTo list all sources in your Hava account use the
source list
command, this will display all the available sources in a table╭───┬─────────────┬────────────────────── ────────────────┬──────────────────────┬────────────┬────────┬────────────────────╮
│ │ DISPLAYNAME │ ID │ INFO │ NAME │ STATE │ TYPE │
├───┼─────────────┼──────────────────────────────────────┼──────────────────────┼────────────┼────────┼────────────────────┤
│ 1 │ devTestAWS │ 8eb192e2-9beb-466b-ae14-c05fc8403cf4 │ AKIAIOSFODNN7EXAMPLE │ devTestAWS │ active │ Sources::AWS::Keys │
╰───┴─────────────┴──────────────────────────────────────┴──────────────────────┴────────────┴────────┴────────────────────╯
You can configure the CLI to output in multiple formats, JSON, HTML, Markdown etc.
To print out the result in json use the
--json
flaghava source list --json | jq
[
{
"DisplayName": "dev",
"Id": "4f14c115-3b0d-40ea-b075-6df9b2fb81c9",
"Info": "AKIAIOSFODNN7EXAMPLE",
"Name": "dev",
"State": "active",
"Type": "Sources::AWS::Keys"
},
{
"DisplayName": "GCPDevChange3",
"Id": "f2a26440-10bf-43d1-9742-8361de30590f",
"Info": "credentials.json",
"Name": "GCPDevChange3",
"State": "active",
"Type": "Sources::GCP::ServiceAccountCredentials"
}
]
Our CLI makes it trivial to integrate Hava with the CI/CD tool of your choice.
Last modified 17d ago