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

# Go Environment Variables: Secrets Manager for Go Apps

> Manage encrypted secrets for Go services with Capy. Wrap go run and go test, keep os.Getenv working unchanged, and ship binaries with zero plaintext.

Use `capy run` to decrypt `.env` and pass the plaintext values to your binary. Your code reads env vars with `os.Getenv` or any config library (Viper, envconfig).

<Steps>
  <Step title="Install the CLI">
    <CodeGroup>
      ```bash brew theme={null}
      brew install capysc/tap/capy
      ```

      ```bash npm theme={null}
      npm install -g @capysc/cli
      ```

      ```bash bun theme={null}
      bun add -g @capysc/cli
      ```
    </CodeGroup>
  </Step>

  <Step title="Sync your secrets">
    ```bash theme={null}
    capy
    ```

    Authenticates, creates the project on first run, encrypts every value in `.env`, and rewrites the file with `capy:…` snippets.
  </Step>

  <Step title="Run your app">
    ```bash theme={null}
    capy run -- go run .
    capy run -- ./my-binary
    capy run -- go test ./...
    ```

    Read env vars the standard way:

    ```go theme={null}
    import "os"

    dbURL := os.Getenv("DATABASE_URL")
    ```
  </Step>

  <Step title="Invite a teammate">
    ```bash theme={null}
    capy invite teammate@example.com
    ```
  </Step>

  <Step title="Deploy">
    ```bash theme={null}
    capy deploy
    ```
  </Step>
</Steps>

## What's next

<Columns cols={2}>
  <Card title="Running your app" icon="play" href="/using/running-your-app" horizontal>
    The full story on `capy run`.
  </Card>

  <Card title="Deploying" icon="rocket" href="/using/deploying" horizontal>
    Deploy tokens and platform walkthroughs.
  </Card>
</Columns>
