### Project Setup and Contribution Workflow Source: https://github.com/dotenv-org/dotenv-vault/blob/master/CONTRIBUTING.md This snippet outlines the standard Git workflow for contributing to the project, including forking, installing dependencies, creating branches, committing changes, and submitting pull requests. ```git npm install git checkout -b my-new-feature git commit -am "Added some feature" git push origin my-new-feature ``` -------------------------------- ### Install and Push .env File Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Installs the dotenv-vault CLI and securely pushes the local .env file to the vault. This is the initial step to sync your environment variables. ```sh npx dotenv-vault@latest push ``` -------------------------------- ### Running Tests Source: https://github.com/dotenv-org/dotenv-vault/blob/master/CONTRIBUTING.md This snippet shows how to install project dependencies and run the test suite using npm. ```npm npm install npm test ``` -------------------------------- ### Set DOTENV_KEY for Deployment Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md An example of how to set the DOTENV_KEY as a configuration variable on a deployment platform like Heroku. ```bash # heroku example heroku config:set DOTENV_KEY=dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production ``` -------------------------------- ### Get Production DOTENV_KEY Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Retrieves the DOTENV_KEY for a specific environment (e.g., production), which is needed to decrypt and use the .env.vault file. ```bash npx dotenv-vault@latest keys production ``` -------------------------------- ### Pull .env File Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Pulls the latest synced .env file from the vault. This command is used by team members to get the most up-to-date environment variables. ```sh npx dotenv-vault@latest pull ``` -------------------------------- ### Deploy with .env.vault Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Illustrates the deployment process, including committing the .env.vault file and pushing it to the deployment target. ```bash git add .env.vault git commit -am "Update .env.vault" git push git push heroku main # heroku example ``` -------------------------------- ### Build .env.vault file Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Builds the .env.vault file. The `--dotenvMe` flag allows passing the credential directly, and `--yes` bypasses interactive prompts. ```bash npx dotenv-vault@latest build npx dotenv-vault@latest build dotenvMe=me_b1831e… npx dotenv-vault@latest build -y ``` -------------------------------- ### Open project page Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Opens the project page in the default web browser. You can specify the environment to open. The `--yes` flag can be used to skip interactive prompts. ```bash npx dotenv-vault@latest open npx dotenv-vault@latest open production npx dotenv-vault@latest open -y ``` -------------------------------- ### Packing and Uploading Windows Executable Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md Commands for packing and uploading a Windows executable using oclif. Similar to tarballs, it covers packing, uploading with environment variables, and promoting. ```shell ./node_modules/.bin/oclif pack:win ``` ```shell env $(cat .env | xargs) ./node_modules/.bin/oclif upload win ``` ```shell env $(cat .env | xargs) ./node_modules/.bin/oclif promote --win --version VERSION --sha SHA ``` -------------------------------- ### dotenv-vault CLI Commands Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Provides essential commands for managing secrets with dotenv-vault, including project creation, authentication, and secret synchronization. ```bash $ npx dotenv-vault@latest help * [new](#new) * [login](#login) * [logout](#logout) * [push](#push) * [pull](#pull) * [open](#open) * [whoami](#whoami) * [build](#build) * [keys](#keys) * [rotatekey](#rotatekey) * [decrypt](#decrypt) * [versions](#versions) ``` -------------------------------- ### Sync .env File Changes Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Demonstrates the workflow of pushing changes to the .env file and then committing the generated .env.vault file to version control. ```bash npx dotenv-vault@latest push git add .env.vault git commit -am "Add .env.vault" git push ``` -------------------------------- ### List decryption keys Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Lists the decryption keys for .env.vault files. You can specify an environment to list keys for a specific environment, or omit it to list all. The `--dotenvMe` flag allows passing the credential directly, and `--yes` bypasses interactive prompts. ```bash npx dotenv-vault@latest keys npx dotenv-vault@latest keys production remote: Listing .env.vault decryption keys... done dotenv://:key_899..@dotenv.org/vault/.env.vault?environment=production npx dotenv-vault@latest keys dotenvMe=me_b1831e… npx dotenv-vault@latest keys -y ``` -------------------------------- ### dotenv-vault login Command Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Logs the user into the dotenv-vault service, enabling access to project management features. ```bash $ npx dotenv-vault@latest login ``` -------------------------------- ### Running Tests Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md Command to execute the test suite for the dotenv-vault project using npm. ```shell npm test ``` -------------------------------- ### List version history Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Lists the version history of .env.vault files. ```bash npx dotenv-vault@latest versions ``` -------------------------------- ### Packing and Uploading Tarballs Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md Commands for packing and uploading tarballs using oclif. It includes steps for packing, uploading with environment variables, and promoting a version. ```shell npx oclif@3.0.1 pack tarballs ``` ```shell env $(cat .env | xargs) npx oclif@3.0.1 upload tarballs ``` ```shell env $(cat .env | xargs) npx oclif@3.0.1 promote --version VERSION --sha SHA ``` -------------------------------- ### Decrypt .env.vault on Boot Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Tests if the .env.vault file decryption is working correctly on application boot. ```bash $ DOTENV_KEY='dotenv://:key_1234..@dotenv.local/vault/.env.vault?environment=production' npm start ``` -------------------------------- ### Local Development Commands Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md Commands to run local development tasks for dotenv-vault. These commands are part of the `./bin/dev` script. ```shell ./bin/dev new ./bin/dev push ./bin/dev pull ``` -------------------------------- ### Login to dotenv-vault Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Logs into dotenv-vault using a .env.me identifier. The identifier defaults to a generated value if not provided. The `--yes` flag can be used to skip interactive prompts. ```bash npx dotenv-vault@latest login me_00c7fa… npx dotenv-vault@latest login -y ``` -------------------------------- ### Push .env securely Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Pushes the .env file securely to dotenv-vault. You can specify the target environment and input filename. The `--dotenvMe` flag allows passing the credential directly, and `--yes` bypasses interactive prompts. ```bash npx dotenv-vault@latest push npx dotenv-vault@latest push production npx dotenv-vault@latest push production .env.production npx dotenv-vault@latest push --dotenvMe=me_b1831e… npx dotenv-vault@latest push -y ``` -------------------------------- ### Publishing to npm Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md Commands for versioning and publishing the dotenv-vault package to npm. This is restricted to authorized personnel. ```shell npm version patch npm publish ``` -------------------------------- ### dotenv-vault new Command Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Creates a new project at Dotenv Vault, allowing you to set a .env.vault identifier. It supports interactive and non-interactive modes. ```bash $ npx dotenv-vault@latest new ##### ARGUMENTS *[DOTENV_VAULT]* Set .env.vault identifier. Defaults to generated value. ``` $ npx dotenv-vault@latest new vlt_6beaae5… local: Adding .env.vault (DOTENV_VAULT)... done local: Added to .env.vault (DOTENV_VAULT=vlt_6beaa...) ``` ##### FLAGS *-y, --yes* Automatic yes to prompts. Assume yes to all prompts and run non-interactively. ``` -------------------------------- ### Open Environment Management UI Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Opens the dotenv-vault UI for a specific environment (e.g., production) to manage secrets. ```bash npx dotenv-vault@latest open production ``` -------------------------------- ### Set Environment Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Specifies the environment to check versions against. Defaults to 'development'. ```bash npx dotenv-vault@latest versions production ``` -------------------------------- ### Run with Decrypted Secrets Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Runs an application command, decrypting and injecting secrets using dotenvx. ```bash dotenvx run -- yourstartcommand ``` -------------------------------- ### Pass .env.me Credential Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Passes the .env.me (DOTENV_ME) credential directly, bypassing the need to read from a .env.me file. ```bash npx dotenv-vault@latest versions dotenvMe=me_b1831e… ``` -------------------------------- ### Encrypt .env.production File Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Encrypts a .env.production file using dotenvx. ```bash dotenvx encrypt -f .env.production ``` -------------------------------- ### Rotate DOTENV_KEY Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Rotates the DOTENV_KEY for a specified environment. The `--dotenvMe` flag allows passing the credential directly, and `--yes` bypasses interactive prompts. ```bash npx dotenv-vault@latest rotatekey production npx dotenv-vault@latest rotatekey dotenvMe=me_b1831e… npx dotenv-vault@latest rotatekey -y ``` -------------------------------- ### Pull Latest .env Changes Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Shows the process for a teammate to pull the latest .env changes after they have been pushed and committed. ```bash git pull npx dotenv-vault@latest pull ``` -------------------------------- ### Pull .env securely Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Pulls the .env file securely from dotenv-vault. You can specify the source environment and output filename. The `--dotenvMe` flag allows passing the credential directly, and `--yes` bypasses interactive prompts. Specific versions can also be pulled. ```bash npx dotenv-vault@latest pull npx dotenv-vault@latest pull production npx dotenv-vault@latest pull production .env.production npx dotenv-vault@latest pull --dotenvMe=me_b1831e… npx dotenv-vault@latest pull -y npx dotenv-vault@latest pull development@v14 ``` -------------------------------- ### Custom API URL for Development Source: https://github.com/dotenv-org/dotenv-vault/blob/master/DEVELOPMENT.md How to set a custom API URL for local development, useful for testing against a specific vault instance. It also shows how to disable TLS certificate verification. ```shell NODE_TLS_REJECT_UNAUTHORIZED=0 DOTENV_API_URL=https://vault.dotenv.development ./bin/dev ``` -------------------------------- ### Decrypt .env.vault File Locally Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Tests if the .env.vault file decryption is working correctly on a local machine. ```bash $ npx dotenv-vault@latest decrypt dotenv://:key_1234..@dotenv.local/vault/.env.vault?environment=production ``` -------------------------------- ### Build Encrypted .env.vault File Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Generates an encrypted .env.vault file, which is used for securely storing and deploying environment variables. ```bash npx dotenv-vault@latest build ``` -------------------------------- ### Pull .env for Specific Environment Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Pulls the .env file for a specific environment (e.g., production) to the local machine. ```bash npx dotenv-vault@latest pull production ``` -------------------------------- ### Display current user Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Displays the currently logged-in user's identifier. The `--dotenvMe` flag can be used to pass the credential directly. ```bash npx dotenv-vault@latest whoami npx dotenv-vault@latest whoami dotenvMe=me_b1831e… ``` -------------------------------- ### Automatic Yes to Prompts Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Enables non-interactive mode by automatically answering 'yes' to all prompts. ```bash npx dotenv-vault@latest versions -y ``` -------------------------------- ### Pull Specific Version Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Pulls a specific version of the dotenv-vault. ```bash npx dotenv-vault@latest pull development@v14 ``` -------------------------------- ### Logout from dotenv-vault Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Logs out the current user from dotenv-vault. The `--yes` flag can be used to skip interactive prompts. ```bash npx dotenv-vault@latest logout npx dotenv-vault@latest logout -y ``` -------------------------------- ### Decrypt .env.vault locally Source: https://github.com/dotenv-org/dotenv-vault/blob/master/README.md Decrypts a .env.vault file locally using the provided DOTENV_KEY. The DOTENV_KEY specifies which environment's key to use for decryption. ```bash npx dotenv-vault@latest decrypt dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.