# gcs-env

> Load environment variables from a Google Cloud Storage bucket

Latest version **1.1.1** (published 2021-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install gcs-env
pnpm add gcs-env
yarn add gcs-env
bun add gcs-env
```

Provides the command `gcs-env`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-05-27 |
| First published | 2019-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jeremy Grosser |
| Maintainers | synack |

## Links

- npm: https://www.npmjs.com/package/gcs-env
- Repository: https://github.com/JeremyGrosser/gcs-env
- Issues: https://github.com/JeremyGrosser/gcs-env/issues
- npm.io page: https://npm.io/package/gcs-env

## Dependencies (5)

- [got](https://npm.io/package/got.md) ^11.8.2
- [yargs](https://npm.io/package/yargs.md) ^17.0.1
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.3
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.1
- [@google-cloud/storage](https://npm.io/package/@google-cloud/storage.md) ^5.8.5

## Recent versions

- 1.1.1 (latest) — 2021-05-27
- 1.1.0 — 2021-05-27
- 1.0.6 — 2020-03-21
- 1.0.5 — 2020-01-16
- 1.0.4 — 2019-11-26

## README

# gcs-env
Populate environment variables based on values stored in a Google Cloud Storage bucket.

    Usage: gcs-env -b bucket [-e environment] <command> [args...]

        bucket      GCS bucket your environment variables are stored in
        environment Name of this environment, used as a prefix when reading from
                    the bucket. If environment is not specified, gcs-env will
                    attempt to connect to the Compute Engine Metadata service and use the current
                    project ID as the environment name.
        command     Command to execute
        args        Optional arguments to be passed to command


## Example
You must be authenticated with a Google Cloud account for this to work. Run `gcloud auth login` or read [Getting Started with Authentication](https://cloud.google.com/docs/authentication/getting-started) for information on using application default credentials.

    echo -n "supersecretpassword" >SECRET_VARIABLE_NAME
    gsutil mb gs://example-env
    gsutil cp SECRET_VARIABLE_NAME gs://example-env/exampleprojectid/SECRET_VARIABLE_NAME
    gcs-env -b example-env -e exampleprojectid -- /bin/sh -c 'echo ${SECRET_VARIABLE_NAME}'

You should configure permissions on the GCS bucket or individual objects to limit who can read and modify your secrets!

---
_Source: https://npm.io/package/gcs-env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
