Bage (Bulk Age) is a command-line tool designed to perform bulk encryption using the age encryption format. It allows you to encrypt multiple folders in a single operation, with support for selective inclusion, exclusion, cleanup, and filename randomization.
Before using bage, ensure that the following are available on your system:
- A Unix-like environment (Linux or macOS)
curlfor installation
Install bage by running the following command in your terminal:
curl -fsSL https://raw.githubusercontent.com/hwisnu222/bage/main/install.sh | bashThe install script will download the bage binary and place it in your system path.
Bage provides two primary subcommands:
encryptfor encrypting foldersdecryptfor decrypting encrypted content
To encrypt all folders in the current working directory:
bage encryptThis command scans the current directory and encrypts every folder it finds.
If your target folders are located in a different directory, specify the path with the -p or --path flag:
bage encrypt -p dir/All subfolders inside dir will be encrypted.
To encrypt only selected folders, use the -i or --include flag followed by a comma-separated list of folder names:
bage encrypt -i dir,dir1,dir2To encrypt all folders except certain ones, use the -e or --exclude flag:
bage encrypt -p dir -e subdir,subdir1To delete the original folders once encryption is complete, add the --clean flag:
bage encrypt -p dir -i subdir,subdir1,subdir2 --cleanThis is useful for removing plaintext source data after it has been securely encrypted.
To replace original filenames with randomized names during encryption, use the -x flag:
bage encrypt -xThis adds an extra layer of privacy by obscuring the identity of the encrypted content.
To preview which folders would be processed without actually encrypting them, use the -d flag:
bage encrypt -dThis is helpful for verifying your command before committing to the operation.
To decrypt all folders in the current directory:
bage decryptTo decrypt folders in a specific path while excluding some:
bage decrypt -p dir -e subdir1,subdir2| Option | Description |
|---|---|
-p, --path <PATH> |
Encrypt all subfolders within the source directory. Default: . |
-i, --include <INCLUDE> |
Encrypt specific directories (comma-separated). |
-e, --exclude <EXCLUDE> |
Encrypt all directories except the excluded ones (comma-separated). |
-x |
Replace filenames with randomized names. |
-d |
Dry run. Preview folders without processing. |
--clean |
Delete source folders after encryption. |
| Option | Description |
|---|---|
-p, --path <PATH> |
Decrypt all subfolders within the source directory. Default: . |
-i, --include <INCLUDE> |
Decrypt specific directories (comma-separated). |
-e, --exclude <EXCLUDE> |
Decrypt all directories except the excluded ones (comma-separated). |
--clean |
Delete encrypted folders after decryption. |
- Always verify your command with the
-dflag before running encryption on important data. - The
--cleanoption permanently deletes source folders. Use it with caution. - When combining
-pand-i, the include list is resolved relative to the path specified.