npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@industriousoffice/local-beeswax

v1.0.0

Published

CLI tool for encrypting/decrypting beeswax-compatible vault files using AWS KMS and Encryption SDK

Readme

Local App Vaults CLI

A CLI tool for managing beeswax-compatible encrypted vault files using AWS KMS and the AWS Encryption SDK. This tool allows you to securely encrypt and decrypt configuration files and sensitive data using the same format as beeswax.

Features

  • Beeswax Compatibility: Creates and reads vault files in the same format as beeswax
  • AWS Encryption SDK: Uses envelope encryption with the AWS Encryption SDK
  • AWS KMS Integration: Supports KMS key aliases and ARNs
  • CLI Interface: Easy-to-use command-line tool
  • TypeScript: Fully typed for better development experience
  • Error Handling: Proper error handling and user feedback

Installation

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. (Optional) Link the CLI globally:
npm link

Usage

CLI Commands

Encrypt a file to create a beeswax vault file

vault encrypt <input-file> <output-file> <kms-key-id> <application> <stack> <component>

Example:

vault encrypt config.env app.vault alias/local-app-vault-configuration access-control-service local app

Decrypt a beeswax vault file

vault decrypt <input-file> <output-file>

Example:

vault decrypt app.vault config.env

Options

  • --region <region>: AWS region (default: us-east-1 or AWS_REGION env var)
  • --profile <profile>: AWS profile to use
  • -h, --help: Show help

Quiet Mode

Set the QUIET environment variable to suppress verbose output:

# Suppress CLI verbose output
QUIET=true vault encrypt
QUIET=1 vault encrypt

# Normal verbose output
vault encrypt

Note: Errors and warnings will always be displayed, even in quiet mode.

Development Usage

You can also use the CLI in development mode:

npm run dev encrypt config.env app.vault alias/my-kms-key myapp prod api
npm run dev decrypt app.vault config.env

Programmatic Usage

import { VaultManager } from 'local-app-vaults-cli';

async function example() {
    const vault = new VaultManager({ region: 'us-east-1' });

    // Encrypt a file to beeswax vault format
    await vault.encryptToVaultFile(
        'config.env', 
        'app.vault', 
        'alias/my-kms-key',
        { 
            application: 'myapp', 
            stack: 'prod', 
            component: 'api' 
        }
    );

    // Decrypt a beeswax vault file
    const decryptedContent = await vault.decryptVaultFile('app.vault');
    console.log(decryptedContent);
}

AWS Configuration

The CLI uses the AWS SDK, which will automatically use your AWS credentials from:

  1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
  2. AWS credentials file (~/.aws/credentials)
  3. IAM roles (if running on EC2/ECS/Lambda)

Required IAM Permissions

Your AWS credentials need the following KMS permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Encrypt",
                "kms:Decrypt",
                "kms:GenerateDataKey"
            ],
            "Resource": "arn:aws:kms:region:account:key/key-id"
        }
    ]
}

Environment Variables

  • AWS_REGION: Default AWS region
  • AWS_PROFILE: Default AWS profile
  • AWS_ACCESS_KEY_ID: AWS access key
  • AWS_SECRET_ACCESS_KEY: AWS secret key

Scripts

  • npm run build: Build the TypeScript project
  • npm run start: Run the built CLI
  • npm run dev: Run the CLI in development mode with ts-node
  • npm run test: Run tests
  • npm run lint: Run ESLint
  • npm run clean: Clean the dist directory

Directory Structure

local-app-vaults/
├── src/
│   ├── cli.ts              # CLI implementation
│   ├── vault-manager.ts    # Core VaultManager class
│   └── index.ts           # Main exports
├── dist/                  # Built JavaScript files
├── package.json
├── tsconfig.json
└── README.md

License

MIT