CLI to use aws cognito in a simple way
Project description
cognitoctl
A command-line tool for interacting with AWS Cognito, designed to simplify user, group, and authentication management.
Table of Contents
Description
This CLI enables easy management of users and groups in AWS Cognito. Features include:
- Group creation and management.
- User registration, authentication, and management.
- Password recovery and token updates.
It’s designed for developers needing quick integration with AWS Cognito from the command line.
Requirements
Before using this CLI, ensure the following prerequisites are met:
- Python 3.10+
- AWS CLI configured with the necessary credentials to access Cognito.
- Sufficient AWS permissions to manage Cognito.
Installation
- Install package:
pip install cognitoctl
Getting Started
Initialize the CLI
To use the CLI, you must initialize it with at least one Cognito project. Use the init command to set up a project. You can either input configuration details interactively or provide them via a configuration file.
You can use the --help option to get help on parameters and commands.
Interactive Mode:
cognitoctl init
You will be prompted to enter the necessary configuration values such as:
- Project Name (e.g., "development", "production").
- AWS Access Key ID
- AWS Secret Access Key
- Cognito User Pool ID.
- Cognito App Client ID
- Cognito Client Secret
- Need use Secret Hash (Y/N)
Configuration File:
Alternatively, you can provide the details through a TOML file:
cognitoctl init -f config.toml
Example of config.toml:
[project1]
key_id = "your-aws-access-key-id"
access_key = "your-aws-secret-access-key"
userpool_id = "your-userpool-id"
app_client_id = "your-client-id"
app_client_secret = "your-client-secret"
secret_hash = true
Managing Multiple Projects
The CLI allows you to manage multiple Cognito environments as separate projects. Each project is stored in the CLI's configuration, and you can switch between them as needed.
Add a New Project
To add another project, simply run init again with a different name:
cognitoctl init -f proyect2.toml
Select project
You can select project using:
cognitoctl config select project1
Usage
Command | Description | Actions |
---|---|---|
init |
Initializes the CLI with required configuration. | |
config |
Apply CLI configuration level actions. | list, current, set, get, select, edit |
group |
Apply group level actions. | create, delete, delete-user, add-user, list, get, edit |
user |
Apply user level actions. | create, confirm, delete, change-password, enable, disable, get, list |
Contributing
Contributions are welcome! To improve this tool, follow these steps:
Fork the repository.
Create a new branch:
git checkout -b feature/new-feature
Submit a Pull Request to the main repository, in the branch dev.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cognitoctl-1.0.0.tar.gz
.
File metadata
- Download URL: cognitoctl-1.0.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 027edc322b2e8fa540a72fe0ad6feb54f49fe85df155a8a86007d65471d5dec3 |
|
MD5 | 7a8ae725d838c2b50af2f46e62e513ec |
|
BLAKE2b-256 | 85b817760d2b102ad211319f9a8f95336101281714b19004d115a808b71aae60 |
File details
Details for the file cognitoctl-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: cognitoctl-1.0.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.15 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4b11d5bd8c685468e6ad8b9aed3021e062fe6ebaaba62e230322406392bc424 |
|
MD5 | 551f3a481e36e8718ad90e32c9ad92c4 |
|
BLAKE2b-256 | 045ab4c39ee1962af1e9338c59b416b990b1c36283ca0b448ed4921b911e659a |