View a markdown version of this page

Use ListRepositories with a CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use ListRepositories with a CLI

The following code examples show how to use ListRepositories.

CLI
AWS CLI

To view a list of repositories

The following list-repositories example lists all AWS CodeCommit repositories associated with the user's AWS account.

aws codecommit list-repositories

Output:

{ "repositories": [ { "repositoryName": "MyDemoRepo", "repositoryId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" }, { "repositoryName": "MyOtherDemoRepo", "repositoryId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222" } ] }

For more information, see View CodeCommit repository details in the AWS CodeCommit User Guide.

PowerShell
Tools for PowerShell V4

Example 1: This example lists all repositories in ascending order by repository name.

Get-CCRepositoryList -Order Ascending -SortBy RepositoryName

Output:

RepositoryId RepositoryName ------------ -------------- c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE MyDemoRepo 05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE MyNewRepo
  • For API details, see ListRepositories in AWS Tools for PowerShell Cmdlet Reference (V4).

Tools for PowerShell V5

Example 1: This example lists all repositories in ascending order by repository name.

Get-CCRepositoryList -Order Ascending -SortBy RepositoryName

Output:

RepositoryId RepositoryName ------------ -------------- c7d0d2b0-ce40-4303-b4c3-38529EXAMPLE MyDemoRepo 05f30c66-e3e3-4f91-a0cd-1c84aEXAMPLE MyNewRepo
  • For API details, see ListRepositories in AWS Tools for PowerShell Cmdlet Reference (V5).