{"id":20853742,"url":"https://github.com/wolfeidau/cognito-cli","last_synced_at":"2025-06-24T06:33:05.671Z","repository":{"id":136376873,"uuid":"251517822","full_name":"wolfeidau/cognito-cli","owner":"wolfeidau","description":"This is the missing CLI tool for working with AWS Cognito","archived":false,"fork":false,"pushed_at":"2020-04-18T09:31:58.000Z","size":65,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T18:16:47.351Z","etag":null,"topics":["aws","cli","cognito","golang"],"latest_commit_sha":null,"homepage":"https://github.com/wolfeidau/cognito-cli","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wolfeidau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-31T06:22:26.000Z","updated_at":"2024-05-30T16:27:35.000Z","dependencies_parsed_at":"2023-07-26T20:31:51.076Z","dependency_job_id":null,"html_url":"https://github.com/wolfeidau/cognito-cli","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/wolfeidau/cognito-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fcognito-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fcognito-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fcognito-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fcognito-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolfeidau","download_url":"https://codeload.github.com/wolfeidau/cognito-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolfeidau%2Fcognito-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261620538,"owners_count":23185539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cli","cognito","golang"],"created_at":"2024-11-18T03:23:00.168Z","updated_at":"2025-06-24T06:33:05.625Z","avatar_url":"https://github.com/wolfeidau.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cognito-cli\n\nThis is the missing CLI tool for working with [AWS Cognito](https://aws.amazon.com/cognito), it provides a bunch of utility functions which are designed to make administering Cognito easier.\n\n[![GitHub Actions status](https://github.com/wolfeidau/cognito-cli/workflows/Go/badge.svg?branch=master)](https://github.com/wolfeidau/cognito-cli/actions?query=workflow%3AGo)\n[![Go Report Card](https://goreportcard.com/badge/github.com/wolfeidau/cognito-cli)](https://goreportcard.com/report/github.com/wolfeidau/cognito-cli) [![Coverage Status](https://coveralls.io/repos/github/wolfeidau/cognito-cli/badge.svg?branch=master)](https://coveralls.io/github/wolfeidau/cognito-cli?branch=master)\n\n# Installation\n\nInstall it using [gobinaries](https://gobinaries.com/).\n\n```\ncurl -sf https://gobinaries.com/wolfeidau/cognito-cli | sh\n```\n\nDownload the latest release from the [release page](https://github.com/wolfeidau/cognito-cli/releases).\n\nOr if you have a working Go installation (Go-1.14 or higher) and want to build `cognito-cli` it fun the following command to install in your `$GOPATH/bin` folder.\n\n```bash\nGO111MODULE=off go get -u github.com/wolfeidau/cognito-cli\n```\n\n# Usage\n\nSome example commands are as follows:\n\n```\ncognito-cli --region=ap-southeast-2 --profile=wolfeidau-dev ls\n+--------------------------+--------------------------------------+--------------------------------+\n| ID                       | NAME                                 | CREATED                        |\n+--------------------------+--------------------------------------+--------------------------------+\n| ap-southeast-2_abc123def | somepool_dev_master                  | 2020-03-12 11:52:24 +1100 AEDT |\n| ap-southeast-2_abc123cde | otherpool_dev_master                 | 2019-02-02 14:47:25 +1100 AEDT |\n+--------------------------+--------------------------------------+--------------------------------+\n```\n\nThis CLI tool supports the standard `AWS_REGION` and `AWS_PROFILE` environment variables to configure region and AWS cli profile respectively, so the following command also works.\n\n```\nAWS_PROFILE=wolfeidau-dev AWS_REGION=ap-southeast-2 cognito-cli ls\n+--------------------------+--------------------------------------+--------------------------------+\n| ID                       | NAME                                 | CREATED                        |\n+--------------------------+--------------------------------------+--------------------------------+\n| ap-southeast-2_abc123def | somepool_dev_master                  | 2020-03-12 11:52:24 +1100 AEDT |\n| ap-southeast-2_abc123cde | otherpool_dev_master                 | 2019-02-02 14:47:25 +1100 AEDT |\n+--------------------------+--------------------------------------+--------------------------------+\n```\n\nI have also pulled out the CLI help for each sub command and provided them in the order which they are best explored in.\n\nTo display a list of user pools.\n\n```\nUsage: cognito-cli ls\n\nList pools.\n\nFlags:\n      --help                    Show context-sensitive help.\n      --debug                   Enable debug mode.\n  -r, --region=\"us-east-1\"      AWS Region ($AWS_REGION).\n  -p, --profile=PROFILE-FLAG    AWS CLI profile ($AWS_PROFILE).\n      --disable-local-time      Disable localisation of times output.\n      --version\n\n      --csv                     Enable csv output.\n```\n\nTo list the schema attributes of a user pool.\n\n```\nUsage: cognito-cli list-attributes --user-pool-id=STRING\n\nList the schema attributes of the user pool.\n\nFlags:\n      --help                    Show context-sensitive help.\n      --debug                   Enable debug mode.\n  -r, --region=\"us-east-1\"      AWS Region ($AWS_REGION).\n  -p, --profile=PROFILE-FLAG    AWS CLI profile ($AWS_PROFILE).\n      --disable-local-time      Disable localisation of times output.\n      --version\n\n      --user-pool-id=STRING\n```\n\nTo find users in a pool.\n\n```\nUsage: cognito-cli find --user-pool-id=STRING\n\nFind users.\n\nFlags:\n      --help                             Show context-sensitive help.\n      --debug                            Enable debug mode.\n  -r, --region=\"us-east-1\"               AWS Region ($AWS_REGION).\n  -p, --profile=PROFILE-FLAG             AWS CLI profile ($AWS_PROFILE).\n      --disable-local-time               Disable localisation of times output.\n      --version\n\n      --user-pool-id=STRING\n      --csv                              Enable csv output.\n      --attributes=Username,email,...    Attributes to retrieve and output.\n      --back-off=500                     Delay in ms used to backoff during paging of records\n      --filter=KEY=VALUE;...             Filter users based on a set of patterns, supports '*' and '?' wildcards in either string.\n```\n\nTo export users in a pool, filter and write the results in CSV format, I use this for analysis and to verify the integrity of user details stored.\n\n```\nUsage: cognito-cli export --user-pool-id=STRING\n\nExport users, filter and write the results in CSV format.\n\nFlags:\n      --help                    Show context-sensitive help.\n      --debug                   Enable debug mode.\n  -r, --region=\"us-east-1\"      AWS Region ($AWS_REGION).\n  -p, --profile=PROFILE-FLAG    AWS CLI profile ($AWS_PROFILE).\n      --disable-local-time      Disable localisation of times output.\n      --version\n\n      --user-pool-id=STRING\n      --back-off=500            Delay in ms used to backoff during paging of records\n      --filter=KEY=VALUE;...    Filter users based on a set of patterns, supports '*' and '?' wildcards in either string.\n```\n\n**NOTE:** This is not designed to directly feed into the [StartUserImportJob](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_StartUserImportJob.html) operation, some transformations may be required.\n\nTo find users in a pool and log them out.\n\n```\nUsage: cognito-cli logout --user-pool-id=STRING\n\nFind users and trigger a logout.\n\nFlags:\n      --help                    Show context-sensitive help.\n      --debug                   Enable debug mode.\n  -r, --region=\"us-east-1\"      AWS Region ($AWS_REGION).\n  -p, --profile=PROFILE-FLAG    AWS CLI profile ($AWS_PROFILE).\n      --disable-local-time      Disable localisation of times output.\n      --version\n\n      --user-pool-id=STRING\n      --back-off=500            Delay in ms used to backoff during paging of records\n      --filter=KEY=VALUE;...    Filter users based on a set of patterns, supports '*' and '?' wildcards in either string.\n```\n\n**NOTE:** This calls [AdminUserGlobalSignOut](https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminUserGlobalSignOut.html) for each user which revokes their refresh token, it won't actually log them out straight away, they will however have to log in the next time they attempt to refresh their access token. This can take up to 1 hour for users who have recently refreshed their token.\n\n# License\n\nThis application is released under Apache 2.0 license and is copyright [Mark Wolfe](https://www.wolfe.id.au).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fcognito-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolfeidau%2Fcognito-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolfeidau%2Fcognito-cli/lists"}