valt-cli
v0.2.1
Published
CLI tool for managing secrets and parameters in your projects, integrating with AWS Secrets Manager.
Maintainers
Readme
valt
valt is a simple CLI tool for managing secrets and parameters in your projects.
It integrates with AWS Secrets Manager and works seamlessly across both development and production environments.
With valt, you can manage environment variables declaratively per profile and leave access control to AWS IAM roles.
Quick Start
- Install valt.
npm install -g valt-cli- Make sure AWS CLI is configured.
aws configureCreate a secret in AWS Secrets Manager that valt can access.
Add a
valt.yamlconfiguration to your project:
# yaml-language-server: $schema=https://github.com/eniaq/valt/releases/download/0.1.0/valt.schema.json
version: "0.1"
defaults:
profile: dev
vault:
dev:
- provider: aws
secret: valt-test
- provider: dotenv
file: .env.local
env:
API_TOKEN:
description: "An API token for a service"
policy: optional
PORT:
default:
dev: "3000"
prod: "80"
vault:
- provider: aws
enabled: false- Retrieve environment variables:
$ valt
Profile: dev
┌───────────┬─────────┬──────────┬──────┐
│ Name │ Value │ Provider │ Info │
├───────────┼─────────┼──────────┼──────┤
│ API_TOKEN │ <unset> │ │ │
│ PORT │ **** │ default │ │
└───────────┴─────────┴──────────┴──────┘- Set a new value:
$ valt set API_TOKEN "token_****"- Output as
.envfile:
$ valt >> .env.test- You can also specify AWS profiles easily:
AWS_PROFILE=admin valtFeatures
🛡️ Manage Secrets with AWS Secrets Manager
valt uses AWS Secrets Manager as the primary backend for storing secrets. It does not handle secrets directly — access control is delegated to AWS IAM.📝 Declarative Configuration with
valt.yaml
Define your secrets, default values, and policies clearly. Profiles (dev,prod, etc.) are first-class citizens.🔄 Multiple Sources Support You can combine multiple secret sources. When
.envfiles are specified, they have priority over AWS Secrets Manager for those variables.📜 Schema Validation
valt.yamlcan be validated with the provided JSON schema for safety and editor integration.🔍 Flexible Command Options
-c, --config <config>: Path to configuration file-p, --profile <profile>: Profile name override-f, --format <format>: Output astable,dotenv, orauto-s, --show: Show secret values in output (only withtableformat)
Commands
Show secrets
valt [options]Options:
-c, --config <config>— Path to thevalt.yaml-p, --profile <profile>— Override default profile-f, --format <format>— Output format:table,dotenv, orauto-s, --show— Show values explicitly in the table
Set a secret
valt set <name> [value] [options]Options:
-c, --config <config>— Path to thevalt.yaml-p, --profile <profile>— Override default profile--file <file>— Read secret value from a file
Configuration
The valt.yaml file defines how secrets and parameters are managed.
See config.md for details.
License
MIT
