← Back to tools

Heroku CLI

Manage Heroku apps from the terminal

Cloud & Services linuxmacoswindows TypeScript ISC

Description

The Heroku CLI lets you create and manage Heroku applications directly from the terminal. It supports the full Heroku workflow including creating apps, deploying code via Git, managing add-ons, scaling dynos, viewing logs, running one-off processes, and managing environment config vars.

Install

homebrewbrew tap heroku/brew && brew install heroku

AI Summary

Manage Heroku apps from the terminal. Create apps, deploy via Git push, scale dynos, manage add-ons and config vars, view logs, and run one-off processes.

Capabilities

  • + Create and manage Heroku applications
  • + Deploy code via git push to Heroku remote
  • + Scale dynos and manage process types
  • + Add and configure add-ons (Postgres, Redis, etc.)
  • + Manage environment config vars
  • + Stream real-time application logs
  • + Run one-off commands and open interactive consoles

Use When

  • Deploying web applications to Heroku's managed platform
  • Need a simple git-based deployment workflow
  • Managing Heroku add-ons like Postgres, Redis, or Kafka
  • Debugging production issues via log streaming or remote console

Avoid When

  • x Need fine-grained infrastructure control (use AWS, GCP, or Azure)
  • x Cost-sensitive workloads at scale (Heroku can be expensive)
  • x Applications requiring edge deployment or global distribution (use Fly.io)

Usage Patterns

Create and deploy an app

heroku create my-app && git push heroku main

Creates a new Heroku app and deploys the current branch to it

View streaming logs

heroku logs --tail --app my-app

Continuously streams application logs for real-time debugging

Open a remote console

heroku run bash --app my-app

Opens an interactive bash session on a one-off dyno

Scale dynos

heroku ps:scale web=2 worker=1 --app my-app

Scales to 2 web dynos and 1 worker dyno

Input / Output

stdin: Interactive input for heroku run commands
stdout: App info, deployment status, logs, and command output
Exit codes:
0 Success
1 Error

Typical Pipelines

heroku logs --tail --app my-app | grep ERROR
heroku config --json --app my-app | jq 'to_entries[] | "\(.key)=\(.value)"' -r
heroku apps --json | jq '.[].name' -r | fzf | xargs heroku open --app

Related Tools

View AGENTS.md for Heroku CLI