LinuxCommandLibrary

heroku

Manage and deploy Heroku applications

TLDR

Log in to your Heroku account

$ heroku login
copy

Create a Heroku app
$ heroku create
copy

Show logs for an app
$ heroku logs --app [app_name]
copy

Run a one-off process inside a dyno (Heroku virtual machine)
$ heroku run [process_name] --app [app_name]
copy

List dynos (Heroku virtual machines) for an app
$ heroku ps --app [app_name]
copy

Permanently destroy an app
$ heroku destroy --app [app_name]
copy

SYNOPSIS

`heroku COMMAND [ARGS...]`
`heroku help [COMMAND]`

Examples:
`heroku login`
`heroku apps:create [APP_NAME]`
`heroku deploy`
`heroku logs --tail`

The `heroku` command typically requires a subcommand to perform an action.

PARAMETERS

--app
    Specify the Heroku application to operate on.

-a
    Shorthand for --app.

--remote
    Specify the Git remote to use for the application.

-r
    Shorthand for --remote.

--json
    Output in JSON format (where applicable), useful for scripting.

--version
    Display the Heroku CLI version.

--help
    Display help for the Heroku CLI or a specific command.

-h
    Shorthand for --help.

--verbose
    Enable verbose output for debugging.

--debug
    Enable debug output for detailed troubleshooting, including HTTP requests.

DESCRIPTION

The `heroku` command is the official Command Line Interface (CLI) for interacting with the Heroku Platform-as-a-Service (PaaS). It empowers developers to manage their Heroku applications directly from the terminal, providing a powerful interface to the Heroku API.

With the Heroku CLI, users can perform a wide array of tasks, including creating new applications, deploying code, scaling dynos, configuring environment variables, managing databases, and inspecting application logs. It streamlines the development workflow by integrating common development practices like Git-based deployments and providing access to live application shells.

The CLI is highly extensible through a robust plugin architecture, allowing developers to add custom commands and integrate with other services. It serves as the primary tool for deploying, monitoring, and debugging applications hosted on the Heroku cloud platform, making complex cloud operations accessible through simple command-line invocations.

CAVEATS

The `heroku` command is not a native Linux utility but a separately installed client-side application. It requires an active internet connection and a Heroku user account for most operations, as it interacts directly with the Heroku cloud platform's API. Functionality is entirely dependent on the Heroku service availability. Command syntax and available subcommands can be extensive and context-dependent, often requiring specific subcommand knowledge.

SUBCOMMANDS

The `heroku` command acts as a dispatcher for hundreds of subcommands, each designed for specific tasks. Examples include `heroku apps` (to manage applications), `heroku ps` (to manage dynos/processes), `heroku config` (to manage environment variables), `heroku logs` (to stream application logs), and `heroku run` (to execute one-off commands).

PLUGINS

The Heroku CLI is highly extensible through a plugin architecture. Users can install community-developed or custom plugins using `heroku plugins:install ` to add new commands or extend existing functionality, allowing for deep integration with specific workflows or third-party services.

AUTHENTICATION

To use most `heroku` commands, you must first authenticate using `heroku login`. This command opens a browser for web-based authentication or prompts for credentials directly in the terminal, securely storing your session token locally.

HISTORY

Heroku, Inc. was founded in 2007, pioneering the Platform-as-a-Service (PaaS) model. The Heroku CLI has been an integral part of its offering since early on, evolving significantly over time. Initially developed in Ruby, the CLI transitioned to a modern architecture primarily written in Node.js and Go to enhance performance, cross-platform compatibility, and maintainability. This shift allowed for a more robust and faster user experience, keeping pace with the rapid expansion of the Heroku platform and its features. It remains the primary, and often preferred, method for developers to programmatically interact with their Heroku applications.

SEE ALSO

git(1), ssh(1), curl(1), aws(1) (AWS CLI), gcloud(1) (Google Cloud CLI)

Copied to clipboard