Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DevboiDesigns committed Dec 28, 2024
2 parents ca07dc5 + 9ed791e commit db8413b
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 3 deletions.
103 changes: 101 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,106 @@ Without a Heroku account and app, you will not be able to use the features provi
npm i -g herokutools
```

## Coming Soon
## Environment Variables Documentation

`herokutools` uses environment variables to manage configurations for different Heroku apps. These environment variables allow you to set default values that the tool will use when no specific options are provided.

**Available Environment Variables**

- `HEROKU_TOOL_APP_1`: The default Heroku app name used when no options are provided.
- `HEROKU_TOOL_APP_2`: The Heroku app name used when -i 2 is specified.
- `HEROKU_TOOL_APP_3`: The Heroku app name used when -i 3 is specified.

**Setting Environment Variables**

You can set these environment variables in your shell configuration file (e.g., `.bashrc`, `.zshrc`, `.bash_profile`, etc.) or directly in your terminal session.

**<sup>Example: Setting Environment Variables in `.bashrc` or `.zshrc`</sup>**

```sh
export HEROKU_TOOL_APP_1=my-default-app
export HEROKU_TOOL_APP_2=my-second-app
export HEROKU_TOOL_APP_3=my-third-app
```

After adding these lines, reload your shell configuration:

```sh
source ~/.bashrc # or source ~/.zshrc
```

**<sup>Example: Setting Environment Variables in the Terminal</sup>**

```sh
export HEROKU_TOOL_APP_1=my-default-app
export HEROKU_TOOL_APP_2=my-second-app
export HEROKU_TOOL_APP_3=my-third-app
```

**Using Environment Variables in `herokutools`**

When you run commands with `herokutools`, it will use the environment variables you have set to determine the default Heroku app names.

**<sup>Example: Fetching Logs with `hl`</sup>**

If you have set `HEROKU_TOOL_APP_1` to `my-default-app`, running the `hl` command without any options will fetch logs for `my-default-app`:

```sh
hl
```

To fetch logs for the app set in `HEROKU_TOOL_APP_2`, use the `-i` option:

```sh
hl -i 2
```

**<sup>Example: Scaling and Restarting Dynos with `hd`</sup>**

To scale the dynos for the default app (stored in `HEROKU_TOOL_APP_1`) to 2:

```sh
hd web 2
```

To restart the dynos for the default app:

```sh
hd -r
```

<!-- **<sup>Example: Managing Environment Variables with `he`</sup>**
To get the value of an environment variable for the default app:
```sh
he -g MY_VAR
```
To set the value of an environment variable for the default app:
```sh
he -s MY_VAR my_value
```
To remove an environment variable for the default app:
```sh
he -r MY_VAR
```
To list all environment variables for the default app:
```sh
he -l
``` -->

**Notes**

- Ensure that the environment variables `HEROKU_TOOL_APP_1`, `HEROKU_TOOL_APP_2`, and `HEROKU_TOOL_APP_3` are set in your environment to use the index options effectively.
- The commands use the Heroku CLI internally to manage the apps, so make sure you have the Heroku CLI installed and authenticated.

<!-- ## Coming Soon
### Heroku Scale and Reset Dynos Command
Expand All @@ -45,7 +144,7 @@ We are working on adding a command to scale and reset your Heroku dynos. This wi
Another upcoming feature is the ability to set environment variables for your Heroku apps directly from the CLI. This will simplify the process of managing your app's configuration and ensure that your environment variables are always up to date.
Stay tuned for these exciting new features!
Stay tuned for these exciting new features! -->

# Commands

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "herokutools",
"version": "0.3.2",
"version": "0.3.3",
"description": "Heroku CLI wrapper - helpful commands you use often - made easier!",
"main": "dist",
"scripts": {
Expand Down

0 comments on commit db8413b

Please sign in to comment.