Deep-dive on the Next Gen Platform. Join the Webinar!

Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Node.js Behavior in Heroku
      • Working with Node.js
      • Troubleshooting Node.js Apps
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • Working with PHP
      • PHP Behavior in Heroku
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
    • Heroku Inference
      • AI Models
      • Inference Essentials
      • Inference API
      • Quick Start Guides
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Developer Tools
  • Command Line
  • Heroku CLI Autocomplete

Heroku CLI Autocomplete

English — 日本語に切り替える

Last updated January 31, 2025

Table of Contents

  • Installing Autocomplete
  • Command Name Completion
  • Flag Name Completion
  • Flag Value Completion
  • Completion for Config Vars and Add-On Names
  • Uninstalling Autocomplete

Heroku CLI Autocomplete helps you complete command and flag names when you press the tab key. CLI Autocomplete completes all commands in the Heroku CLI and automatically supports new commands as they’re added. You can also complete values for some flags and args, including apps, pipelines and config vars.

Installing Autocomplete

To get started, update your CLI and run the setup.

$ heroku update
$ heroku autocomplete

For CLI Autocomplete to work correctly, you must be on the latest version of the Heroku CLI. Updating to the latest version is included in the instructions above.

 

If you installed the CLI via Homebrew and want to use Autocomplete via Homebrew’s completions, upgrade the CLI via Homebrew for instructions.

The specific instructions that you receive depend on whether you use bash or zsh. After you finish setup, Autocomplete is ready to use with the tab key.

This feature is only available for bash and zsh.

Command Name Completion

You can start writing a command and then press tab to see the different possibilities for completing it. You can match against all commands that match a given prefix.

$ heroku <TAB>
addons              -- lists your add-ons and attachments
addons:attach       -- attach add-on resource to a new app
addons:create       -- create an add-on resource
...

For example, pressing tab after typing heroku add autocompletes to heroku addons.

In bash shells, autocompletion triggers by pressing tab twice successively.

Flag Name Completion

Most CLI commands use flags to provide additional input. Flags are prefaced with two dashes (--), such as (--app). Some commands have many different possible flags. You can view all available flags for each command by typing -- and then pressing the tab key. You can match against all flag names that match a given prefix.

$ heroku apps:info --<TAB>
--app               -- (autocomplete) app to run command against
--as                -- name for add-on attachment

For example, pressing tab after typing heroku apps:info --a autocompletes to heroku apps:info --app.

Flag Value Completion

Most flags require you to provide a value. For example, --app requires you to specify the name of an app. With Autocomplete, you can complete values for many popular flags, including --app,--pipeline, --space, and --team.

$ heroku apps:info --app=<TAB>
staging-app
production-app

For example, you have the two apps listed in the output above and you press tab after typing:

heroku apps:info --app=p

It autocompletes to:

heroku apps:info --app=production-app

Not all flags have autocomplete options. Flags that have these options are tagged with (autocomplete) during flag name autocompletion. For an example, see Completing flag names.

Completion for Config Vars and Add-On Names

You can complete config vars and add-on names when the CLI knows the app. The CLI can infer the app via the Git remote, or you can provide the app name via a flag. We call these kinds of completions contextual completions because the CLI needs context to know how to complete them.

Uninstalling Autocomplete

To uninstall Autocomplete, remove the plugin and delete the autocomplete environment variable from your zsh or bash profile.

$ heroku plugins:uninstall autocomplete  

Keep reading

  • Command Line

Feedback

Log in to submit feedback.

Using CLI Plugins Heroku CLI Commands

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices