A CLI Wrapper for Everyday Commands
herokutools
is a command-line interface (CLI) wrapper designed to simplify and streamline the process of interacting with your Heroku app. This tool provides a set of easy-to-use commands that help you interact with your Heroku apps more efficiently.
- Fetch logs for your Heroku apps with a single command.
- Support for multiple Heroku apps through environment variables.
- Easy setup and installation.
- Built with TypeScript and Commander.js for robust and type-safe command handling.
Before using herokutools
, ensure that you have the following:
- A Heroku account. If you don't have one, you can sign up at Heroku.
- At least one Heroku app. You can create a new app using the Heroku Dashboard or the Heroku CLI.
Without a Heroku account and app, you will not be able to use the features provided by this tool.
- Install the package globally:
npm i -g herokutools
We are working on adding a command to scale and reset your Heroku dynos. This will allow you to easily manage the number of dynos running for your application and reset them when needed.
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!
The hl
command is a CLI wrapper for fetching logs from your Heroku apps. It provides an easy way to view logs for your Heroku applications.
hl [options]
-i, --index [index]
: Index of the app to log. Valid values are1
,2
, or3
. If no index is provided, it defaults to the app name stored inprocess.env.HEROKU_TOOL_APP_1
.-a, --app [app name]
: Logs for your Heroku app. If not provided, it defaults to the saved app name based on the index.
If no options are passed, the command will fetch logs for the app name stored in process.env.HEROKU_TOOL_APP_1
.
hl
To fetch logs for the app name stored in process.env.HEROKU_TOOL_APP_2
:
hl -i 2
To fetch logs for a specific app name:
hl -a my-heroku-app
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.
The hd
command is a CLI wrapper for scaling and restarting dynos for your Heroku apps. It provides an easy way to manage the number of dynos running for your application and reset them when needed.
hd [options] [dyno] [quantity]
-a, --app [app name]
: The Heroku app name. If not provided, it defaults to the saved app name based on the index.-r, --restart
: Restart the dynos for the specified app.
To scale the dynos for a specific app to 3:
hd -a my-heroku-app web 3
To scale the dynos for the default app (stored in HEROKU_TOOL_APP_1
) to 2:
hd web 2
To restart the dynos for a specific app:
hd -a my-heroku-app -r
To restart the dynos for the default app (stored in HEROKU_TOOL_APP_1
):
hd -r
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.
The he
command is a CLI wrapper for managing environment variables for your Heroku apps. It provides an easy way to get, set, and remove environment variables.
he [options] [key] [value]
-a, --app [app name]
: The Heroku app name. If not provided, it defaults to the saved app name based on the index.-g, --get [key]
: Get the value of an environment variable.-s, --set [key] [value]
: Set the value of an environment variable.-r, --remove [key
]: Remove an environment variable.-l, --list
: List all environment variables.
To get all environment variables for a specific app:
he -a my-heroku-app -g
To get the value of an environment variable for the default app (stored in HEROKU_TOOL_APP_1):
he -g
To set the value of an environment variable for a specific app:
he -a my-heroku-app MY_VAR=my_value
To set the value of an environment variable for the default app (stored in HEROKU_TOOL_APP_1):
he MY_VAR=my_value
To remove an environment variable for a specific app:
he -a my-heroku-app -r MY_VAR
To remove an environment variable for the default app (stored in HEROKU_TOOL_APP_1):
he -r MY_VAR
- Ensure that the environment variables
HEROKU_TOOL_APP_1
,HEROKU_TOOL_APP_2
, andHEROKU_TOOL_APP_3
are set in your environment to use the index options effectively. - The command uses the
heroku logs -a <app_name> --tail
command internally to fetch and display the logs in real-time.
We are excited to announce that the first stable version of herokutools
will be 1.0.0
. This release will include all the core features, including fetching logs, scaling and restarting dynos, and setting environment variables for your Heroku apps.
Stay tuned for the release, and thank you for your support and feedback during the beta phase!
For more information, refer to the source code.
Inspiration by: ctsrc and his repotools
If you like this tool please take a moment to star this project on GitHub.