mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 12:27:28 +00:00
docs: update login command documentation to include silent flag usage and improve accordion structure
This commit is contained in:
+53
-43
@@ -22,10 +22,12 @@ If you have added multiple users, you can switch between the users by using the
|
|||||||
|
|
||||||
<Info>
|
<Info>
|
||||||
**JWT Token Output:**
|
**JWT Token Output:**
|
||||||
- For **user authentication** with the `--plain` flag: outputs only the JWT access token (useful for scripting)
|
- For **user authentication** with the `--plain --silent` flags: outputs only the JWT access token (useful for scripting)
|
||||||
- For **machine identity authentication**: an access token is always printed to the console
|
- For **machine identity authentication**: an access token is always printed to the console
|
||||||
|
|
||||||
Use the `--plain` flag to print only the token in plain text, which is ideal for capturing in environment variables or CI/CD pipelines.
|
Use the `--plain` flag to print only the token in plain text and the `--silent` flag to disable update alerts.
|
||||||
|
|
||||||
|
Both flags are ideal for capturing the token in environment variables or CI/CD pipelines.
|
||||||
</Info>
|
</Info>
|
||||||
|
|
||||||
### Authentication Methods
|
### Authentication Methods
|
||||||
@@ -61,34 +63,33 @@ User authentication is designed for individual developers and supports multiple
|
|||||||
</Expandable>
|
</Expandable>
|
||||||
</ParamField>
|
</ParamField>
|
||||||
|
|
||||||
<Steps>
|
<AccordionGroup>
|
||||||
<Step title="Choose your login method">
|
<Accordion title="Browser Login (Default)">
|
||||||
**Browser Login (Default)**
|
```bash
|
||||||
```bash
|
infisical login
|
||||||
infisical login
|
```
|
||||||
```
|
</Accordion>
|
||||||
|
<Accordion title="Direct Login (CI/CD)">
|
||||||
|
```bash
|
||||||
|
infisical login [email protected] --password=your-password
|
||||||
|
|
||||||
**Direct Login (CI/CD)**
|
# Or using environment variables
|
||||||
```bash
|
export INFISICAL_EMAIL="[email protected]"
|
||||||
infisical login [email protected] --password=your-password
|
export INFISICAL_PASSWORD="your-password"
|
||||||
|
infisical login
|
||||||
# Or using environment variables
|
```
|
||||||
export INFISICAL_EMAIL="[email protected]"
|
</Accordion>
|
||||||
export INFISICAL_PASSWORD="your-password"
|
<Accordion title="Interactive CLI Login">
|
||||||
infisical login
|
```bash
|
||||||
```
|
infisical login --interactive
|
||||||
|
```
|
||||||
**Interactive CLI Login**
|
</Accordion>
|
||||||
```bash
|
<Accordion title="Plain Token Output (for scripting)">
|
||||||
infisical login --interactive
|
```bash
|
||||||
```
|
export INFISICAL_TOKEN=$(infisical login [email protected] --password=your-password --plain --silent)
|
||||||
|
```
|
||||||
**Plain Token Output (for scripting)**
|
</Accordion>
|
||||||
```bash
|
</AccordionGroup>
|
||||||
export INFISICAL_TOKEN=$(infisical login [email protected] --password=your-password --plain)
|
|
||||||
```
|
|
||||||
</Step>
|
|
||||||
</Steps>
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</AccordionGroup>
|
</AccordionGroup>
|
||||||
|
|
||||||
@@ -457,9 +458,13 @@ The login command supports a number of flags that you can use for different auth
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example: Capture token in a variable
|
# Example: Capture token in a variable
|
||||||
export INFISICAL_TOKEN=$(infisical login --email=<email> --password=<password> --plain)
|
export INFISICAL_TOKEN=$(infisical login --email=<email> --password=<password> --plain --silent)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<Tip>
|
||||||
|
Use it alongside the `silent` flag to disable all messages in the console except from the access token.
|
||||||
|
</Tip>
|
||||||
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
<Accordion title="--oidc-jwt">
|
<Accordion title="--oidc-jwt">
|
||||||
```bash
|
```bash
|
||||||
@@ -481,6 +486,18 @@ The login command supports a number of flags that you can use for different auth
|
|||||||
The following examples demonstrate different ways to authenticate as a user with the Infisical CLI.
|
The following examples demonstrate different ways to authenticate as a user with the Infisical CLI.
|
||||||
|
|
||||||
<AccordionGroup>
|
<AccordionGroup>
|
||||||
|
<Accordion title="Browser Login (Default)">
|
||||||
|
By default, running `infisical login` without any flags opens your browser for authentication.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Opens browser for authentication
|
||||||
|
infisical login
|
||||||
|
```
|
||||||
|
|
||||||
|
The browser will open to the Infisical login page, and upon successful authentication, the CLI will be automatically authenticated.
|
||||||
|
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="Direct Login (Non-Interactive)">
|
<Accordion title="Direct Login (Non-Interactive)">
|
||||||
Direct login is ideal for CI/CD pipelines and automation scripts where browser-based authentication is not possible.
|
Direct login is ideal for CI/CD pipelines and automation scripts where browser-based authentication is not possible.
|
||||||
|
|
||||||
@@ -497,7 +514,7 @@ The following examples demonstrate different ways to authenticate as a user with
|
|||||||
infisical login --email [email protected] --password "your-password" --domain https://eu.infisical.com
|
infisical login --email [email protected] --password "your-password" --domain https://eu.infisical.com
|
||||||
|
|
||||||
# Output only JWT token for scripting
|
# Output only JWT token for scripting
|
||||||
export INFISICAL_TOKEN=$(infisical login --email [email protected] --password "your-password" --plain)
|
export INFISICAL_TOKEN=$(infisical login --email [email protected] --password "your-password" --plain --silent)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using Environment Variables (Recommended for CI/CD)
|
#### Using Environment Variables (Recommended for CI/CD)
|
||||||
@@ -512,7 +529,7 @@ The following examples demonstrate different ways to authenticate as a user with
|
|||||||
infisical login
|
infisical login
|
||||||
|
|
||||||
# Or with plain output for token capture
|
# Or with plain output for token capture
|
||||||
export INFISICAL_TOKEN=$(infisical login --plain)
|
export INFISICAL_TOKEN=$(infisical login --plain --silent)
|
||||||
```
|
```
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
@@ -530,19 +547,12 @@ The following examples demonstrate different ways to authenticate as a user with
|
|||||||
|
|
||||||
</Accordion>
|
</Accordion>
|
||||||
|
|
||||||
<Accordion title="Browser Login (Default)">
|
|
||||||
By default, running `infisical login` without any flags opens your browser for authentication.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Opens browser for authentication
|
|
||||||
infisical login
|
|
||||||
```
|
|
||||||
|
|
||||||
The browser will open to the Infisical login page, and upon successful authentication, the CLI will be automatically authenticated.
|
|
||||||
|
|
||||||
</Accordion>
|
|
||||||
</AccordionGroup>
|
</AccordionGroup>
|
||||||
|
|
||||||
|
<Tip>
|
||||||
|
If you have SSO enabled, we recommend using the default browser login.
|
||||||
|
</Tip>
|
||||||
|
|
||||||
### Machine Identity Authentication Quick Start
|
### Machine Identity Authentication Quick Start
|
||||||
|
|
||||||
In this example we'll be using the `universal-auth` method to login to obtain an Infisical access token, which we will then use to fetch secrets with.
|
In this example we'll be using the `universal-auth` method to login to obtain an Infisical access token, which we will then use to fetch secrets with.
|
||||||
|
|||||||
Reference in New Issue
Block a user