Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
misc: added env support for the other cli flags
Sheen Capadngan049f0f56a045
diff --git a/cli/packages/cmd/bootstrap.go b/cli/packages/cmd/bootstrap.goindex 5aaa0ebb8c..008debbac7 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")returndiff --git a/docs/cli/commands/bootstrap.mdx b/docs/cli/commands/bootstrap.mdxindex 0d6b79b3d1..77f8b38f17 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 automatedThe command initializes a fresh Infisical instance by creating an admin user, organization, and instance admin machine identity, enabling subsequent programmatic configuration without human intervention.<Warning>- 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.</Warning>## Flags<Accordion title="--domain" defaultOpen="true">- 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.</Accordion><Accordion title="--email">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 protected]- ```+```bash+# Example+infisical bootstrap [email protected]+```++This flag is required.- This flag is required.</Accordion><Accordion title="--password">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.</Accordion><Accordion title="--organization">- 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.</Accordion>## 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