mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
57 lines
1.6 KiB
Plaintext
57 lines
1.6 KiB
Plaintext
---
|
|
title: "Usage"
|
|
---
|
|
|
|
Prerequisite: [Install the CLI](../../getting-started/cli/installation)
|
|
|
|
## Login
|
|
|
|
Login in using the `login` command in your terminal. Logging in is a one-time, post-installation action that authenticates you with the platform — to change users, you can run the command again.
|
|
|
|
```bash
|
|
infisical login
|
|
```
|
|
|
|
## Initialization
|
|
|
|
In the root of your local project, initialize Infisical and follow steps to connect your project to the platform.
|
|
|
|
```bash
|
|
cd /path/to/project
|
|
|
|
# initialization
|
|
infisical init
|
|
```
|
|
|
|
## Injecting environment variables
|
|
|
|
To inject environment variables from the platform to your project, use the `run` command.
|
|
|
|
```bash
|
|
# command
|
|
infisical run -- [your application start command]
|
|
```
|
|
|
|
Options you can specify:
|
|
|
|
| Option | Description | Default value |
|
|
| ------------- | ----------------------------------------------------------------------------------------------------------- | ------------- |
|
|
| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` |
|
|
| `--projectId` | Used to link a local project to the platform (required only if injecting via the service token method) | `None` |
|
|
|
|
Examples:
|
|
|
|
```bash
|
|
# example with node
|
|
infisical run -- node index.js
|
|
|
|
# example with node (nodemon)
|
|
infisical run -- nodemon index.js
|
|
|
|
# example with node (nodemon) pulling in secrets from test environment
|
|
infisical run --env=test -- nodemon index.js
|
|
|
|
# example with flask
|
|
infisical run -- flask run
|
|
```
|