Verify the Greengrass CLI installation on the device - Amazon IoT Greengrass
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Verify the Greengrass CLI installation on the device

The Greengrass CLI can take up to a minute to deploy. Run the following command to check the status of the deployment. Replace MyGreengrassCore with the name of your core device.

aws greengrassv2 list-effective-deployments --core-device-thing-name MyGreengrassCore

The coreDeviceExecutionStatus indicates the status of the deployment to the core device. When the status is SUCCEEDED, run the following command to verify that the Greengrass CLI is installed and runs. Replace /greengrass/v2 with the path to the root folder.

Linux or Unix
/greengrass/v2/bin/greengrass-cli help
Windows Command Prompt (CMD)
C:\greengrass\v2\bin\greengrass-cli help
PowerShell
C:\greengrass\v2\bin\greengrass-cli help

The command outputs help information for the Greengrass CLI. If the greengrass-cli isn't found, the deployment might have failed to install the Greengrass CLI. For more information, see Troubleshooting Amazon IoT Greengrass V2.

You can also run the following command to manually deploy the Amazon IoT Greengrass CLI to your device.

  • Replace region with the Amazon Web Services Region that you use. Make sure that you use the same Amazon Web Services Region that you used to configure the Amazon CLI on your device.

  • Replace account-id with your Amazon Web Services account ID.

  • Replace MyGreengrassCore with the name of your core device.

Linux, macOS, or Unix
aws greengrassv2 create-deployment \ --target-arn "arn:aws-cn:iot:region:account-id:thing/MyGreengrassCore" \ --components '{ "aws.greengrass.Cli": { "componentVersion": "2.12.6" } }'
Windows Command Prompt (CMD)
aws greengrassv2 create-deployment ^ --target-arn "arn:aws-cn:iot:region:account-id:thing/MyGreengrassCore" ^ --components "{\"aws.greengrass.Cli\":{\"componentVersion\":\"2.12.6\"}}"
PowerShell
aws greengrassv2 create-deployment ` --target-arn "arn:aws-cn:iot:region:account-id:thing/MyGreengrassCore" ` --components '{\"aws.greengrass.Cli\":{\"componentVersion\":\"2.12.6\"}}'
Tip

You can add /greengrass/v2/bin (Linux) or C:\greengrass\v2\bin (Windows) to your PATH environment variable to run greengrass-cli without its absolute path.