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 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-secret-cli

v1.0.2

Published

A command-line interface tool for managing AWS Secrets Manager with .env file integration.

Readme

AWS Secrets CLI

A command-line interface tool for managing AWS Secrets Manager with .env file integration.

Features

  • Interactive initialization and configuration
  • Manage AWS Secrets Manager directly from the command line
  • Sync between .env files and AWS Secrets Manager
  • Support for multiple environments
  • Secure credential handling
  • Easy secret management workflow

Installation

npm install -g aws-secret-cli

Quick Start

  1. Initialize the configuration:
aws-secret-cli init
  1. Add a secret:
aws-secret-cli add DATABASE_URL "postgresql://user:pass@localhost:5432/db"
  1. List all secrets:
aws-secret-cli list
  1. Write secrets to .env file:
aws-secret-cli write
  1. Sync from .env to AWS:
aws-secret-cli sync

Commands

init

Initialize AWS Secrets Manager configuration

aws-secret-cli init

add

Add or update a secret

aws-secret-cli add KEY VALUE [options]
Options:
  -e, --environment <env>   environment (dev/staging/prod) (default: "dev")
  --write                   write to .env file after adding (default: false)

get

Get a secret value

aws-secret-cli get KEY

remove

Remove a secret

aws-secret-cli remove KEY [options]
Options:
  --write   write to .env file after removing (default: false)

list

List all secrets

aws-secret-cli list [options]
Options:
  -v, --values   show secret values (default: false)

write

Write secrets to .env file

aws-secret-cli write [options]
Options:
  -e, --environment <env>   environment (default: "development")
  -f, --filename <file>     output filename (default: ".env")

sync

Sync secrets from .env file to AWS Secrets Manager

aws-secret-cli sync [options]
Options:
  -f, --filename <file>   input filename (default: ".env")
  -m, --mode <mode>       sync mode (merge/overwrite) (default: "merge")
  -d, --dry-run          show what would be updated without making changes

Configuration

The tool stores its configuration in .secrets-config.json in your project root:

{
  "region": "us-east-1",
  "secretName": "my-app-secrets"
}

AWS Credentials

You can authenticate with AWS in two ways:

  1. Using AWS CLI credentials (recommended)
  2. Manual credential entry during initialization

Environment Variables

The following environment variables can be used to override configuration:

  • AWS_REGION: Override AWS region
  • AWS_SECRET_NAME: Override secret name

Error Handling

The tool provides detailed error messages and validation:

  • AWS credential validation
  • Region validation
  • Secret name validation
  • Configuration validation

Best Practices

  1. Always use --dry-run with sync command first
  2. Keep .secrets-config.json in .gitignore
  3. Use different secret names for different environments
  4. Regularly backup your secrets
  5. Use meaningful secret names

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

APACHE2.0 - see LICENSE file for details