LogoLogo
HomePricingSelf-hosted docsAPI docsLogin
  • Home
  • Login to hava
  • Developer
  • Getting Started
    • Quickstart
      • Create New Account
      • Import Demo Data
      • Creating Environments
      • Exporting Diagrams
  • AWS Marketplace
  • Using Hava
    • Providers & Sources
    • Environments
      • Creating Environments
      • Filtering Environments
  • Importing Data
    • Demo Data
    • AWS
      • Getting Started with AWS
        • Cross Account Role
        • Read Only IAM User
        • Minimum Access IAM User
      • AWS Supported Resources
      • AWS Views
        • Infrastructure
        • Security
        • Container - ECS
        • List
    • Azure
      • Getting Started with Azure
        • Powershell
        • Azure Portal
      • Azure Supported Resources
      • Azure Views
        • Infrastructure
        • Azure Security View
        • List
    • Google Cloud
      • Getting Started with GCP
        • Service Account
        • Import Multiple Projects
        • Enabling APIs
      • GCP Supported Resources
      • GCP Views
        • Infrastructure
        • List
    • Kubernetes
      • Getting Started with Kubernetes
        • Read Only Kubeconfig
        • Automatic Import of Managed Kubernetes
          • AWS EKS Cluster Configuration
        • Converting certificate files to certificate data fields
      • Kubernetes Supported Resources
      • Kubernetes Views
        • Container
        • List
    • Import Errors
  • Discover
    • Importing
    • Searching
      • Search Overview
      • Search Syntax
        • VPC Search
        • Wildcard Search
        • Tag Search
        • Deep Search
      • Search Examples
        • Discover Resources From Regions
        • Create a multiple VPC diagram
        • Defining Custom Environments
    • Versioning
      • Tracking Changes in Cloud Architecture
    • Manual Sync
  • Diagram
    • Listing Environments
      • Filtering Environments
      • Favouriting Environments
    • Viewing Environments
      • Diagram Controls
      • Diagram Layout
      • Switch Between Views
      • Diagram Canvas Resource Filters
    • Draw Custom Connections
  • Diagnose
    • Architectural Monitoring Alerts
    • Attributes
    • Cost Estimation
    • Diff View - Comparing Diagrams
    • Infrastructure
      • View Route Tables
      • View ACLs
      • View Security Groups
    • Reports
      • AWS Compliance Reports
  • Document
    • Environment Notes
    • Embed
    • Exporting Diagrams
    • Edit
      • Draw.io
  • Collaboration
    • Teams
    • Inviting Users
    • Disabling users
    • SSO/SAML
      • Overview
      • Azure AD - SAML Setup
      • Azure AD - OIDC Setup
      • Okta - SAML Setup
      • Okta - OIDC Setup
      • Trouble Shooting SSO
    • Project folders
  • Integrations
    • AWS Control Tower
    • CLI
    • Confluence Cloud
    • GitHub
    • Terraform
  • API
    • API Docs
  • Account & Billing
    • Types Of Hava Accounts
    • Change Subscription
    • Switch to AWS marketplace
    • Change Password
    • MFA
    • Download Invoice
    • Cancel Account
    • Account Audit Log
  • Quick Look
    • Quick AWS Overview
    • Security Overview
    • Customize the Hava Dashboard
Powered by GitBook
On this page
  • Installation
  • Configuration
  • Using the CLI
  • Output Format
  • CI/CD Integration Examples

Was this helpful?

  1. Integrations

CLI

Last updated 1 year ago

Was this helpful?

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

Installation

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

Configuration

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

Environment variables

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

Using the CLI

Once installed a configured, the CLI can be called from the command line with the hava command

To 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 │
╰───┴─────────────┴──────────────────────────────────────┴──────────────────────┴────────────┴────────┴────────────────────╯

Output Format

You can configure the CLI to output in multiple formats, JSON, HTML, Markdown etc.

To print out the result in json use the --json flag

hava 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"
  }
]

CI/CD Integration Examples

Our CLI makes it trivial to integrate Hava with the CI/CD tool of your choice.

More install options are available from our

More details on configuring Hava CLI can be found in the

See the for details on the complete list of formats

Check out our for details on using the CLI in common pipelines and workflows

detailed installation instructions
GitHub repository
GitHub repository
examples in github