diff --git a/cli/packages/cmd/bootstrap.go b/cli/packages/cmd/bootstrap.go index 5aaa0ebb8..008debbac 100644 --- a/cli/packages/cmd/bootstrap.go +++ b/cli/packages/cmd/bootstrap.go @@ -47,12 +47,24 @@ var bootstrapCmd = &cobra.Command{ } organization, _ := cmd.Flags().GetString("organization") + if organization == "" { + if envOrganization, ok := os.LookupEnv("INFISICAL_ADMIN_ORGANIZATION"); ok { + organization = envOrganization + } + } + if organization == "" { log.Error().Msg("organization is required") return } domain, _ := cmd.Flags().GetString("domain") + if domain == "" { + if envDomain, ok := os.LookupEnv("INFISICAL_API_URL"); ok { + domain = envDomain + } + } + if domain == "" { log.Error().Msg("domain is required") return diff --git a/docs/cli/commands/bootstrap.mdx b/docs/cli/commands/bootstrap.mdx index 0d6b79b3d..77f8b38f1 100644 --- a/docs/cli/commands/bootstrap.mdx +++ b/docs/cli/commands/bootstrap.mdx @@ -19,53 +19,60 @@ The `infisical bootstrap` command is used when deploying Infisical in automated The command initializes a fresh Infisical instance by creating an admin user, organization, and instance admin machine identity, enabling subsequent programmatic configuration without human intervention. - This command creates an instance admin machine identity with the highest level of privileges. The returned token should be treated with the utmost security, similar to a root credential. Unauthorized access to this token could compromise your entire Infisical instance. + This command creates an instance admin machine identity with the highest level + of privileges. The returned token should be treated with the utmost security, + similar to a root credential. Unauthorized access to this token could + compromise your entire Infisical instance. ## Flags - The URL of your Infisical instance. + The URL of your Infisical instance. This can be set using the `INFISICAL_API_URL` environment variable. - ```bash - # Example - infisical bootstrap --domain=https://your-infisical-instance.com - ``` +```bash +# Example +infisical bootstrap --domain=https://your-infisical-instance.com +``` + +This flag is required. - This flag is required. Email address for the admin user account that will be created. This can be set using the `INFISICAL_ADMIN_EMAIL` environment variable. - ```bash - # Example - infisical bootstrap --email=admin@example.com - ``` +```bash +# Example +infisical bootstrap --email=admin@example.com +``` + +This flag is required. - This flag is required. Password for the admin user account. This can be set using the `INFISICAL_ADMIN_PASSWORD` environment variable. - ```bash - # Example - infisical bootstrap --password=your-secure-password - ``` +```bash +# Example +infisical bootstrap --password=your-secure-password +``` + +This flag is required. - This flag is required. - Name of the organization that will be created within the instance. + Name of the organization that will be created within the instance. This can be set using the `INFISICAL_ADMIN_ORGANIZATION` environment variable. - ```bash - # Example - infisical bootstrap --organization=your-org-name - ``` +```bash +# Example +infisical bootstrap --organization=your-org-name +``` + +This flag is required. - This flag is required. ## Response @@ -122,4 +129,4 @@ echo "Token has been captured and can be used for authentication" - The bootstrap process can only be performed once on a fresh Infisical instance - All flags are required for the bootstrap process to complete successfully - Security controls prevent privilege escalation: instance admin identities cannot be managed by non-instance admin users and identities -- The generated admin user account can be used to log in via the UI if needed \ No newline at end of file +- The generated admin user account can be used to log in via the UI if needed