From 3ebd6283630db7638698d29eca9135c306665c55 Mon Sep 17 00:00:00 2001 From: Victor Santos Date: Thu, 23 Oct 2025 11:20:30 -0300 Subject: [PATCH] docs: update login command documentation to include organization-id parameter for direct login --- docs/cli/commands/login.mdx | 52 +++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/docs/cli/commands/login.mdx b/docs/cli/commands/login.mdx index 1f7a08350..c58c13713 100644 --- a/docs/cli/commands/login.mdx +++ b/docs/cli/commands/login.mdx @@ -49,10 +49,13 @@ User authentication is designed for individual developers and supports multiple - Your email address. Required for direct login along with `--password`. + Your email address. Required for direct login along with `--password` and `--organization-id`. - Your password. Required for direct login along with `--email`. + Your password. Required for direct login along with `--email` and `--organization-id`. + + + Your organization id. Required for direct login along with `--password` and `--email`. Force interactive CLI login instead of browser-based authentication. @@ -71,11 +74,12 @@ User authentication is designed for individual developers and supports multiple ```bash - infisical login --email=user@example.com --password=your-password + infisical login --email=user@example.com --password=your-password --organization-id=your-organization-id # Or using environment variables export INFISICAL_EMAIL="user@example.com" export INFISICAL_PASSWORD="your-password" + export INFISICAL_ORGANIZATION_ID="your-organization-id" infisical login ``` @@ -86,7 +90,7 @@ User authentication is designed for individual developers and supports multiple ```bash - export INFISICAL_TOKEN=$(infisical login --email=user@example.com --password=your-password --plain --silent) + export INFISICAL_TOKEN=$(infisical login --email=user@example.com --password=your-password --organization-id=your-organization-id --plain --silent) ``` @@ -404,11 +408,11 @@ The login command supports a number of flags that you can use for different auth ```bash - infisical login --email= --password= + infisical login --email= --password= --organization-id= ``` #### Description - User email address. Required if you want to do a non-interactive login when the **--method** flag is set to **user**. Must be used together with the `--password` flag. + User email address. Required if you want to do a non-interactive login when the **--method** flag is set to **user**. Must be used together with the `--password` and `--organization-id` flag. You can omit the **--method=user** if you want as it's the default method. @@ -421,11 +425,11 @@ The login command supports a number of flags that you can use for different auth ```bash - infisical login --email= --password= + infisical login --email= --password= --organization-id= ``` #### Description - User password. Required if you want to do a non-interactive login when the **--method** flag is set to **user**. Must be used together with the `--email` flag. + User password. Required if you want to do a non-interactive login when the **--method** flag is set to **user**. Must be used together with the `--email` and `--organization-id` flag. For security in CI/CD environments, prefer using the `INFISICAL_PASSWORD` environment variable instead of passing the password as a command-line flag. @@ -439,6 +443,23 @@ The login command supports a number of flags that you can use for different auth The `password` flag can be substituted with the `INFISICAL_PASSWORD` environment variable. + + + ```bash + infisical login --email= --password= --organization-id= + ``` + + #### Description + User organization id. Required if you want to do a non-interactive login when the **--method** flag is set to **user**. Must be used together with the `--email` and `--password` flag. + + + You can omit the **--method=user** if you want as it's the default method. + + + + The `organization-id` flag can be substituted with the `INFISICAL_ORGANIZATION_ID` environment variable. + + ```bash @@ -446,12 +467,12 @@ The login command supports a number of flags that you can use for different auth ``` #### Description - Forces interactive CLI login where you'll be prompted to enter your email and password in the terminal, instead of opening a browser. + Forces interactive CLI login where you'll be prompted to enter your email, password, and select your organization in the terminal, instead of opening a browser. ```bash - infisical login --email= --password= --plain + infisical login --email= --password= --organization-id= --plain ``` #### Description @@ -459,7 +480,7 @@ The login command supports a number of flags that you can use for different auth ```bash # Example: Capture token in a variable - export INFISICAL_TOKEN=$(infisical login --email= --password= --plain --silent) + export INFISICAL_TOKEN=$(infisical login --email= --password= --organization-id= --plain --silent) ``` @@ -506,13 +527,13 @@ The following examples demonstrate different ways to authenticate as a user with ```bash # Basic direct login (defaults to US Cloud) - infisical login --email user@example.com --password "your-password" + infisical login --email user@example.com --password "your-password" --organization-id "your-organization-id" # EU Cloud (Custom domain) - infisical login --email user@example.com --password "your-password" --domain https://eu.infisical.com + infisical login --email user@example.com --password "your-password" --organization-id "your-organization-id" --domain https://eu.infisical.com # Output only JWT token for scripting - export INFISICAL_TOKEN=$(infisical login --email user@example.com --password "your-password" --plain --silent) + export INFISICAL_TOKEN=$(infisical login --email user@example.com --password "your-password" --organization-id "your-organization-id" --plain --silent) ``` #### Using Environment Variables (Recommended for CI/CD) @@ -521,6 +542,7 @@ The following examples demonstrate different ways to authenticate as a user with # Set credentials as environment variables export INFISICAL_EMAIL="user@example.com" export INFISICAL_PASSWORD="your-password" + export INFISICAL_ORGANIZATION_ID="your-organization-id" # Login without additional flags infisical login @@ -542,6 +564,8 @@ The following examples demonstrate different ways to authenticate as a user with - Email address - Password + After the prompt, you will be shown a list of organizations to choose from. +