mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
135 lines
3.7 KiB
Plaintext
135 lines
3.7 KiB
Plaintext
---
|
|
title: "CLI"
|
|
---
|
|
|
|
The Infisical CLI is used in local development instead of `.env` files to fetch and inject secrets from the Infisical platform into any framework including [Next.js](/integrations/frameworks/nextjs), [Express](/integrations/frameworks/express), [Flask](/integrations/frameworks/flask), [Ruby on Rails](/integrations/frameworks/rails), [Laravel](/integrations/frameworks/laravel) and [more](/integrations/overview) as environment variables.
|
|
|
|
Prerequisites:
|
|
|
|
- Have a project with secrets ready in [Infisical Cloud](https://app.infisical.com).
|
|
|
|
## Installation
|
|
|
|
Follow the instructions for your operating system to install the Infisical CLI.
|
|
|
|
<Tabs>
|
|
<Tab title="MacOS">
|
|
Use [brew](https://brew.sh/) package manager
|
|
|
|
```console
|
|
$ brew install infisical/get-cli/infisical
|
|
```
|
|
</Tab>
|
|
<Tab title="Windows">
|
|
Use [Scoop](https://scoop.sh/) package manager
|
|
|
|
```console
|
|
$ scoop bucket add org https://github.com/Infisical/scoop-infisical.git
|
|
```
|
|
|
|
```console
|
|
$ scoop install infisical
|
|
```
|
|
</Tab>
|
|
<Tab title="Alpine">
|
|
Install prerequisite
|
|
```console
|
|
$ apk add --no-cache bash sudo
|
|
```
|
|
|
|
Add Infisical repository
|
|
```console
|
|
$ curl -1sLf \
|
|
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.alpine.sh' \
|
|
| bash
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ apk update && sudo apk add infisical
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="RedHat/CentOs/Amazon">
|
|
Add Infisical repository
|
|
```console
|
|
$ curl -1sLf \
|
|
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.rpm.sh' \
|
|
| sudo -E bash
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ sudo yum install infisical
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="Debian/Ubuntu">
|
|
Add Infisical repository
|
|
|
|
```console
|
|
$ curl -1sLf \
|
|
'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' \
|
|
| sudo -E bash
|
|
```
|
|
|
|
Then install CLI
|
|
```console
|
|
$ sudo apt-get update && sudo apt-get install -y infisical
|
|
```
|
|
|
|
</Tab>
|
|
<Tab title="Arch Linux">
|
|
Use the `yay` package manager to install from the [Arch User Repository](https://aur.archlinux.org/packages/infisical-bin)
|
|
|
|
```console
|
|
$ yay -S infisical-bin
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Login
|
|
|
|
Authenticate the CLI with the Infisical platform using your email and password.
|
|
|
|
```console
|
|
$ infisical login
|
|
```
|
|
|
|
## Initialization
|
|
|
|
Navigate to the root of your project directory and run the `init` command. This step connects your local project to the project on the Infisical platform and creates a `infisical.json` file containing a reference to that latter project.
|
|
|
|
```console
|
|
$ infisical init
|
|
```
|
|
|
|
## Start your app with environment variables injected
|
|
|
|
```console
|
|
$ infisical run -- [your application start command]
|
|
```
|
|
|
|
Your app should now be running with the secrets from Infisical injected as environment variables.
|
|
|
|
CLI framework resources:
|
|
|
|
- [Express/Koa/Fastify](/integrations/frameworks/express)
|
|
- [NestJS](/integrations/frameworks/nestjs)
|
|
- [Fiber](/integrations/frameworks/fiber)
|
|
- [Django](/integrations/frameworks/django)
|
|
- [Flask](/integrations/frameworks/flask)
|
|
- [Laravel](/integrations/frameworks/laravel)
|
|
- [Ruby on Rails](/integrations/frameworks/rails)
|
|
- [React](/integrations/frameworks/react)
|
|
- [Vue](/integrations/frameworks/vue)
|
|
- [Next.js](/integrations/frameworks/nextjs)
|
|
- [SvelteKit](/integrations/frameworks/sveltekit)
|
|
- [Nuxt](/integrations/frameworks/nuxt)
|
|
- [Gatsby](/integrations/frameworks/gatsby)
|
|
- [Remix](/integrations/frameworks/remix)
|
|
- [Vite](/integrations/frameworks/vite)
|
|
- [Fiber](/integrations/frameworks/fiber)
|
|
|
|
Not seeing a framework? Throw in a [request](https://github.com/Infisical/infisical/issues). |