### Example Heroku CLI Prompt Session Source: https://github.com/heroku/cli/blob/main/docs/prompt.md This example demonstrates an interactive session for the `heroku config:set` command using the `--prompt` flag. It shows how the prompt guides the user to enter a key and a value. ```bash $ heroku config:set --prompt Enter key: DATABASE_URL Enter value: postgres://... Setting DATABASE_URL and restarting example-app... done ``` -------------------------------- ### Install Dependencies Source: https://github.com/heroku/cli/blob/main/README.md Run this command after cloning the repository to install necessary project dependencies. ```bash npm install ``` -------------------------------- ### Setup New Pipeline with `heroku pipelines:setup` Source: https://github.com/heroku/cli/blob/main/docs/pipelines.md Bootstraps a new pipeline with common settings, creating production and staging apps. Requires an app.json in the repository. Use the -t flag to assign ownership to a team. ```bash heroku pipelines:setup my-pipeline githuborg/reponame -t my-team ``` -------------------------------- ### Display Autocomplete Installation Instructions Source: https://github.com/heroku/cli/blob/main/docs/autocomplete.md Use this command to display instructions for installing Heroku CLI autocomplete for your current shell. It can also be used to specify a shell type like bash or zsh. ```bash heroku autocomplete ``` ```bash heroku autocomplete bash ``` ```bash heroku autocomplete zsh ``` -------------------------------- ### Install a Heroku Plugin from npm Source: https://context7.com/heroku/cli/llms.txt Install a Heroku CLI plugin directly from the npm registry. Ensure the plugin name is correct. ```bash heroku plugins:install heroku-repo ``` -------------------------------- ### Install a Heroku Plugin from GitHub URL Source: https://context7.com/heroku/cli/llms.txt Install a Heroku CLI plugin by providing its full GitHub repository URL. This is useful for plugins not published on npm. ```bash heroku plugins:install https://github.com/someuser/heroku-my-plugin ``` -------------------------------- ### Install a Heroku Plugin Source: https://github.com/heroku/cli/blob/main/docs/plugins.md Installs a plugin into the Heroku CLI. This command is an alias for `heroku plugins:add`. It uses npm for installation and can override core plugins. ```bash heroku plugins:install myplugin ``` ```bash heroku plugins:install https://github.com/someuser/someplugin ``` ```bash heroku plugins:install someuser/someplugin ``` -------------------------------- ### List Installed Heroku Plugins Source: https://github.com/heroku/cli/blob/main/docs/plugins.md Lists all plugins currently installed in the Heroku CLI. Use the --core flag to show core plugins. ```bash heroku plugins ``` -------------------------------- ### Get Info About a Buildpack Source: https://github.com/heroku/cli/blob/main/docs/buildpacks.md Fetches and displays information about a specific buildpack. Requires the buildpack identifier. ```bash heroku buildpacks:info BUILDPACK ``` -------------------------------- ### Run Heroku App Locally Source: https://github.com/heroku/cli/blob/main/docs/local.md Starts the application specified by a Procfile (defaults to ./Procfile). Can specify process names and ports. ```bash heroku local ``` ```bash heroku local web ``` ```bash heroku local web=2 ``` ```bash heroku local web=1,worker=2 ``` -------------------------------- ### heroku local:start [PROCESSNAME] Source: https://github.com/heroku/cli/blob/main/docs/local.md Runs your Heroku app locally, similar to `heroku local [PROCESSNAME]`. ```APIDOC ## heroku local:start [PROCESSNAME] ### Description Runs your Heroku app locally, similar to `heroku local [PROCESSNAME]`. ### Method N/A (CLI command) ### Endpoint N/A (CLI command) ### Parameters #### Arguments - **[PROCESSNAME]** (string) - Optional - name of the process #### Flags - **-e, --env=** (string) - Optional - location of env file (defaults to .env) - **-f, --procfile=** (string) - Optional - use a different Procfile - **-p, --port=** (string) - Optional - port to listen on - **--start-cmd=** (string) - Optional - command to run as web when no Procfile is present ### Request Example ```bash $ heroku local $ heroku local web $ heroku local web=2 $ heroku local web=1,worker=2 ``` ### Response N/A (CLI command output) ### Aliases $ heroku local:start ``` -------------------------------- ### Setup Pipeline from GitHub Repo Source: https://context7.com/heroku/cli/llms.txt Bootstraps a new Heroku pipeline by connecting it to a GitHub repository. Requires an `app.json` file in the repository for configuration. The `--yes` flag bypasses confirmation prompts. ```bash heroku pipelines:setup my-pipeline githuborg/reponame --team acme-corp --yes ``` -------------------------------- ### Install a Heroku Plugin from GitHub Slug Source: https://context7.com/heroku/cli/llms.txt Install a Heroku CLI plugin using its GitHub username and repository name (slug). This is a shorthand for installing from a GitHub URL. ```bash heroku plugins:install someuser/heroku-my-plugin ``` -------------------------------- ### Run Local Heroku Apps Command Source: https://github.com/heroku/cli/blob/main/README.md Example of running the 'heroku apps' command using the local build from the root directory. ```bash ./bin/run apps ``` -------------------------------- ### Add a Heroku Plugin Source: https://github.com/heroku/cli/blob/main/docs/plugins.md Installs a plugin into the Heroku CLI using npm. Supports installation from npm registry, GitHub URLs, or GitHub slugs. Use -f to force npm to fetch remote resources. ```bash heroku plugins:add myplugin ``` ```bash heroku plugins:add https://github.com/someuser/someplugin ``` ```bash heroku plugins:add someuser/someplugin ``` -------------------------------- ### Inspect Heroku Plugin Properties Source: https://github.com/heroku/cli/blob/main/docs/plugins.md Displays installation properties of a specified plugin. Defaults to the current directory if no plugin is specified. ```bash heroku plugins:inspect myplugin ``` -------------------------------- ### Display Heroku CLI Help Source: https://github.com/heroku/cli/blob/main/docs/help.md Use this command to display general help for the Heroku CLI. You can also specify a command to get detailed help for that specific command. ```bash heroku help [COMMAND...] ``` ```bash heroku help [COMMAND...] [-n] ``` -------------------------------- ### Interactively Select Heroku CLI Version Source: https://github.com/heroku/cli/blob/main/docs/update.md Choose which version of the Heroku CLI to install through an interactive prompt. This option is ignored if a channel is explicitly provided. ```bash $ heroku update --interactive ``` -------------------------------- ### Inspect Heroku Plugin Details Source: https://context7.com/heroku/cli/llms.txt View detailed information about an installed Heroku plugin, including its commands and version. This is helpful for understanding plugin functionality. ```bash heroku plugins:inspect heroku-repo ``` -------------------------------- ### Start Heroku REPL Session Source: https://github.com/heroku/cli/blob/main/docs/repl.md Use this command to enter an interactive REPL session. This allows you to run Heroku CLI commands directly within the session. ```bash heroku repl ``` -------------------------------- ### View Available Heroku CLI Versions Source: https://github.com/heroku/cli/blob/main/docs/update.md Check for and display all available versions of the Heroku CLI that can be installed. Use the --verbose flag for more detailed information about each version. ```bash $ heroku update --available ``` ```bash $ heroku update --verbose ``` -------------------------------- ### heroku local [PROCESSNAME] Source: https://github.com/heroku/cli/blob/main/docs/local.md Runs your Heroku app locally. It starts the application specified by a Procfile (defaults to ./Procfile). ```APIDOC ## heroku local [PROCESSNAME] ### Description Runs your Heroku app locally. It starts the application specified by a Procfile (defaults to ./Procfile). ### Method N/A (CLI command) ### Endpoint N/A (CLI command) ### Parameters #### Arguments - **[PROCESSNAME]** (string) - Optional - name of the process #### Flags - **-e, --env=** (string) - Optional - location of env file (defaults to .env) - **-f, --procfile=** (string) - Optional - use a different Procfile - **-p, --port=** (string) - Optional - port to listen on - **--start-cmd=** (string) - Optional - command to run as web when no Procfile is present ### Request Example ```bash $ heroku local $ heroku local web $ heroku local web=2 $ heroku local web=1,worker=2 ``` ### Response N/A (CLI command output) ### Aliases $ heroku local:start ``` -------------------------------- ### Get a CI Config Var Source: https://github.com/heroku/cli/blob/main/docs/ci.md Retrieves a specific CI configuration variable by its key. The output can be formatted for shell or JSON. ```bash heroku ci:config:get --pipeline=PIPELINE RAILS_ENV test ``` -------------------------------- ### Start Heroku CLI Command Prompt Source: https://github.com/heroku/cli/blob/main/docs/prompt.md Add `--prompt` after any Heroku CLI command to initiate the interactive prompting mode. This guides you through the necessary inputs for the command. ```bash $ heroku COMMAND --prompt ``` -------------------------------- ### Debug CI Session Source: https://github.com/heroku/cli/blob/main/docs/ci.md Opens an interactive debugging session for your CI tests using the contents of the current directory. You can choose to start with an empty cache or without running test setup. ```bash heroku ci:debug ``` -------------------------------- ### Create New Add-on Resource Source: https://github.com/heroku/cli/blob/main/docs/addons.md Creates a new add-on resource for a given service and plan. Additional configuration items can be provided after a double-dash. ```bash heroku addons:create heroku-redis --app my-app ``` ```bash heroku addons:create heroku-postgresql:standard-0 --app my-app -- --fork DATABASE ``` -------------------------------- ### Browse Available Add-on Services Source: https://context7.com/heroku/cli/llms.txt Displays a list of all available add-on services that can be provisioned on Heroku. ```bash heroku addons:services ``` -------------------------------- ### Create a Postgres Advanced Database Source: https://github.com/heroku/cli/blob/main/docs/data.md Use this command to provision a new Postgres Advanced database. Specify the app, desired performance level, and optionally configure network settings, high availability, or a specific Postgres version. The `--wait` flag can be used to monitor the creation process. ```bash heroku data:pg:create -a [--as ] [-c ] [--followers --level ] [--high-availability ] [--name ] [--network private|shield] [--provision-option ...] [-r ] [--version ] [--wait ] ``` ```bash heroku data:pg:create --level 4G-Performance -a example-app ``` -------------------------------- ### List, Scale, and Restart Dynos with `heroku ps` Source: https://context7.com/heroku/cli/llms.txt Use `heroku ps` to list running dynos, scale their counts and sizes, restart processes, and manage autoscaling. Ensure the app name is specified with `--app`. ```bash # List all running dynos heroku ps --app my-app ``` ```bash # Scale web dynos to 3 Standard-2X and add 1 worker heroku ps:scale web=3:Standard-2X worker+1 --app my-app ``` ```bash # Restart all dynos heroku ps:restart --app my-app ``` ```bash # Restart only the web process type heroku ps:restart --app my-app --process-type web ``` ```bash # Stop a specific dyno heroku ps:stop --app my-app --dyno-name run.1828 ``` ```bash # Enable autoscaling for web dynos (Performance tier) heroku ps:autoscale:enable --app my-app --min 2 --max 10 --p95 200 ``` ```bash # Open an SSH session into a dyno heroku ps:exec --app my-app ``` ```bash # Forward local port 5432 to a dyno (useful for db tunnelling) heroku ps:forward 5432 --app my-app ``` ```bash # Copy a file from a dyno to local heroku ps:copy /app/logs/error.log --app my-app --output ./error.log ``` ```bash # Wait for all dynos to reach the latest release heroku ps:wait --app my-app ``` -------------------------------- ### Link a Heroku Plugin for Development Source: https://github.com/heroku/cli/blob/main/docs/plugins.md Links a local plugin directory into the Heroku CLI for development purposes. This can override existing plugins. Use the --install flag to install dependencies after linking. ```bash heroku plugins:link myplugin ``` -------------------------------- ### Get AI Model Resource Status Source: https://github.com/heroku/cli/blob/main/docs/ai.md Get the current status of a specific AI model resource or all AI model resources attached to an app. If no specific resource is provided, it lists all resources for the app. ```bash heroku ai:models:info claude-3-5-sonnet-acute-04281 --app example-app ``` ```bash heroku ai:models:info --app example-app ``` -------------------------------- ### List Webhooks on an App Source: https://github.com/heroku/cli/blob/main/docs/webhooks.md Lists all configured webhooks for a specified Heroku app. Use the -a flag to specify the app. ```bash heroku webhooks ``` -------------------------------- ### heroku redis [DATABASE] Source: https://github.com/heroku/cli/blob/main/docs/redis.md Gets information about the specified Redis database. ```APIDOC ## heroku redis [DATABASE] ### Description Gets information about redis ### Method CLI Command ### Endpoint `heroku redis [DATABASE]` ### Parameters #### Path Parameters - **[DATABASE]** (string) - Optional - name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app. #### Query Parameters - **-a, --app** (string) - Required - app to run command against - **-j, --json** (boolean) - Optional - output in json format - **-r, --remote** (string) - Optional - git remote of app to use #### Global Flags - **--prompt** (boolean) - Optional - interactively prompt for command arguments and flags ### Description gets information about redis ``` -------------------------------- ### heroku drains:get Source: https://github.com/heroku/cli/blob/main/docs/drains.md Retrieves the log drain configuration for a Heroku space. ```APIDOC ## heroku drains:get ### Description Display the log drain for a space ### Method GET ### Endpoint /heroku/drains/space ### Parameters #### Query Parameters - **-s, --space** (string) - Required - space for which to get log drain - **--json** (boolean) - Optional - output in json format - **--prompt** (boolean) - Optional - interactively prompt for command arguments and flags ``` -------------------------------- ### List Heroku Add-ons Source: https://context7.com/heroku/cli/llms.txt Lists all add-ons attached to the current Heroku application. Use `--all` to see add-ons across all accessible applications. ```bash heroku addons --app my-app ``` ```bash heroku addons --all ``` -------------------------------- ### Link a Local Plugin Directory for Development Source: https://context7.com/heroku/cli/llms.txt Link a local directory containing a plugin for development purposes. Changes made to the local plugin will be reflected immediately in the CLI. ```bash heroku plugins:link ./my-plugin-dev ``` -------------------------------- ### Get Feature Information Source: https://github.com/heroku/cli/blob/main/docs/features.md Displays detailed information about a specific Heroku app feature. ```APIDOC ## heroku features:info FEATURE ### Description Display information about a feature. ### Method CLI Command ### Endpoint N/A (CLI Command) ### Parameters #### Path Parameters - **FEATURE** (string) - Required - unique identifier or name of the app feature #### Query Parameters None #### Flags - **-a, --app=** (string) - Required - app to run command against - **-r, --remote=** (string) - Optional - git remote of app to use - **--json** (boolean) - Optional - output in json format #### Global Flags - **--prompt** (boolean) - Optional - interactively prompt for command arguments and flags ### Request Example ```bash heroku features:info addon-deployments -a my-app ``` ### Response #### Success Response (200) (Output format depends on flags, typically details about the feature's status) #### Response Example ```json { "name": "addon-deployments", "enabled": true, "description": "Allows add-on deployments" } ``` ``` -------------------------------- ### Display Heroku Local Version Source: https://github.com/heroku/cli/blob/main/docs/local.md Shows the installed version of node-foreman, which is used by `heroku local`. ```bash heroku local:version ``` -------------------------------- ### List Plans for a Specific Add-on Service Source: https://context7.com/heroku/cli/llms.txt Retrieves and displays the available plans for a given add-on service, typically in JSON format. ```bash heroku addons:plans heroku-redis --json ``` -------------------------------- ### Get Domain Information Source: https://github.com/heroku/cli/blob/main/docs/domains.md Retrieve detailed information about a specific custom domain configured for your Heroku app. ```bash heroku domains:info www.example.com ``` -------------------------------- ### Create AI Model Resource Source: https://github.com/heroku/cli/blob/main/docs/ai.md Provision access to an AI model and attach it to your app. Use `--as` to provide a custom alias for the model resource. A confirmation may be required for existing configurations. ```bash heroku ai:models:create claude-3-5-sonnet --app example-app ``` ```bash heroku ai:models:create stable-image-ultra --app example-app --as diffusion ``` -------------------------------- ### Get Webhook Info Source: https://github.com/heroku/cli/blob/main/docs/webhooks.md Retrieves information about a specific webhook. Use this command to inspect the details of an existing webhook. ```bash heroku webhooks:info 99999999-9999-9999-9999-999999999999 ``` -------------------------------- ### heroku config:get KEY... Source: https://github.com/heroku/cli/blob/main/docs/config.md Retrieves and displays the value of a specific configuration variable for a Heroku application. ```APIDOC ## heroku config:get KEY... ### Description Display a single config value for an app. ### Usage `heroku config:get KEY...` ### Arguments * `KEY...` - key name of the config var value ### Flags * `-a, --app ` (required) - app to run command against * `-j, --json` - output in json format * `-r, --remote ` - git remote of app to use * `-s, --shell` - output config vars in shell format ### Global Flags * `--prompt` - interactively prompt for command arguments and flags ### Examples ```bash $ heroku config:get RAILS_ENV production ``` ``` -------------------------------- ### Build the CLI Source: https://github.com/heroku/cli/blob/main/README.md Execute this command to build the Heroku CLI. Re-run it after making changes to test locally. ```bash npm run build ``` -------------------------------- ### List Available AI Models Source: https://github.com/heroku/cli/blob/main/docs/ai.md List available AI models that can be provisioned for access. This command provides an overview of models you can integrate with your applications. ```bash heroku ai:models:list ``` -------------------------------- ### Open Heroku Postgres Documentation Source: https://github.com/heroku/cli/blob/main/docs/data.md This command opens the Heroku Postgres documentation in your web browser. You can specify a browser to use for opening the documentation. ```bash USAGE $ heroku data:pg:docs [--prompt] [--browser ] FLAGS --browser= browser to open docs with (example: "firefox", "safari") GLOBAL FLAGS --prompt interactively prompt for command arguments and flags DESCRIPTION open documentation for Heroku Postgres in your web browser ``` -------------------------------- ### Uninstall a Heroku Plugin Source: https://context7.com/heroku/cli/llms.txt Remove an installed Heroku CLI plugin. This command uninstalls the specified plugin and its associated commands. ```bash heroku plugins:uninstall heroku-repo ``` -------------------------------- ### Get Heroku Space Topology Source: https://github.com/heroku/cli/blob/main/docs/spaces.md Retrieve the topology information for a specific Heroku Private Space. The output can be formatted as JSON. ```bash heroku spaces:topology [--prompt] [--json] [-s ] ``` -------------------------------- ### heroku spaces:drains:get Source: https://github.com/heroku/cli/blob/main/docs/spaces.md Retrieves the log drain configuration for a specific Heroku Space. Supports JSON output. ```APIDOC ## heroku spaces:drains:get ### Description Display the log drain for a space. ### Method CLI Command ### Endpoint N/A (CLI Command) ### Parameters #### Flags - **-s, --space** (string) - Required. Space for which to get log drain. - **--json** (boolean) - Output in JSON format. #### Global Flags - **--prompt** (boolean) - Interactively prompt for command arguments and flags. ### Aliases - $ heroku drains:get ``` -------------------------------- ### Get Info for a Webhook Event Source: https://github.com/heroku/cli/blob/main/docs/webhooks.md Retrieves detailed information about a specific webhook event using its ID. The ID is a UUID. ```bash heroku webhooks:events:info 99999999-9999-9999-9999-999999999999 ``` -------------------------------- ### Create Add-on Source: https://github.com/heroku/cli/blob/main/docs/addons.md Create a new add-on resource. You can specify the service and plan, and optionally provide additional configuration items. ```APIDOC ## heroku addons:create SERVICE:PLAN ### Description Create a new add-on resource. ### Method POST ### Endpoint /apps/:app_name/addons ### Parameters #### Path Parameters - **SERVICE:PLAN** (string) - Required - unique identifier or unique name of the add-on service plan #### Query Parameters - **app** (string) - Required - app to run command against - **remote** (string) - Optional - git remote of app to use - **as** (string) - Optional - name for the initial add-on attachment - **confirm** (string) - Optional - overwrite existing config vars or existing add-on attachments - **name** (string) - Optional - name for the add-on resource - **wait** (boolean) - Optional - watch add-on creation status and exit when complete ### Request Example ```bash # Create an add-on resource: $ heroku addons:create heroku-redis --app my-app # Create an add-on resource with additional config items: $ heroku addons:create heroku-postgresql:standard-0 --app my-app -- --fork DATABASE ``` ``` -------------------------------- ### Get Info for a Webhook Delivery Source: https://github.com/heroku/cli/blob/main/docs/webhooks.md Retrieves detailed information about a specific webhook delivery using its ID. The ID is a UUID. ```bash heroku webhooks:deliveries:info 99999999-9999-9999-9999-999999999999 ``` -------------------------------- ### heroku ps:socks Source: https://github.com/heroku/cli/blob/main/docs/ps.md Launch a SOCKS proxy into a dyno. This command establishes a connection to a specified dyno, allowing local traffic to be proxied through it. ```APIDOC ## `heroku ps:socks` ### Description Launch a SOCKS proxy into a dyno. ### Method `POST` (inferred from 'launch' action) ### Endpoint `/apps/:app/socks-proxy` (inferred) ### Parameters #### Flags - **-a, --app** (string) - Required - App to run command against. - **-d, --dyno** (string) - Optional - Specify the dyno to connect to. - **-r, --remote** (string) - Optional - Git remote of app to use. - **--prompt** - Optional - Interactively prompt for command arguments and flags. ### Request Example ```bash $ heroku ps:socks --app murmuring-headland-14719 ``` ### Response (No specific response schema documented, but implies a successful proxy setup and output indicating the proxy is running on port 1080.) ``` -------------------------------- ### Heroku Help Command Usage Source: https://github.com/heroku/cli/blob/main/docs/help.md This is the command-line usage for the `heroku help` command. It outlines the available arguments and flags for displaying help information. ```bash USAGE $ heroku help [COMMAND...] [-n] ARGUMENTS [COMMAND...] Command to show help for. FLAGS -n, --nested-commands Include all nested commands in the output. DESCRIPTION Display help for heroku. ``` -------------------------------- ### Open Heroku AI Documentation Source: https://github.com/heroku/cli/blob/main/docs/ai.md Open Heroku Managed Inference and Agent's Dev Center documentation in your browser. You can specify a browser using the `--browser` flag. ```bash heroku ai:docs ``` -------------------------------- ### Reset All User-Installed Heroku Plugins Source: https://context7.com/heroku/cli/llms.txt Uninstall all plugins that were installed by the user, reverting the CLI to its default state. This is a drastic measure and should be used with caution. ```bash heroku plugins:reset ``` -------------------------------- ### Refresh Autocomplete Cache Source: https://github.com/heroku/cli/blob/main/docs/autocomplete.md Use this flag to refresh the autocomplete cache without displaying installation instructions. This is useful for updating the autocomplete functionality. ```bash heroku autocomplete --refresh-cache ``` -------------------------------- ### List AI Tools Source: https://github.com/heroku/cli/blob/main/docs/ai.md Lists all available AI tools for a given addon or app. ```APIDOC ## `heroku ai:tools:list [ADDON]` ### Description Lists all available AI tools. ### Method CLI Command ### Endpoint `heroku ai:tools:list [ADDON]` ### Parameters #### Arguments - **ADDON** (string) - Optional - Unique identifier or globally unique name of add-on. Defaults to `heroku-inference`. #### Flags - **-a, --app** (string) - Optional - App to list tools for. - **--json** - Optional - Output in JSON format. ``` -------------------------------- ### List Buildpacks on an App Source: https://github.com/heroku/cli/blob/main/docs/buildpacks.md Lists the buildpacks currently configured for a specific Heroku app. Requires the app name. ```bash heroku buildpacks -a ``` -------------------------------- ### heroku data:pg:update [DATABASE] Source: https://github.com/heroku/cli/blob/main/docs/data.md Updates a Postgres Advanced database, typically through interactive prompts to guide the user through the update process. ```APIDOC ## `heroku data:pg:update [DATABASE]` ### Description update a Postgres Advanced database through interactive prompts ### Method PUT ### Endpoint `/heroku/data/pg/update` ### Parameters #### Path Parameters - **[DATABASE]** (string) - Optional - database name, database attachment name, or related config var on an app #### Query Parameters - **--app** (string) - Required - app to run command against - **--remote** (string) - Optional - git remote of app to use ### Response #### Success Response (200) - **message** (string) - Confirmation message of the update ``` -------------------------------- ### List Available Spaces Source: https://github.com/heroku/cli/blob/main/docs/spaces.md Lists all available Heroku Spaces for the authenticated user or a specified team. Use the `--json` flag for machine-readable output. ```bash heroku spaces [--prompt] [--json] [-t ] ``` -------------------------------- ### Get Log Drain for a Space Source: https://github.com/heroku/cli/blob/main/docs/spaces.md Displays the configured log drain for a specific Heroku Space. Requires the space name and supports JSON output. ```bash heroku spaces:drains:get -s [--prompt] [--json] ``` -------------------------------- ### Deploy to Production using Git Source: https://context7.com/heroku/cli/llms.txt Deploy your application to production by pushing your main branch to the Heroku remote. Ensure your local main branch is up-to-date before pushing. ```bash git push heroku main ``` -------------------------------- ### Get Heroku Redis Info (JSON Output) Source: https://github.com/heroku/cli/blob/main/docs/redis.md Retrieves information about a Heroku Redis instance and outputs it in JSON format. Useful for programmatic access. ```bash heroku redis:info [DATABASE] -a -j ``` -------------------------------- ### Manage Heroku Applications Source: https://context7.com/heroku/cli/llms.txt Covers the full lifecycle of Heroku apps: creation with buildpack/region/stack options, info retrieval, renaming, stack migration, transferring ownership, and deletion. ```bash # List all personal apps heroku apps # === user@example.com Apps # my-app (eu) # another-app (us) ``` ```bash # List apps across all teams as JSON heroku apps --all --json ``` ```bash # Create a new app with a name, region, and buildpack heroku apps:create my-new-app --region eu --buildpack https://github.com/heroku/heroku-buildpack-nodejs.git # Creating my-new-app... done, stack is heroku-24 # https://my-new-app.herokuapp.com/ | https://git.heroku.com/my-new-app.git ``` ```bash # Create a team app with a staging git remote heroku apps:create my-app-staging --remote staging --team acme-corp ``` ```bash # Show detailed app info heroku apps:info --app my-app # === my-app # Dynos: web: 1 # Git URL: https://git.heroku.com/my-app.git # Stack: heroku-24 # ... ``` ```bash # Rename an app heroku apps:rename my-app-v2 --app my-app # Renaming my-app to my-app-v2... done ``` ```bash # Migrate to a new stack heroku apps:stacks:set heroku-24 --app my-app # Setting stack to heroku-24... done # Run git push heroku main to trigger a new build on my-app. ``` ```bash # Transfer app to another user or team heroku apps:transfer collaborator@example.com --app my-app # Transferring my-app to collaborator@example.com... done ``` ```bash # Permanently destroy an app (requires confirmation) heroku apps:destroy --app my-app --confirm my-app ``` -------------------------------- ### Get Heroku Redis Information Source: https://github.com/heroku/cli/blob/main/docs/redis.md Use this command to retrieve general information about your Heroku Redis instance. It defaults to the primary database if none is specified. ```bash heroku redis [DATABASE] -a ``` -------------------------------- ### Get Single Config Var Value Source: https://github.com/heroku/cli/blob/main/docs/config.md Retrieves and displays the value of a specific configuration variable for a Heroku app. Can output in JSON or shell format. ```bash heroku config:get RAILS_ENV production ``` -------------------------------- ### Run One-Off Command Locally Source: https://github.com/heroku/cli/blob/main/docs/local.md Executes a single command locally, useful for tasks like database migrations. Supports environment file and port configuration. ```bash heroku local:run bin/migrate ``` -------------------------------- ### Describe Maintenance Window for Add-on Source: https://github.com/heroku/cli/blob/main/docs/data.md Retrieve and display information about the maintenance window for a given add-on. This command also supports JSON output. ```bash heroku data:maintenances:window postgresql-sinuous-92834 ``` ```bash heroku data:maintenances:window DATABASE --app production-app ``` -------------------------------- ### Update All Installed Heroku Plugins Source: https://context7.com/heroku/cli/llms.txt Update all Heroku CLI plugins to their latest available versions. It's recommended to run this command periodically to stay up-to-date. ```bash heroku plugins:update ``` -------------------------------- ### Force Re-download of Heroku CLI Version Source: https://github.com/heroku/cli/blob/main/docs/update.md Use this flag to ensure that the specified Heroku CLI version is re-downloaded, even if it appears to be already cached or installed. ```bash $ heroku update --force ``` -------------------------------- ### Show Pipeline Information Source: https://context7.com/heroku/cli/llms.txt Displays information about all applications associated with a specific Heroku pipeline. ```bash heroku pipelines:info my-pipeline ``` -------------------------------- ### Enable Web Dyno Autoscaling Source: https://github.com/heroku/cli/blob/main/docs/ps.md Enables autoscaling for web dynos, setting minimum and maximum dyno counts. Optional flags include notifications and p95 response time. ```bash heroku ps:autoscale:enable -a --max --min ``` -------------------------------- ### Get Details on Postgres Database Source: https://github.com/heroku/cli/blob/main/docs/data.md Retrieve detailed information about a Heroku Postgres Advanced database. Ensure you specify the correct app using the -a flag. ```bash heroku data:pg:info database_name ``` -------------------------------- ### heroku redis:stats-reset Source: https://github.com/heroku/cli/blob/main/docs/redis.md Resets all statistics for a Heroku Redis database, as defined by the RESETSTAT command in Redis. This is useful for getting a fresh view of performance metrics. ```APIDOC ## `heroku redis:stats-reset [DATABASE]` ### Description Resets all stats covered by RESETSTAT (https://redis.io/commands/config-resetstat). ### Method `heroku redis:stats-reset` ### Parameters #### Path Parameters - **DATABASE** (string) - Optional - name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app. #### Flags - **-a, --app** (string) - Required - app to run command against - **-c, --confirm** (string) - Optional - **-r, --remote** (string) - Optional - git remote of app to use #### Global Flags - **--prompt** - Interactively prompt for command arguments and flags. ``` -------------------------------- ### Show Available Stacks - Heroku CLI Source: https://github.com/heroku/cli/blob/main/docs/apps.md Displays a list of available stacks for Heroku applications. Requires specifying the app using the -a flag. ```bash heroku apps:stacks -a ``` -------------------------------- ### Manage Heroku dyno sizes Source: https://github.com/heroku/cli/blob/main/docs/ps.md Use this command to manage dyno sizes. When called with no arguments, it displays the current dyno size. Providing a SIZE argument sets the size, and TYPE=SIZE arguments set the quantity per type. -------------------------------- ### Get Heroku OAuth Client Info Source: https://github.com/heroku/cli/blob/main/docs/clients.md Retrieves detailed information about a specific OAuth client identified by its ID. Supports JSON and shell output formats. ```bash heroku clients:info 36120128-fee7-455e-8b7f-807aee130946 ``` -------------------------------- ### Search for Buildpacks Source: https://github.com/heroku/cli/blob/main/docs/buildpacks.md Searches for buildpacks based on a term, or filters by namespace, name, or description. The term searches across name, namespace, and description by default. ```bash heroku buildpacks:search [TERM] ``` ```bash heroku buildpacks:search --namespace ``` ```bash heroku buildpacks:search --name ``` ```bash heroku buildpacks:search --description ``` -------------------------------- ### Get Authentication Token Source: https://github.com/heroku/cli/blob/main/docs/auth.md Output the current CLI authentication token. By default, tokens are valid for 1 year; use 'authorizations:create' for long-lived tokens. ```bash heroku auth:token ``` -------------------------------- ### heroku addons:services Source: https://github.com/heroku/cli/blob/main/docs/addons.md Lists all available add-on services that can be provisioned. ```APIDOC ## heroku addons:services ### Description Lists all available add-on services. ### Flags - **--json** - Output in JSON format. ### Global Flags - **--prompt** - Interactively prompt for command arguments and flags. ``` -------------------------------- ### heroku data:pg:docs Source: https://github.com/heroku/cli/blob/main/docs/data.md Opens the official Heroku Postgres documentation in your default web browser. Provides easy access to detailed information and guides. ```APIDOC ## `heroku data:pg:docs` ### Description open documentation for Heroku Postgres in your web browser ### Method GET ### Endpoint `/data/pg/docs` ### Parameters #### Query Parameters - **--browser** (string) - Optional - browser to open docs with (example: "firefox", "safari") #### Global Flags - **--prompt** (boolean) - Optional - interactively prompt for command arguments and flags ### Request Example ```bash heroku data:pg:docs ``` ### Response #### Success Response (200) - **message** (string) - Opens the Heroku Postgres documentation in the specified browser. ``` -------------------------------- ### Enable Auto-Explain for Slow Query Logging Source: https://context7.com/heroku/cli/llms.txt Configures the `auto_explain` module to log query plans for slow queries. This helps in diagnosing performance issues by showing how queries are executed. ```bash heroku pg:settings:auto-explain DATABASE_URL on --app my-app ``` ```bash heroku pg:settings:auto-explain:log-min-duration DATABASE_URL 500 --app my-app ``` -------------------------------- ### Update Heroku CLI to a Specific Version Source: https://github.com/heroku/cli/blob/main/docs/update.md Install a precise version of the Heroku CLI by specifying the version number. This is useful for maintaining compatibility with specific project requirements. ```bash $ heroku update --version 1.0.0 ``` -------------------------------- ### List MCP Server URL Source: https://github.com/heroku/cli/blob/main/docs/ai.md List the MCP server URL for a given add-on. The `ADDON` argument defaults to `heroku-inference` if not provided. ```bash heroku ai:mcp ``` -------------------------------- ### Display Recent Maintenance Info for Add-on Source: https://github.com/heroku/cli/blob/main/docs/data.md Use this command to get details about the most recent maintenance for a specific data add-on. It supports JSON output for programmatic use. ```bash heroku data:maintenances:info postgresql-sinuous-83720 ``` ```bash heroku data:maintenances:info postgresql-sinuous-83720 --json ``` ```bash heroku data:maintenances:info DATABASE --app test-app ``` -------------------------------- ### Launch SOCKS proxy into a Heroku dyno Source: https://github.com/heroku/cli/blob/main/docs/ps.md This command launches a SOCKS proxy into a specified Heroku dyno. It will output the connection details and indicate how to stop the proxy. ```bash heroku ps:socks --app murmuring-headland-14719 ``` -------------------------------- ### heroku ai:models Source: https://github.com/heroku/cli/blob/main/docs/ai.md List available AI models to provision access to. This command provides an overview of the AI models that can be provisioned. ```APIDOC ## heroku ai:models ### Description List available AI models to provision access to. ### Aliases * `heroku ai:models:list` ### Examples ``` $ heroku ai:models:list ``` ``` -------------------------------- ### heroku ci:config:get KEY Source: https://github.com/heroku/cli/blob/main/docs/ci.md Retrieves a specific CI configuration variable by its key. Supports filtering by app, pipeline, or remote, and outputting in shell format. ```APIDOC ## heroku ci:config:get KEY ### Description Get a CI config var. ### Usage `heroku ci:config:get KEY [--prompt] [-a ] [-p ] [-r ] [-s]` ### Arguments - `KEY`: name of the config var key ### Flags - `-a, --app `: app to run command against - `-p, --pipeline `: name of pipeline - `-r, --remote `: git remote of app to use - `-s, --shell`: output config var in shell format ### Global Flags - `--prompt`: interactively prompt for command arguments and flags ### Examples ``` $ heroku ci:config:get --pipeline=PIPELINE RAILS_ENV test ``` ```