Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotlock

A simple command-line tool to encrypt and decrypt your .env files using a password. This tool ensures that you can safely push sensitive .env files to a public GitHub repository without exposing sensitive keys.


🚀 Installation

You can install dotlock globally or use it locally in your project.

Global Installation (Recommended)

To install globally, run:

npm install -g dotlock

📦 Usage

You can use dotlock via the command line with the following commands:

Continuously encrypt a .env file

This command monitors your .env file for changes and automatically encrypts it when saved:

dotlock watch --password your_password
# or shorthand
dotlock watch -p your_password

Encrypt a .env File

Encrypt your .env file with a password:

dotlock encrypt --password your_password
# or shorthand
dotlock encrypt -p your_password

Decrypt an Encrypted .env.enc File

Decrypt a previously encrypted .env.enc file with the same password:

dotlock decrypt --password your_password
# or shorthand (note the double dash)
dotlock decrypt -p your_password

Note: The decryption process will complete even if the password is incorrect, but the file contents will be corrupted and unreadable.


🛠 Use Locally

You can also use dotlock locally without installing by running via npx:

npx dotlock encrypt --password your_password

Releases

Packages

Used by

Contributors

Languages