← 返回命令列表

Linux command

heroku 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Login

heroku login

Create app

heroku create [app-name]

Deploy via Git

git push heroku main

View logs

heroku logs --tail

Open app

heroku open

Run command on dyno

heroku run [bash]

Scale dynos

heroku ps:scale web=[2]

Set environment variable

heroku config:set [KEY]=[VALUE] -a [app-name]

List apps

heroku apps

Show release history

heroku releases -a [app-name]

Rollback to a previous release

heroku rollback [v42] -a [app-name]

Connect to Postgres

heroku pg:psql -a [app-name]

说明

heroku is the CLI for Heroku platform-as-a-service. It manages applications, addons, and infrastructure on Heroku cloud. The tool handles deployment, scaling, logging, and configuration. It integrates with Git for deployments and supports multiple languages.

参数

login
Authenticate with Heroku.
create
Create new application.
logs
View application logs.
run
Run one-off command.
ps
Process management.
config
Manage environment variables.
addons
Manage add-ons.
apps
Manage applications.
releases
Show app release history; rollback to revert.
maintenance
Toggle maintenance mode (:on / :off).
pg
Manage Heroku Postgres databases.
redis
Manage Heroku Redis instances.
domains
List, add, or remove custom domains.
certs
Manage SSL/TLS certificates.
buildpacks
Manage buildpacks for an app.
-a, --app _APP_
Target application name.
-r, --remote _REMOTE_
Git remote of app to use.
-j, --json
Format output as JSON.
--help
Display help information.

FAQ

What is the heroku command used for?

heroku is the CLI for Heroku platform-as-a-service. It manages applications, addons, and infrastructure on Heroku cloud. The tool handles deployment, scaling, logging, and configuration. It integrates with Git for deployments and supports multiple languages.

How do I run a basic heroku example?

Run `heroku login` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does login do in heroku?

Authenticate with Heroku.