Skip to content

caioquirino/awsu

Awsu

Installation

npm i -g awsu-cli

Usage

awsu exec -- aws s3 ls

Command help

Usage: awsu [options] [command]

AWS Utils CLI (npm package awsu-cli)

Options:
  -V, --version             output the version number
  -d, --debug               show debug logs
  -p, --profile <profile>   AWS profile to use
  -r, --region <region>     AWS region to use
  -h, --help                display help for command

Commands:
  exec [options] <command>  executes any command with injected AWS environment variables
  help [command]            display help for command

Subcommands

exec

Usage: awsu exec [options] -- <command>

executes any command with injected AWS environment variables

Arguments:
  command                    command to run with injected env vars

Options:
  -e, --env-file <env-file>  append dotenv file to env vars
  -h, --help                 display help for command

Extra Functionalities

dotenv integration

Variable expansion is working: https://www.npmjs.com/package/dotenv-expand

  • $KEY will expand any env with the name KEY
  • ${KEY} will expand any env with the name KEY
  • \$KEY will escape the $KEY rather than expand
  • ${KEY:-default} will first attempt to expand any env with the name KEY. If not one, then it will return default

Running via npx

npx awsu-cli exec -p profile -r eu-west-1 -- aws s3 ls

Running locally (development)

Clone the repo

npm run cli -- exec -p default -r eu-west-1 -- aws s3 ls