Skip to content

Commit

Permalink
Feat: Improved README documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakariya1057 committed Aug 15, 2023
1 parent 3690f01 commit 98e2fb3
Show file tree
Hide file tree
Showing 4 changed files with 224 additions and 27 deletions.
65 changes: 65 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Contributing to ShadowVault

Firstly, thank you for your interest in contributing to ShadowVault! 🎉 Every contribution, whether it's a small typo fix or a new feature, is greatly appreciated. This document provides guidelines and advice on how to contribute.

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Development Setup](#development-setup)
- [Code Guidelines](#code-guidelines)
- [Feedback](#feedback)

## Code of Conduct

By participating, you're expected to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md). Please report any unacceptable behavior.

## Getting Started

### Issues

- Before creating a new issue, please do a quick search to see if it's been raised already.
- Provide a clear and descriptive title.
- Describe the issue with as much detail as possible.
- If applicable, provide steps to reproduce the issue.

### Pull Requests

- Fork the repository.
- Create a new branch for each feature, fix, or improvement.
- Commit your changes following our commit message guidelines.
- Open a pull request with a clear title and description.
- If your PR closes a specific issue, mention it in the description.

## Development Setup

1. Fork and clone the repository.
2. Install dependencies:

\```bash
npm install
\```

3. Make your changes.
4. Ensure your changes don't break any existing functionality:

\```bash
npm test
\```

## Code Guidelines

- Follow the established coding style.
- Write clear and concise comments.
- Keep PRs focused—make sure they address only one concern.
- Update documentation if you're introducing changes that require it.

## Feedback

Your feedback is always welcome! If you have any suggestions or concerns, please open an issue. We value all contributions and strive for an open and inclusive environment.

---

Again, thank you for your contribution! Together, we can make ShadowVault even better.
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0)

Copyright (c) [Year] [Your Full Name or Organization Name]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, and distribute, provided that:

- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial — You may not use the material for commercial purposes.
- NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For the full license text, please visit:
https://creativecommons.org/licenses/by-nc-nd/4.0/
170 changes: 144 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,188 @@
# ShadowVault 🌐

**ShadowVault** is a cutting-edge environment management tool designed to seamlessly manage and synchronize environment configurations across multiple team members.
**ShadowVault** is an efficient and secure CLI tool designed to manage and synchronize environment files on cloud storage. Share environment configurations across your team without hassle, all while ensuring your data is safely encrypted.

## Table of Contents

- [Features](#features-)
- [Installation](#installation-)
- [AWS S3 Setup Guide](#aws-s3-setup-guide)
- [Creating an S3 Bucket](#creating-an-s3-bucket)
- [Setting Up an IAM User](#setting-up-an-iam-user)
- [Retrieving AWS Credentials for ShadowVault](#retrieving-aws-credentials-for-shadowvault)
- [Updating ShadowVault's Configuration](#updating-shadowvaults-configuration)
- [Usage](#usage-)
- [Commands](#commands-)
- [Configuration](#configuration-)
- [Upload](#upload-)
- [Download](#download-)
- [Contributing](#contributing-)
- [Support & Feedback](#support--feedback-)
- [License](#license-)

## Features 🚀

- **Unified Environment Management:** Keep all your environment configurations in one place.
- **Team Synchronization:** Ensure that all team members are using the same environment settings, reducing "works on my machine" issues.
- **Easy Integration:** ShadowVault can be integrated easily into existing projects.
- **Secure:** Your environment data is encrypted and safe.
- **Team Synchronization:** Share the same environment settings across your team.
- **Secure:** All environment data are encrypted and safely stored in the cloud.
- **Intuitive Commands:** Simple and easy-to-use commands for upload and download operations.

## Installation 💽

To install ShadowVault globally, use the following command:
To install ShadowVault globally, run the following command:

```bash
npm install -g shadowvault
```

## Usage 🛠
## AWS S3 Setup Guide

Once installed, you can invoke ShadowVault directly from your command line:
To utilize ShadowVault with AWS S3, set up a dedicated S3 bucket and IAM user:

```bash
shadowvault [command] [options]
```
### Creating an S3 Bucket

For example:
1. Create an AWS S3 bucket named `shadowvault-env`. This is the default in `~/.shadowvault/config.json`.
- _Note:_ If you choose a different name, ensure it matches your configuration.

```bash
shadowvault init
```
### Setting Up an IAM User

For a list of all commands and options:
1. Navigate to **IAM** in the AWS Console.
2. Select **Users**.
3. Click **Add User**.
4. Name your user.
5. For permissions, select **Attach existing policies directly**.
6. Click **Create Policy** and switch to the **JSON** tab.
- Paste the required policy, adjusting `shadowvault-env` if you used a different bucket name.
7. Name your policy, e.g., `ShadowVaultS3BucketPolicy`.
8. Click **Create Policy**.
9. Return to the user creation, refresh to see your policy, select it, and proceed.
10. Finalize by clicking **Create User**.

```bash
shadowvault help
### Retrieving AWS Credentials for ShadowVault

1. In IAM, click your user.
2. Under **Security credentials**, click **Create access key**.
3. Copy the displayed **Access key ID** and **Secret access key** immediately.

### Updating ShadowVault's Configuration

Create a file at this path `~/.shadowvault/config.json` containing this:

```json
{
"aws": {
"accessKeyId": "YOUR_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
"region": "YOUR_AWS_REGION",
"bucket": "YOUR_BUCKET_NAME"
}
}
```

## Commands 📜
## Usage 🛠

ShadowVault provides two main commands: `upload` and `download`.

When executed within a project directory that contains a `package.json`, the project name will automatically be extracted, making the `-n` or `--name` option optional. However, you can still specify the `-n` option if you wish to override the extracted name.

## ShadowVault Commands 📜

### 1. Upload

- `init`: Initializes a new ShadowVault configuration.
- `sync`: Synchronizes your environment with the latest configurations.
- ... [Add other commands here]
**Description:**
Safely upload environment files to cloud storage.

## Configuration 📋
**Usage:**
```bash
shadowvault upload [options] [files...]
```

**Arguments:**
- `files`: List of `.env` files you wish to upload (e.g., `.env.production`, `.env.staging`).

**Options:**
- `-A, --all`:
Use this option to upload all `.env` files from the directory.
Example:
```bash
shadowvault upload -A
```

- `-n, --name <projectName>`:
Specify the name of the project associated with the environment files. If executed within a directory with a `package.json`, this option becomes optional.
Example:
```bash
shadowvault upload -n myAwesomeProject .env.production
```

- `-s, --stage <stage>`:
Indicate the deployment stage of the environment files (like `dev`, `prod`, `staging`). If you don't specify this option, it defaults to "default".
Example:
```bash
shadowvault upload -s prod .env.production
```

- `-p, --provider <type>`:
Choose the storage provider. Currently supported options are `s3`. Default is `s3`.
Example:
```bash
shadowvault upload -p s3 .env.dev
```

- `-h, --help`:
Display the help guide for the command.

### 2. Download

**Description:**
Retrieve and save environment files from cloud storage to your local machine.

**Usage:**
```bash
shadowvault download [options] [files...]
```

ShadowVault can be configured to suit your team's needs. Configuration details can be found in the generated `.shadowvault-config` file.
**Arguments:**
- `files`: List of `.env` files you wish to download (e.g., `.env.production`, `.env.staging`).

**Options:**
- `-A, --all`:
Use this option to download all `.env` files from the storage.
Example:
```bash
shadowvault download -A
```

- `-n, --name <projectName>`:
Specify the name of the project associated with the environment files. If executed within a directory with a `package.json`, this option becomes optional.
Example:
```bash
shadowvault download -n myAwesomeProject .env.production
```

- `-s, --stage <stage>`:
Indicate the deployment stage of the environment files (like `dev`, `prod`, `staging`). If you don't specify this option, it defaults to "default".
Example:
```bash
shadowvault download -s prod .env.production
```

- `-p, --provider <type>`:
Choose the storage provider. Currently supported options are only `s3`. Default is `s3`.
Example:
```bash
shadowvault download -p s3 .env.dev
```

- `-h, --help`:
Display the help guide for the command.

## Contributing 🤝

We welcome contributions! Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
Contributions are welcome! Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) for details.

## Support & Feedback 💌

For support or to provide feedback, please raise an issue on our GitHub repository.
For support or feedback, please raise an issue on our GitHub repository.

## License 📄

Expand Down
2 changes: 1 addition & 1 deletion src/libs/commander/options/set-common-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const setCommonOptions = (command: Command): Command => {
'Specify the project associated with the files.',
)
.option(
'-e, --stage <stage>',
'-s, --stage <stage>',
'Specify the stage (e.g., dev, prod, staging). Defaults to "default".',
'default',
)
Expand Down

0 comments on commit 98e2fb3

Please sign in to comment.