Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • 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
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • 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
  • Command Line
  • Heroku CLI Autocomplete

Heroku CLI Autocomplete

English — 日本語に切り替える

Last updated March 13, 2023

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 of the commands in the Heroku CLI and will automatically support new commands as they are 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 you’ll receive depend on whether you are using bash or zsh. After you finish setup, Autocomplete is ready to use with the tab key.

We are not planning to support shells besides bash and zsh at this time.

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 make use of 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 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, if you have the two apps listed in the output above, pressing tab after typing

heroku apps:info --app=p

autocompletes to the following:

heroku apps:info --app=production-app

Not all flags have autocomplete options. Flags that do have these options are tagged with (autocomplete) during flag name autocompletion. See Completing flag names for an example.

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”, as 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
  • Podcasts
  • Support Channels
  • Status

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences