# awsprof

> Quickly and easily switch between AWS profiles

Latest version **1.0.0** (published 2019-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install awsprof
pnpm add awsprof
yarn add awsprof
bun add awsprof
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-10-10 |
| First published | 2019-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Geoff Dutton |
| Maintainers | dutton |

## Links

- npm: https://www.npmjs.com/package/awsprof
- Repository: https://github.com/geoffdutton/aws-profile-manager
- Homepage: https://github.com/geoffdutton/aws-profile-manager#readme
- Issues: https://github.com/geoffdutton/aws-profile-manager/issues
- npm.io page: https://npm.io/package/awsprof

## Dependencies (4)

- [ini](https://npm.io/package/ini.md) ^1.3.5
- [mri](https://npm.io/package/mri.md) ^1.1.4
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [json-stable-stringify-without-jsonify](https://npm.io/package/json-stable-stringify-without-jsonify.md) ^1.0.1

## Recent versions

- 1.0.0 (latest) — 2019-10-10
- 0.1.1 — 2019-09-22
- 0.1.0 — 2019-09-22

## README

# aws-profile-manager
![npm](https://img.shields.io/npm/v/awsprof)
![David](https://img.shields.io/david/geoffdutton/aws-profile-manager)
[![CircleCI](https://circleci.com/gh/geoffdutton/aws-profile-manager.svg?style=svg)](https://circleci.com/gh/geoffdutton/aws-profile-manager)
[![codecov](https://codecov.io/gh/geoffdutton/aws-profile-manager/branch/master/graph/badge.svg)](https://codecov.io/gh/geoffdutton/aws-profile-manager)
[![Greenkeeper badge](https://badges.greenkeeper.io/geoffdutton/aws-profile-manager.svg)](https://greenkeeper.io/)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3201/badge)](https://bestpractices.coreinfrastructure.org/projects/3201)

Quickly and easily switch between AWS profiles

## Motivation
I wanted something similar to [nvm](https://github.com/nvm-sh/nvm) or [rvm](https://rvm.io/) to manage and set my `AWS_PROFILE` environment variouable based on the directory I'm in.

## Overview
The first proof of concept uses a centralized JSON file to keep track of what profiles to use for which directories in `.aws-profile-manager/config.json` rather than relying on some sort of dot RC file per project.

Currently, this doesn't actually export any environment variables, as I'm still trying to figure out the best way to do that. 

Important note: this profile manager doesn't modify your `~/.aws/credentials` file, and only parses the aws creds file locally to present options to the user.

## Usage
First thing, install it globally:
```bash
git -c advice.detachedHead=false clone https://github.com/geoffdutton/aws-profile-manager.git --quiet -b v1.0.0 --depth=1 ~/.awsprof
cd ~/.awsprof && npm install

```

Then add this to `.bash_profile`:
```bash
export AWSPROF_INSTALL_DIR="$HOME/.awsprof"
[[ -f "$AWSPROF_INSTALL_DIR/awsprof.sh" ]] && \. "$AWSPROF_INSTALL_DIR/awsprof.sh"
```

And open a new terminal.

Then move to your project directory and save a profile:
```bash
$ cd ~/Projects/my-awesome-project
$ awsprof use
No profile set for ~/Projects/my-awesome-project
Chose a profile to use:
1)  default
2)  myStartup
```

Now you can see the export command to run when you're in that project directory:
```bash
$ cd ~/Projects/my-awesome-project
$ awsprof use
AWS_PROFILE=default
```

You can verify it exported the `AWS_PROFILE` environment variable:
```bash
$ awsprof
Current Env
AWS_PROFILE=default
```

Finally, you can reset it to be prompted again:
```bash
$ cd ~/Projects/my-awesome-project
$ awsprof reset
Removed stored profile for ~/Projects/my-awesome-project
```

---
_Source: https://npm.io/package/awsprof · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
