The Wayback Machine - https://web.archive.org/web/20250529105455/https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-autocomplete.html
Using Amazon Q autocomplete on the command line - Amazon Q Developer

Using Amazon Q autocomplete on the command line

Amazon Q for command line provides AI-powered autocompletion for hundreds of popular command line tools, including git, npm, docker, and aws. As you type commands, Amazon Q suggests relevant options, subcommands, and arguments based on your current context.

Using Amazon Q autocomplete

Autocomplete is automatically enabled after you install Amazon Q for command line.

To use Amazon Q autocomplete

  1. Install the Amazon Q command line.

  2. Open your terminal or command prompt.

  3. Start typing a command, and Amazon Q will display suggestions for completing your command.

  4. Press Tab to accept the suggestion, or continue typing to refine your command.

Autocomplete works with hundreds of command line tools, making it easier to remember command options and syntax.

Using autocomplete over SSH

You can set up Amazon Q autocomplete to work over SSH connections from your local machine.

To use autocomplete over SSH

  1. Install Amazon Q for command line on your local machine. For more information, see Installing Amazon Q for command line.

  2. Set up SSH integration on both your local machine and remote server. For more information, see Setting up SSH for remote use.

  3. Connect to your remote server using SSH:

    ssh user@remote-server
  4. Verify that autocomplete is working by typing a command and checking for suggestions.

Amazon Q inline on the command line

Amazon Q for command line provides AI-generated completions as you type in the command line.

An example of a Amazon Q for command line inline completion.

Supported tools

Amazon Q autocomplete supports a wide range of command line tools, including:

  • AWS CLI

  • Git

  • Docker

  • npm

  • kubectl

  • terraform

  • And many more standard Unix/Linux commands

Translating natural language to bash

The q translate command lets you write a natural language instruction, such as "copy all files in my current directory to Amazon S3", and Amazon Q translates it to an instantly executable shell code snippet.

To translate natural language to bash

  1. Open your terminal or command prompt.

  2. Use one of the following:

    • q translate prompt

    • # prompt

For example:

# list all ec2 instances in us-west-2 region

Amazon Q will translate this to:

aws ec2 describe-instances --region us-west-2

You can press Enter to execute the command, or modify it before executing.

Configuring autocomplete behavior

By default, Amazon Q shows suggestions automatically as you type. You can modify this behavior in two ways:

  1. Change when suggestions appear:

    • Open the settings GUI with q settings

    • Navigate to the "CLI completions" section

    • Enable the option "suggest on [tab]" to only show suggestions when you press Tab

  2. Disable inline suggestions completely:

    q inline disable

This gives you control over when and how suggestions appear in your terminal, allowing you to customize the experience to your workflow preferences.