/pluralith-cli

Pluralith is a tool for Terraform state visualisation and automated generation of infrastructure documentation

Primary LanguageGoMozilla Public License 2.0MPL-2.0

GitHub Badge Blue

Pluralith CLI

Pluralith is a tool to visualize your Terraform state and automate infrastructure documentation. The Pluralith CLI is a tool written in go to:

  • Integrate Pluralith with Terraform
  • Interact with the Pluralith UI
  • Run Pluralith in Pipelines for automated infrastructure documentation
  • Ship other useful little features

flow-illustration

Pluralith is currently in Private Alpha

 

⚙️ Getting Started

We are currently working on getting pluralith into homebrew/core and apt! For homebrew we need 75 stars, 30 forks and 30 watchers. We'd greatly appreciate if you can help us out with that.

Until we manage to get into these package managers you can manually install the Pluralith CLI by downloading your OS's binary from the latest release or by installing the Pluralith UI available here. The UI will install the CLI and keep it updated automatically.

 

🛰️ CLI Overview

→ Terraform Commands

  • pluralith plan: Creates a Terraform execution plan and opens it as a Diagram in the Pluralith UI1.
  • pluralith apply: Essentially the same as pluralith plan with the intention of actually applying the execution plan1.
  • pluralith destroy: Creates a Terraform execution plan in destroy mode and opens it as a Diagram in the Pluralith UI

→ Diagram Export Command

  • pluralith graph: Creates a Terraform execution plan, draws a graph and exports it as a PDF in a headless way2
    • --title: The title to be shown in the diagram (e.g. "Pluralith EKS Cluster")
    • --author: The title to be shown in the diagram (e.g. "Tony Stark")
    • --version: The title to be shown in the diagram (e.g. "1.0.5")
    • --show-changes: Enables change highlighting in the output diagram. When enabled, resources that have been added, updated, deleted etc. will be highlighted with special colors
    • --skip-plan: Skip the generation of a new execution plan
      • Only works if Pluralith has run in the current directory before
    • --out-dir: The path your exported diagram PDF gets saved to (e.g. "~/pluralith-infra/eks")
      • Saved to current directory by default
    • --file-name: The path your exported diagram PDF gets saved to
      • The value passed for --title is used by default
    • --generate-md: Generates markdown for GitHub pull request / commit comment (used in our Pluralith GitHub actions)

 

📍 Here's an example output for one of our test projects. View the PDF version here

HighlyAvailableIaaS

→ Strip Command

  • pluralith strip: Strips and hashes your plan state to make it shareable with us for debugging
    • Takes an existing Pluralith Plan state and subjects it to rigorous hashing of values
      • The Pluralith Plan state is located in the file pluralith.state.stripped in your project directory
    • The purpose of this command is to strip the state of all sensitive data while keeping the structure intact, making it shareable
    • This is meant for us to debug edge cases on user state without the security hazard

→ Module Commands

  • pluralith install: Installs/updates the Pluralith CLI or one of its modules to the latest version
    • To install a specific module, pass that module's name (e.g. pluralith install graph-module)
    • If no value is passed, the latest version of the CLI itself will be installed
  • pluralith update: Essentially the same as install. Updates existing modules, if not installed it downloads the latest release

→ Utility Commands

  • pluralith login: Authenticate with your API key (necessary for the CLI to work without the UI)2
  • pluralith version: Shows information about the current CLI version as well as additional, installed modules

1 The UI then shows a prompt that lets you confirm or deny an apply with hotkeys.
2 You need to be authenticated with your API key via pluralith login. Currently only available for closed alpha testers. Interested? Shoot us an email dan@pluralith.com

 

📦 Modules

The Pluralith CLI works with modules under the hood to extend its functionality. Below you can see a table of modules.

Module Installation Description
Graph Module pluralith install graph-module Installs the latest version of the graph module
Pluralith UI pluralith install ui Installs the Pluralith UI. Coming Soon

 

👩‍🚀 Looking to become a tester or talk about the project?

Disclaimer: To properly use this CLI you will need the Pluralith UI and/or an API key. Sign up for the private alpha to get access!

Subreddit subscribers