

# Interact with CodeBuild using the Amazon CLI
<a name="setting-up-cli"></a>

If you follow the steps in [Getting started using the console](getting-started-overview.md#getting-started) to access Amazon CodeBuild for the first time, you most likely do not need the information in this topic. However, as you continue using CodeBuild, you might want to do things such as allow users to use the Amazon CLI to interact with CodeBuild instead of (or in addition to) the CodeBuild console, the CodePipeline console, or the Amazon SDKs.

To install and configure the Amazon CLI, see [Getting Set Up with the Amazon Command Line Interface](https://docs.amazonaws.cn/cli/latest/userguide/cli-chap-getting-set-up.html) in the *Amazon Command Line Interface User Guide*.

After installing the Amazon CLI, complete the following tasks:

1. Run the following command to confirm whether your installation of the Amazon CLI supports CodeBuild:

   ```
   aws codebuild list-builds
   ```

   If successful, information similar to the following will appear in the output:

   ```
   {
     "ids": []
   }
   ```

   The empty square brackets indicate that you have not yet run any builds.

1. If an error is output, you must uninstall your current version of the Amazon CLI and then install the latest version. For more information, see [Uninstalling the Amazon CLI](https://docs.amazonaws.cn/cli/latest/userguide/cli-uninstall.html) and [Installing the Amazon Command Line Interface](https://docs.amazonaws.cn/cli/latest/userguide/installing.html) in the *Amazon Command Line Interface User Guide*.