fix: review comments

This commit is contained in:
Piyush Gupta
2025-11-26 18:17:35 +05:30
parent 241874094c
commit e22369ec4d
2 changed files with 44 additions and 48 deletions
+34 -38
View File
@@ -43,34 +43,29 @@ User authentication is designed for individual developers and supports multiple
<Accordion title="User"> <Accordion title="User">
The User authentication method allows you to log in with your email and password. This method supports three different login flows: The User authentication method allows you to log in with your email and password. This method supports three different login flows:
- **Browser Login** (default): Opens a browser for authentication - **Browser Login** (default): Opens a browser for authentication
- **Direct Login**: Provide credentials via flags or environment variables for CI/CD - **Direct Login**: Provide credentials via flags or environment variables for CI/CD
- **Interactive CLI Login**: Enter credentials via CLI prompts using `--interactive` - **Interactive CLI Login**: Enter credentials via CLI prompts using `--interactive`
{" "} <ParamField query="Flags">
<Expandable title="properties">
<ParamField query='Flags'> <ParamField query="email" type="string" optional>
<Expandable title='properties'> Your email address. Required for direct login along with `--password` and `--organization-id`.
<ParamField query='email' type='string' optional> </ParamField>
Your email address. Required for direct login along with `--password` and <ParamField query="password" type="string" optional>
`--organization-id`. Your password. Required for direct login along with `--email` and `--organization-id`.
</ParamField> </ParamField>
<ParamField query='password' type='string' optional> <ParamField query="organization-id" type="string" optional>
Your password. Required for direct login along with `--email` and Your organization id. Required for direct login along with `--password` and `--email`.
`--organization-id`. </ParamField>
</ParamField> <ParamField query="interactive" type="boolean" optional>
<ParamField query='organization-id' type='string' optional> Force interactive CLI login instead of browser-based authentication.
Your organization id. Required for direct login along with `--password` </ParamField>
and `--email`. <ParamField query="plain" type="boolean" optional>
</ParamField> Output only the JWT token (useful for scripting and CI/CD).
<ParamField query='interactive' type='boolean' optional> </ParamField>
Force interactive CLI login instead of browser-based authentication. </Expandable>
</ParamField> </ParamField>
<ParamField query='plain' type='boolean' optional>
Output only the JWT token (useful for scripting and CI/CD).
</ParamField>
</Expandable>
</ParamField>
<AccordionGroup> <AccordionGroup>
<Accordion title="Browser Login (Default)"> <Accordion title="Browser Login (Default)">
@@ -297,7 +292,6 @@ Machine identity authentication methods are designed for automated systems, serv
``` ```
</Step> </Step>
</Steps> </Steps>
</Accordion> </Accordion>
<Accordion title="JWT Auth"> <Accordion title="JWT Auth">
@@ -323,7 +317,6 @@ Machine identity authentication methods are designed for automated systems, serv
``` ```
</Step> </Step>
</Steps> </Steps>
</Accordion> </Accordion>
</AccordionGroup> </AccordionGroup>
@@ -511,18 +504,21 @@ The login command supports a number of flags that you can use for different auth
</Accordion> </Accordion>
<Accordion title="--domain"> <Accordion title="--domain">
```bash ```bash
infisical login --domain=<domain-url> [other-flags] infisical login --domain=<domain-url>
``` ```
#### Description #### Description
Specifies the Infisical API URL for non-US instances (EU Cloud or self-hosted instances). This flag is required when connecting to any instance other than the US Cloud. Specifies the Infisical API URL for non-US Cloud instances. This flag is required when connecting to any instance other than US Cloud (e.g. EU Cloud or self-hosted).
```bash ```bash
# Example for EU Cloud # Example for EU Cloud
infisical login --domain="https://eu.infisical.com" --jwt=<jwt-token> --machine-identity-id=<machine-identity-id> infisical login --domain="https://eu.infisical.com"
# Example for localhost
infisical login --domain="http://localhost:8080"
# Example for self-hosted # Example for self-hosted
infisical login --domain="https://your-self-hosted-infisical.com/api" --email [email protected] --password "password" infisical login --domain="https://your-self-hosted-infisical.com"
``` ```
<Warning> <Warning>
@@ -558,11 +554,11 @@ The following examples demonstrate different ways to authenticate as a user with
# Basic direct login (defaults to US Cloud) # Basic direct login (defaults to US Cloud)
infisical login --email [email protected] --password "your-password" --organization-id "your-organization-id" infisical login --email [email protected] --password "your-password" --organization-id "your-organization-id"
# EU Cloud # Basic direct login (EU Cloud)
infisical login --domain https://eu.infisical.com --email [email protected] --password "your-password" --organization-id "your-organization-id" infisical login --domain https://eu.infisical.com --email [email protected] --password "your-password" --organization-id "your-organization-id"
# Self-hosted instance # Basic direct login (Self-hosted Instance)
infisical login --domain https://your-self-hosted-infisical.com/api --email [email protected] --password "your-password" --organization-id "your-organization-id" infisical login --domain https://your-self-hosted-infisical.com --email [email protected] --password "your-password" --organization-id "your-organization-id"
# Output only JWT token for scripting # Output only JWT token for scripting
export INFISICAL_TOKEN=$(infisical login --email [email protected] --password "your-password" --organization-id "your-organization-id" --plain --silent) export INFISICAL_TOKEN=$(infisical login --email [email protected] --password "your-password" --organization-id "your-organization-id" --plain --silent)
@@ -584,7 +580,7 @@ The following examples demonstrate different ways to authenticate as a user with
``` ```
<Warning> <Warning>
**For non-US instances:** If you're using EU Cloud, or a self-hosted instance, you must set `INFISICAL_API_URL` before login, or use `--domain` on all commands. Refer to the [Domain Configuration](/cli/usage#domain-configuration) section for more details. **For non-US Cloud instances:** If you're using EU Cloud or a self-hosted instance, you must set `INFISICAL_API_URL` before login or use `--domain` on all commands. Refer to the [Domain Configuration](/cli/usage#domain-configuration) section for more details.
</Warning> </Warning>
</Accordion> </Accordion>
@@ -622,7 +618,7 @@ In this example we'll be using the `universal-auth` method to login to obtain an
``` ```
<Warning> <Warning>
**For non-US instances:** If you're using EU Cloud, or a self-hosted instance, you must set `INFISICAL_API_URL` before login, or use `--domain` on all commands. Refer to the [Domain Configuration](/cli/usage#domain-configuration) section for more details. **For non-US Cloud instances:** If you're using EU Cloud or a self-hosted instance, you must set `INFISICAL_API_URL` before login or use `--domain` on all commands. Refer to the [Domain Configuration](/cli/usage#domain-configuration) section for more details.
</Warning> </Warning>
Now that we've set the `INFISICAL_TOKEN` environment variable, we can use the CLI to interact with Infisical. The CLI will automatically check for the presence of the `INFISICAL_TOKEN` environment variable and use it for authentication. Now that we've set the `INFISICAL_TOKEN` environment variable, we can use the CLI to interact with Infisical. The CLI will automatically check for the presence of the `INFISICAL_TOKEN` environment variable and use it for authentication.
+10 -10
View File
@@ -127,7 +127,7 @@ The CLI is designed for a variety of secret management applications ranging from
<Note> <Note>
Starting with CLI version v0.4.0, you can now choose to log in via Infisical Cloud (US/EU) or your own self-hosted instance by simply running `infisical login` and following the on-screen instructions — no need to manually set the `INFISICAL_API_URL` environment variable. Starting with CLI version v0.4.0, you can now choose to log in via Infisical Cloud (US/EU) or your own self-hosted instance by simply running `infisical login` and following the on-screen instructions — no need to manually set the `INFISICAL_API_URL` environment variable.
For versions prior to v0.4.0, the CLI defaults to the US Cloud. To connect to the EU Cloud or a self-hosted instance, set the `INFISICAL_API_URL` environment variable to `https://eu.infisical.com` or your custom URL. For versions prior to v0.4.0, the CLI defaults to US Cloud. To connect to EU Cloud or a self-hosted instance, set the `INFISICAL_API_URL` environment variable to `https://eu.infisical.com` or your custom URL.
</Note> </Note>
@@ -136,7 +136,7 @@ For versions prior to v0.4.0, the CLI defaults to the US Cloud. To connect to th
**Important:** If you're not using interactive login, you must configure the domain for **all CLI commands**. **Important:** If you're not using interactive login, you must configure the domain for **all CLI commands**.
The CLI defaults to the US Cloud (https://app.infisical.com). To connect to the **EU Cloud (https://eu.infisical.com)** or a **self-hosted instance**, you can configure the domain in one of the following ways: The CLI defaults to US Cloud (https://app.infisical.com). To connect to **EU Cloud (https://eu.infisical.com)** or a **self-hosted instance**, you MUST configure the domain in one of the following ways:
- Use the `INFISICAL_API_URL` environment variable - Use the `INFISICAL_API_URL` environment variable
- Use the `--domain` flag on every command - Use the `--domain` flag on every command
@@ -175,7 +175,7 @@ The CLI defaults to the US Cloud (https://app.infisical.com). To connect to the
infisical login --domain="https://your-domain.infisical.com" --method=universal-auth --client-id=<client-id> --client-secret=<client-secret> --silent --plain infisical login --domain="https://your-domain.infisical.com" --method=universal-auth --client-id=<client-id> --client-secret=<client-secret> --silent --plain
# All subsequent commands must also include --domain # All subsequent commands must also include --domain
infisical secrets --domain="https://your-domain.infisical.com" --projectId <id> --env dev infisical secrets --domain="https://your-domain.infisical.com" --projectId=<id> --env=dev
``` ```
<Note> <Note>
@@ -242,12 +242,12 @@ For security and privacy concerns, we recommend you to configure your terminal t
## FAQ ## FAQ
<AccordionGroup> <AccordionGroup>
<Accordion title="Can I connect the CLI to my self-hosted Infisical instance or non-US Cloud?"> <Accordion title="Can I connect the CLI to my self-hosted or non-US Cloud Infisical instance?">
Yes. The CLI is set to connect to Infisical US Cloud by default, but if you're using the EU Cloud, a self-hosted instance, you need to configure the domain for **all CLI commands**. Yes. The CLI is set to connect to Infisical US Cloud by default, but if you're using EU Cloud or a self-hosted instance you can to configure the domain for **all CLI commands**.
#### Method 1:Use the updated CLI (v0.4.0+) #### Method 1: Use the updated CLI (v0.4.0+)
Beginning with CLI version V0.4.0, you can choose between logging in through the Infisical US Cloud, EU Cloud, or your own self-hosted instance. Simply execute the `infisical login` command and follow the on-screen instructions. Beginning with CLI version V0.4.0, you can choose between logging in through Infisical US Cloud, EU Cloud, or your own self-hosted instance. Simply execute the `infisical login` command and follow the on-screen instructions.
#### Method 2: Export environment variable #### Method 2: Export environment variable
@@ -287,15 +287,15 @@ For security and privacy concerns, we recommend you to configure your terminal t
#### Method 3: Set manually on every command #### Method 3: Set manually on every command
If you prefer not to set the environment variable, you must include the `--domain` flag on **every CLI command** you run: If you prefer not to use an environment variable, you must include the `--domain` flag on **every CLI command** you run:
```bash ```bash
# Login with domain # Login with domain
infisical login --domain="https://your-domain.infisical.com" --method=oidc-auth --jwt $JWT infisical login --domain="https://your-domain.infisical.com" --method=oidc-auth --jwt $JWT
# All subsequent commands must also include --domain # All subsequent commands must also include --domain
infisical secrets --domain="https://your-self-hosted-infisical.com/api" --projectId <id> --env dev infisical secrets --domain="https://your-self-hosted-infisical.com" --projectId <id> --env dev
infisical export --domain="https://your-self-hosted-infisical.com/api" --format=dotenv-export infisical export --domain="https://your-self-hosted-infisical.com" --format=dotenv-export
``` ```
<Tip> <Tip>