Skip to main content

Init Command

Initialize Pluralith in the current working directory and generate a config file (pluralith.yml) for CI.

pluralith init [flags]

Example

The pluralith init command initializes Pluralith in your current working directory and creates a config file (pluralith.yml). Run pluralith init at the level you usually run your Terraform commands on and follow the wizard to create a valid pluralith.yml. Alternatively you can generate an empty config file by running pluralith init --empty and populate it yourself.

pluralith init --api-key $PLURALITH_API_KEY --org-id $PLURALITH_ORG_ID --project-id $PLURALITH_PROJECT_ID --project-name $PLURALITH_PROJECT_NAME

pluralith run plan --show-changes --show-costs --show-drift

Where To Find Things

  • The org-id can also be found in the Pluralith dashboard (by clicking on your org name in the right upper corner and then on 'Organisation Settings').
  • The project-id can also be found in the Pluralith dashboard (by opening a project and clicking on settings in the left menu). You can also pass your own project-id here, if Pluralith detects that no project with this project-id exists it will create a new one. The project-id can only consist of lowercase letter, numbers and dashes (-).
  • The project-name is only necessary when you pass a project-id that doesn't exist yet. In that case the project-name will be used for project creation. The project-name is what will be shown in your project grid in the Pluralith dashboard.

How To Pass Things To Init

There are a few options to pass configuration to the init command. In the list below they are ordered by how the CLI prioritizes them (meaning 3. will override 2., 2. will override 1.)

  1. Environment Variables: Set the following variables and the CLI will pick them up automatically.
  • $PLURALITH_API_KEY
  • $PLURALITH_ORG_ID
  • $PLURALITH_PROJECT_ID
  • $PLURALITH_PROJECT_NAME
  1. Config File: Run pluralith init locally in the root directory of your Terraform project, follow the wizard and commit the resulting pluralith.yml to your repo.

  2. Flags: Pass the necessary parameters to initialize a project via flags. All availabe flags are listed blow.

Available Flags

FlagDescriptionType
--api-keyYour Pluralith API key. Pass via flag to skip user prompt.

string

--org-idYour Org Id (Can be found in your Pluralith dashboard). Pass via flag to skip user prompt and override pluralith.yml

string

--project-idYour Project Id (If no project with passed Id exists, one gets created). Pass via flag to skip user prompt and override pluralith.yml

string

--project-nameYour Project name. Pass via flag to skip user prompt and override pluralith.yml

string

--emptyCreates an empty pluralith.yml config file in the current directory

bool