# Heroku CLI
> Manage Heroku apps from the terminal

## 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

## When to Use
- 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

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

## Key Flags
- `create`: Create a new Heroku app
- `logs --tail`: Stream application logs in real time
- `config:set`: Set environment config vars for the app
- `ps:scale`: Scale dynos (e.g., web=2 worker=1)
- `run`: Run a one-off command on a Heroku dyno
- `addons:create`: Provision an add-on for the app

## 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

## Installation
- **homebrew**: `brew tap heroku/brew && brew install heroku`

## Related Tools
- [flyctl](/tools/flyctl) (alternative): Fly.io is a modern alternative with edge deployment and Docker containers
- [vercel](/tools/vercel) (alternative): Vercel for frontend/Jamstack, Heroku for full-stack applications
- [docker](/tools/docker) (complementary): Heroku supports container deployment alongside buildpack-based deploys

---
Source: https://littlescripts.sh/tools/heroku
