diff --git a/README.md b/README.md index 9daf773..a4c0d06 100644 --- a/README.md +++ b/README.md @@ -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. + +**Example: Setting Environment Variables in `.bashrc` or `.zshrc`** + +```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 +``` + +**Example: Setting Environment Variables in the Terminal** + +```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. + +**Example: Fetching Logs with `hl`** + +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 +``` + +**Example: Scaling and Restarting Dynos with `hd`** + +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 +``` + + + +**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. + + # Commands diff --git a/package.json b/package.json index 1689b79..bcee3fb 100644 --- a/package.json +++ b/package.json @@ -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": {