> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Inject secrets during local development

> Store secrets in Infisical and deliver them to your local application without a `.env` file.

This quickstart guide walks you through the recommended secrets management workflow for local development. You'll create a [project](/docs/documentation/platform/secrets-mgmt/project), add secrets to one of its environments, and inject them into your local application using the [Infisical CLI](/docs/cli/overview), all without needing a `.env` file.

<Info>
  Prerequisites:

  * An Infisical account on [Infisical Cloud](https://app.infisical.com) or a [self-hosted instance](/docs/self-hosting/overview)
  * The [Infisical CLI](/docs/cli/overview) installed for your platform
  * An application or script you run locally
</Info>

## Step 1: Configure in Infisical

### Create a project

In Infisical, a [project](/docs/documentation/platform/secrets-mgmt/project) holds all secrets for one application or service. To create a project:

<Steps>
  <Step>
    Log in to [Infisical](https://app.infisical.com).
  </Step>

  <Step>
    Select **Secrets Management** > **+ Add New Project**.
  </Step>

  <Step>
    In the **Project Name** field, enter a name for the project (e.g., `orders-service`).
  </Step>

  <Step>
    Select **Create Project**.
  </Step>
</Steps>

This opens your new project in the **Development** environment:

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical/documentation/platform/secrets-mgmt/quick-starts/assets/new-project.png" alt="New project" />
</Frame>

<Note>
  Within a project, secrets are organized across [environments](/docs/documentation/platform/secrets-mgmt/project#project-environments). Every new project starts with three environments: **Development**, **Staging**, and **Production**.
</Note>

### Add your secrets

You have two options for adding secrets to your project:

<Tabs>
  <Tab title="Create secrets manually">
    To create a new secret from scratch:

    <Steps>
      <Step>
        Select **+ Add a New Secret**.
      </Step>

      <Step>
        In the **Key** and **Value** fields, enter a key-value pair. For example:

        <Frame>
          <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical/documentation/platform/secrets-mgmt/quick-starts/assets/key-value-fields.png" alt="Key and Value fields" />
        </Frame>
      </Step>

      <Step>
        Select **Create Secret**.
      </Step>

      <Step>
        Repeat these steps for each key-value pair you want to add.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Import secrets from an existing file">
    To import secrets from an existing file:

    <Steps>
      <Step>
        Drag and drop the file containing your secrets (or enter the file's contents manually by selecting **Paste Secrets**).
      </Step>

      <Step>
        Review the discovered secrets. For example:

        <Frame>
          <img src="https://mintlify.s3.us-west-1.amazonaws.com/infisical/documentation/platform/secrets-mgmt/quick-starts/assets/review-secrets.png" alt="Review secrets" />
        </Frame>
      </Step>

      <Step>
        Select **Upload Secrets**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Step 2: Connect your app to Infisical

Now that you've set up a project that holds your secrets in Infisical, you can connect your application and give it access to those secrets at runtime.

### Authenticate with the CLI

Authenticate with the Infisical CLI by running [`infisical login`](/docs/cli/commands/login):

```bash theme={"dark"}
infisical login
```

This prompts you to select your hosting option, then opens your browser to complete the login.

<Note>
  In a containerized environment such as WSL 2 or Codespaces, run `infisical login -i` to avoid browser-based login.
</Note>

### Connect your project

Next, connect your application to your Infisical project:

<Steps>
  <Step>
    In your application's directory, link it to the Infisical project you created by running [`infisical init`](/docs/cli/commands/init):

    ```bash theme={"dark"}
    infisical init
    ```
  </Step>

  <Step>
    Follow the prompts to select the organization/project where you created your secrets earlier. This writes a `.infisical.json` file to your project with [local project settings](/docs/cli/project-config):

    ```json .infisical.json theme={"dark"}
    {
      "workspaceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "defaultEnvironment": "",
      "gitBranchToEnvironmentMapping": null
    }
    ```

    <Note>
      `.infisical.json` files contain no secrets and are safe to commit to version control systems like git.
    </Note>
  </Step>
</Steps>

## Step 3: Inject secrets into your app

Now that your Infisical project is configured within your application, Infisical can provide the secrets.

Start your application by wrapping its start command with [`infisical run`](/docs/cli/commands/run):

<CodeGroup>
  ```bash Node.js theme={"dark"}
  infisical run --env=dev -- npm run dev
  ```

  ```bash Flask theme={"dark"}
  infisical run --env=dev -- flask run
  ```

  ```bash Go theme={"dark"}
  infisical run --env=dev -- go run main.go
  ```
</CodeGroup>

Infisical fetches the secrets and injects them as environment variables. This lets your application read the secrets from its environment at runtime.

<Check>
  You can now manage your application's secrets through Infisical without needing a `.env` file.
</Check>

## Next Steps

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book" href="/docs/documentation/platform/secrets-mgmt/concepts/secrets-mgmt">
    Understand how projects, environments, folders, and secrets fit together.
  </Card>

  <Card title="Secrets Delivery" icon="truck-fast" href="/docs/documentation/platform/secrets-mgmt/concepts/secrets-delivery">
    Deliver secrets to production with SDKs, agents, Kubernetes, and CI/CD.
  </Card>

  <Card title="Local Development Guide" icon="laptop-code" href="/docs/documentation/guides/local-development">
    Set up a secure local development workflow for your whole team.
  </Card>

  <Card title="Access Control" icon="shield-halved" href="/docs/documentation/platform/secrets-mgmt/concepts/access-control">
    Scope who can access which environments and paths.
  </Card>
</CardGroup>
